Skip to content

Exclude Dimension Setting in Span Metrics Connector Does Not Apply to Non-Default Dimensions #34101

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

Closed
EOjeah opened this issue Jul 16, 2024 · 1 comment
Labels
bug Something isn't working needs triage New item requiring triage

Comments

@EOjeah
Copy link
Contributor

EOjeah commented Jul 16, 2024

Component(s)

connector/spanmetrics
No response

What happened?

Description

The spanmetricsconnector component in the OpenTelemetry Collector has a setting called exclude_dimensions that is intended to exclude specific dimensions from the metrics. This setting works correctly for the default dimensions, which are service.name, span.name, span.kind, and status.code. However, it does not work for dimensions that are added by process tags such as host.name by any processors before the spanmetricsconnector

Steps to Reproduce

Send sample zipkin span to the otel collector traces pipeline with the span metrics connector and prometheus output for metrics

[
    {
        "traceId": "30101010101",
        "id": "1",
        "kind": "SERVER",
        "name": "GET /api",
        "timestamp": 1697040000000000,
        "duration": 2000001,
        "localEndpoint": {
            "serviceName": "example"
        },
        "tags": {
            "http.route.name": "api.example.com",
            "host.name": "ec2-10.1.1.1.amazonaws.com"
        }
    }
]

Expected Result

host_name is not part of the metric dimension

calls_total{service_name="example", span_kind="SPAN_KIND_SERVER", status_code="STATUS_CODE_UNSET"}

Actual Result

host_name metric is included with the metric

calls_total{host_name="ec2-10.1.1.1.amazonaws.com", service_name="example", span_kind="SPAN_KIND_SERVER", status_code="STATUS_CODE_UNSET"}

Collector version

v0.103.0

Environment information

Environment

Ubuntu 22.04.4 LTS

OpenTelemetry Collector configuration

receivers:
  zipkin:

connectors:
  spanmetrics:
    exclude_dimensions: ['host.name']
    
exporters:
  prometheus:
service:
  pipelines:
    traces:
      receivers: [zipkin]
      exporters: [spanmetrics]
    metrics:
      receivers: [spanmetrics]
      exporters: [prometheus]

Log output

No response

Additional context

No response

@EOjeah EOjeah added bug Something isn't working needs triage New item requiring triage labels Jul 16, 2024
@EOjeah
Copy link
Contributor Author

EOjeah commented Jul 16, 2024

Just realised I didn't add the component, closing this for #34102

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

No branches or pull requests

1 participant