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

fix: do not emit metrics if empty #228

Merged

Conversation

francinelucca
Copy link
Contributor

@francinelucca francinelucca commented Apr 11, 2024

Closes #185

Checks ResourceMetrics object before emitting metrics and returns early (i.e., does not emit) if all scopes' metrics are empty.

Changelog

New

  • Unit tests for emitMetrics to test new edge cases

Changed

  • IbmTelemetry:emitMetrics: do not emit any data if there isn't at least 1 metric.
  • Made IbmTelemetry's emitMetrics function public (so that we can test it)

Testing / reviewing

Unit tests should pass

Copy link

sonarcloud bot commented Apr 11, 2024

@francinelucca francinelucca merged commit d578cb9 into main Apr 11, 2024
6 checks passed
@francinelucca francinelucca deleted the 185-do-not-transmit-any-data-if-no-metrics-are-collected branch April 11, 2024 18:31
@telemmy telemmy bot mentioned this pull request Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not transmit any data if no metrics are collected
2 participants