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

[processor/batch] processor ID missing from the metadata_cardinality metric #9674

Closed
alanhe opened this issue Mar 4, 2024 · 3 comments · Fixed by #10245
Closed

[processor/batch] processor ID missing from the metadata_cardinality metric #9674

alanhe opened this issue Mar 4, 2024 · 3 comments · Fixed by #10245
Labels
bug Something isn't working

Comments

@alanhe
Copy link

alanhe commented Mar 4, 2024

Describe the bug

When having more than one batchers, for example:

processors:
  batch/1:
    send_batch_max_size: 10000
    timeout: 10s
    metadata_keys: ["label1"]
    metadata_cardinality_limit: 0
  batch/2:
    send_batch_max_size: 10000
    timeout: 10s
    metadata_keys: ["label2"]
    metadata_cardinality_limit: 0

The metric is like:

otelcol_processor_batch_metadata_cardinality{service_instance_id="3bb678ea-b864-48a3-bc7f-ca8d5e0f9915",service_name="XXX",service_version="dev"} 1

It's not clear which value it is.

What did you expect to see?

I want to have the processor label in the metric, and display them in two lines:

# HELP otelcol_processor_batch_metadata_cardinality Number of distinct metadata value combinations being processed
# TYPE otelcol_processor_batch_metadata_cardinality gauge
otelcol_processor_batch_metadata_cardinality{service_instance_id="3bb678ea-b864-48a3-bc7f-ca8d5e0f9915",service_name="XXX",service_version="dev", processor="batch/1"} 1
otelcol_processor_batch_metadata_cardinality{service_instance_id="3bb678ea-b864-48a3-bc7f-ca8d5e0f9915",service_name="XXX",service_version="dev", processor="batch/2"} 1

From the code, https://github.com/open-telemetry/opentelemetry-collector/blob/main/processor/batchprocessor/metrics.go#L97
It can take the value from either processor.

What version did you use?
v0.95.0

@alanhe alanhe added the bug Something isn't working label Mar 4, 2024
@alanhe
Copy link
Author

alanhe commented May 11, 2024

It happens in v0.99.0 still.

@codeboten
Copy link
Contributor

Came across this bug as I was making the change #10233. The measurement for this metric doesn't add the attributes that other metrics do

codeboten added a commit to codeboten/opentelemetry-collector that referenced this issue May 28, 2024
Fixing this bug required a change in mdatagen to ensure attributes could be passed in to the telemetry builder.

Fixes open-telemetry#9674

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
@codeboten
Copy link
Contributor

Submitted a fix for this in #10245

codeboten added a commit to codeboten/opentelemetry-collector that referenced this issue May 28, 2024
Fixing this bug required a change in mdatagen to ensure attributes could be passed in to the telemetry builder.

Fixes open-telemetry#9674

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
codeboten added a commit that referenced this issue May 29, 2024
Fixing this bug required a change in mdatagen to ensure attributes could
be passed in to the telemetry builder.
    
Fixes #9674

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
steves-canva pushed a commit to Canva/opentelemetry-collector that referenced this issue Jun 14, 2024
…elemetry#10245)

Fixing this bug required a change in mdatagen to ensure attributes could
be passed in to the telemetry builder.
    
Fixes open-telemetry#9674

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants