Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metrics routed using routing connector with datapoint context are missing AggregationTemporality #37273

Open
benzaita opened this issue Jan 16, 2025 · 2 comments
Labels
bug Something isn't working connector/routing needs triage New item requiring triage

Comments

@benzaita
Copy link

Component(s)

connector/routing

What happened?

Description

When routing using a datapoint context, the routed Metric is missing IsMonotonic and AggregationTemporality (when routing using the default context, it works fine).

Trying to forward them to a Datadog Exporter fails due to that.

Steps to Reproduce

Config:

receivers:
  otlp:
    protocols:
      http:
        endpoint: 0.0.0.0:4318

exporters:
  debug:
    verbosity: detailed

connectors:
  routing/stage:
    match_once: true
    table:

    # outbound metrics have undefined/default IsMonotonic and AggregationTemporality
    - condition: 'attributes["stage"] == "production"'
      context: datapoint
      pipelines: [metrics/prod]

    # outbound metrics have proper IsMonotonic and AggregationTemporality
    # - statement: 'route()'
    #   pipelines: [metrics/prod]

service:
  telemetry:
    logs:
      level: debug
  pipelines:
    metrics/in:
      receivers: [otlp]
      exporters: [routing/stage]
    metrics/prod:
      receivers: [routing/stage]
      exporters: [debug]

Expected Result

Expecting to see this in logs:

Metric #7
Descriptor:
      -> Name: app_user_logins_total
      -> Description: The number of users login into the Klarna app.
      -> Unit: 
      -> DataType: Sum
      -> IsMonotonic: true
      -> AggregationTemporality: Cumulative

Actual Result

Seeing this in logs:

Metric #7
Descriptor:
      -> Name: app_user_logins_total
      -> Description: The number of users login into the Klarna app.
      -> Unit: 
      -> DataType: Sum
      -> IsMonotonic: false
      -> AggregationTemporality: Unspecified

When forwarding this to a Datadog Exporter we get:

2025-01-16T10:39:36.757Z debug   [email protected]/metrics_translator.go:854       Unknown or unsupported aggregation temporality  {"kind": "exporter", "data_type": "metrics", "name": "datadog/exporter", "component": "metrics translator", "metric name": "app_user_logins_total", "aggregation temporality": "Unspecified"}

Collector version

0.117.0

Environment information

Environment

OS: macOS 14.7.2
Compiler(if manually compiled): N/A

OpenTelemetry Collector configuration

Log output

Additional context

No response

@benzaita benzaita added bug Something isn't working needs triage New item requiring triage labels Jan 16, 2025
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@benzaita
Copy link
Author

This seems to be because this code is not setting these values

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working connector/routing needs triage New item requiring triage
Projects
None yet
Development

No branches or pull requests

1 participant