Skip to content

[connector/signaltometrics] Duplicate metric names with different histogram types leads to inconsistent results #39442

Closed
@lahsivjar

Description

@lahsivjar

Component(s)

connector/signaltometrics

What happened?

Description

Component configuration allows declaring two metrics with same name and description but different histograms types. In such situation, the component only accounts for explicit bounds histogram (because it is handled first) and counts all the metrics twice.

Steps to Reproduce

Define a config like below:

signaltometrics:
  spans:
    - name: duplicate
      description: Duplicate metric
      unit: ms
      histogram:
        count: "Int(AdjustedCount())"
        value: Milliseconds(end_time - start_time)
    - name: duplicate
      description: Duplicate metric
      unit: ms
      exponential_histogram:
        count: "Int(AdjustedCount())"
        value: Milliseconds(end_time - start_time)

Expected Result

Spans should be counted once and two metrics (exponential histogram and histogram) should be created.

Actual Result

Histogram metric is created and span is counted twice.

Collector version

v0.121.0 (all versions with signal to metrics component)

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

Log output

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingconnector/signaltometricsnever staleIssues marked with this label will be never staled and automatically removedpriority:p1High

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions