open-telemetry / open-telemetry/weaver

Add metric category information

Open
#993 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

model
Dominant language
Rust
Stars
486
Forks
108
Avg merge
3d 4h
Merged PRs (30d)
40

Description

What are you trying to achieve?
Metric collection right now is mostly working with boolean flags in the collector and specific integration names in SDKs.
I would like to be able to turn on and off metrics, as well as filter or prioritize them, based on category metadata.

What did you expect to see?
I expect that metric definition would carry category information.
An example of metric definition is by mdatagen in the collector where the metric category would be defined in yaml format:
https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/postgresqlreceiver/metadata.yaml

postgresql.bgwriter.buffers.allocated:
    description: Number of buffers allocated.
    enabled: true
    sum:
      aggregation_temporality: cumulative
      monotonic: true
      value_type: int
    unit: "{buffers}"

I would want to add additional metadata to the metric definition:

postgresql.bgwriter.buffers.allocated:
    description: Number of buffers allocated.
    categories:
      - postgresql
      - database
      - scraper
    enabled: true
    sum:
      aggregation_temporality: cumulative
      monotonic: true
      value_type: int
    unit: "{buffers}"

I would like to see the same logic applied to all metrics such as SDK metrics, so end users can set this information via uniform configuration. The categories should be defined in a central location such as the specification repository, the configuration as part of the configuration SIG.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the referenced receiver/postgresqlreceiver/metadata.yaml and the mdatagen metric-definition example to understand the proposed metadata shape. Review how Weaver currently represents metric definitions, then determine how a central category vocabulary and uniform configuration could apply across SDK and collector metrics; done requires an agreed design and implementation scope.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.