Skip to content

fix(go.d): unify histogram bucket dimension names - #23021

Merged
ilyam8 merged 1 commit into
netdata:masterfrom
ilyam8:histogram-bucket-dimension-names
Jul 7, 2026
Merged

fix(go.d): unify histogram bucket dimension names#23021
ilyam8 merged 1 commit into
netdata:masterfrom
ilyam8:histogram-bucket-dimension-names

Conversation

@ilyam8

@ilyam8 ilyam8 commented Jul 7, 2026

Copy link
Copy Markdown
Member
Summary
Test Plan
Additional Information
For users: How does this change affect me?

Summary by cubic

Unifies histogram bucket dimension names to the bare le value (e.g., 0.1, +Inf) across chartengine autogen and template paths, ordered numerically with +Inf last. Removes the bucket_ prefix for consistent heatmap dimensions and clearer docs/tests.

  • Refactors

    • chartengine autogen sets dimensionName to the le value; tests and Prometheus histogram golden updated.
    • Docs updated in chartengine/README.md, charttpl/README.md, and SKILL to describe naming and ordering.
  • Migration

    • If you reference bucket dimension names (dashboards, alerts, overrides), replace bucket_<value> with <value>.

Written for commit 834547d. Summary will update on new commits.

Review in cubic

@ilyam8
ilyam8 enabled auto-merge (squash) July 7, 2026 07:27
@sonarqubecloud

sonarqubecloud Bot commented Jul 7, 2026

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 7 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant Prometheus as Prometheus Target
    participant Collector as go.d Prometheus Collector
    participant Metrix as metrix (ReadFlatten)
    participant Autogen as chartengine autogen
    participant Tpl as charttpl template
    participant Charts as Netdata Charts

    Note over Prometheus,Charts: Histogram bucket dimension naming flow

    Collector->>Prometheus: scrape /metrics
    Prometheus-->>Collector: histogram metrics (e.g., http_requests_duration_seconds_bucket{le="0.1"})
    Collector->>Metrix: ReadFlatten(metrics)
    Metrix-->>Collector: []FlattenedMetric (each with label le="0.1")
    Note over Collector: bucket metrics are non‑cumulative range totals

    alt Autogen path
        Collector->>Autogen: buildHistogramBucketAutogenRoute(metric)
        Autogen->>Autogen: chartID = metric.name + labels (excluding le)
        Autogen->>Autogen: dimensionName = le value (e.g., "0.1")
        Note right of Autogen: NEW: dimensionName no longer "bucket_" + upperBound
        Autogen-->>Collector: autogenRoute{dimensionName: "0.1", ...}
        Collector->>Charts: create chart with dimensions ["0.1", ..., "+Inf"]
    else Template path
        Collector->>Tpl: apply chart template
        Tpl->>Tpl: infer bucket dimensions from metrix labels
        Tpl->>Tpl: dimensionName = le value (bare)
        Note right of Tpl: NEW: template also uses bare le (documented)
        Tpl-->>Collector: resolved chart dimensions
        Collector->>Charts: create chart with dimensions ["0.1", ..., "+Inf"]
    end

    Note over Charts: Dimensions ordered numerically, +Inf last

    alt Example dimension list
        Charts->>Charts: ["0.1", "0.5", "1", "2", "10", "+Inf"]
    end
Loading

Re-trigger cubic

@github-actions github-actions Bot added area/docs area/collectors Everything related to data collection collectors/go.d area/go labels Jul 7, 2026
@ilyam8
ilyam8 merged commit bdb72b9 into netdata:master Jul 7, 2026
149 of 155 checks passed
@ilyam8
ilyam8 deleted the histogram-bucket-dimension-names branch July 7, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants