Skip to content

Define metric aggregation #844

@thompson-tomo

Description

@thompson-tomo

Is your feature request related to a problem? Please describe.
In semconv it is supported to define the bucket boundaries for a Histogram however currently this must be manually added as free text in the documentation hence blocking automated metric regidtry

Describe the solution you'd like
The ability to optionally define the parameters for aggregation such as the bucket boundaries.

Idea is to have an aggregation object which can contain how data is to be aggregated & via a has map any parameters supported by that aggregation type.

Describe alternatives you've considered
Overloading it into notes

Additional context
Eventual configuration needs to be able to support the following:

Default

aggregation:
  method: default (or empty) -> in resolved schema it has been resolved
  monotonic: true/false -> only in resolved schema

Sum

aggregation:
  method: sum
  monotonic: true/false -> only in resolved schema

For last value

aggregation:
  method: lastvalue

For histogram's

aggregation:
  method: histogram

For explicit bucket histogram's

aggregation:
  method: explicithistogram
  parameters:
    recordminmax: true/false
    boundaries:
    - 0
    - 5

For explicit exponential bucket histogram's

aggregation:
  method: exponentialhistogram
  parameters:
    maxscale: 1
    maxsize: 10
    recordminmax: true/false

In the future you could have:

aggregation:
  method: custom
  parameters:
    recordminmax: true/false
    minmeasurement: 0
    maxmeasurement: 240
    boundaries:
    - 0
    - 5

Which is based on https://opentelemetry.io/docs/specs/otel/metrics/sdk/#aggregation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions