Skip to main content

Error message

{context}: max_bins must be between 2 and 100000, got {value}
Example: defaults: max_bins must be between 2 and 100000, got 1

When this error occurs

The max_bins parameter in histogram options controls how many bins the frequency distribution uses. It must be an integer between 2 and 100,000 (inclusive). This error is raised when the value falls outside that range.

Example: request that triggers this error

{
  "defaults": {
    "enabled_stats": ["histogram"],
    "stat_options": {
      "histogram": { "max_bins": 1 }
    }
  },
  "refresh": { "trigger": "manual" }
}
A histogram with fewer than 2 bins is meaningless.

How to fix

Set max_bins to a value between 2 and 100,000. If omitted, the server defaults to 50:
{
  "defaults": {
    "enabled_stats": ["histogram"],
    "stat_options": {
      "histogram": { "max_bins": 200 }
    }
  },
  "refresh": { "trigger": "manual" }
}
Common values:
  • 50 (default) — good for most columns
  • 200–1000 — useful for high-cardinality categorical columns
  • 100,000 — maximum, for very granular distributions