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

[chore] Fix checkValueForProducer test helper for queue metrics #8288

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

dmitryax
Copy link
Member

@dmitryax dmitryax commented Aug 28, 2023

checkValueForProducer test helper assumes that every OC metric has only one timeseries. But, since the queue metrics are defined globally, they accumulate more timeseries with different labels from different tests. This change removes that assumption. It allows having more tests for the exporter queue without breaking TestQueuedRetry_QueueMetricsReported.

Ideally, we should avoid defining instruments globally or clear them up after each test. The first option would require passing the OpenCensus registry in as a public field of TelemetrySettings from the service start. The second option would require a bigger refactoring.

I think we can allow several tests emitting datapoints for the global instruments for now until we migrate to OTel metrics.

Fixes tests failing in #8250

This check assumes that every OC metric has only one datapoint. But, since the queue metrics are defined globally, they are accumulate more datapoints with different labels from different tests. This change removes that assumption. It allows having more tests for the exporter queue without breaking TestQueuedRetry_QueueMetricsReported.

Ideally, we should avoid defining instruments globally or clear them up after each test. The first option would require passing the OpenCensus registry in as a public field of TelemetrySettings from the service start. The second option would require a bigger refactoring. 

I think we can allow several tests emitting datapoints for the global instruments for now until we migrate to OTel metrics.
@dmitryax dmitryax requested a review from a team as a code owner August 28, 2023 04:44
@codecov
Copy link

codecov bot commented Aug 28, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (92f5fe6) 90.18% compared to head (3aece13) 90.18%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8288   +/-   ##
=======================================
  Coverage   90.18%   90.18%           
=======================================
  Files         302      302           
  Lines       15859    15859           
=======================================
  Hits        14303    14303           
  Misses       1261     1261           
  Partials      295      295           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dmitryax dmitryax merged commit 0a63747 into open-telemetry:main Aug 28, 2023
31 checks passed
@github-actions github-actions bot added this to the next release milestone Aug 28, 2023
@dmitryax dmitryax deleted the fix-checkValueForProducer branch August 28, 2023 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants