opentelemetry-java icon indicating copy to clipboard operation
opentelemetry-java copied to clipboard

Limit prometheus exemplar labels

Open harshitrjpt opened this issue 1 year ago • 3 comments

Changes done:

  1. create exemplar's labels object before creating the exemplar object. (deduplicated some code there)
  2. calculate labels length or runes.
  3. compare label runes with the hardcoded max rune. If limit reached, then return null exemplar obj.
  4. Added tests with sample LongSum metric data consisting exemplar for scenarios a) exemplar labels below max rune b) exemplar labels above max rune
> Task :exporters:prometheus:test

Otel2PrometheusConverterTest > exemplarLabelsAboveLimit() STANDARD_ERROR
    [Test worker] WARN io.opentelemetry.exporter.prometheus.Otel2PrometheusConverter - exemplar labels have 193 unicode code points, exceeding the limit of 128

harshitrjpt avatar Oct 15 '24 07:10 harshitrjpt

Codecov Report

Attention: Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 90.39%. Comparing base (537f5c4) to head (55a1bac). Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
.../exporter/prometheus/Otel2PrometheusConverter.java 93.33% 1 Missing :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6791      +/-   ##
============================================
+ Coverage     90.11%   90.39%   +0.27%     
- Complexity     6545     6580      +35     
============================================
  Files           728      731       +3     
  Lines         19702    19723      +21     
  Branches       1935     1928       -7     
============================================
+ Hits          17755    17829      +74     
+ Misses         1347     1297      -50     
+ Partials        600      597       -3     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Oct 15 '24 08:10 codecov[bot]

Any clue why in 'markdown-link-check' job following links are failing:

  [✖] https://maven-badges.herokuapp.com/maven-central/io.opentelemetry/opentelemetry-api → Status: 503
  [✖] https://maven-badges.herokuapp.com/maven-central/io.opentelemetry/opentelemetry-api/badge.svg → Status: 503

How can we fix this?

harshitrjpt avatar Oct 15 '24 12:10 harshitrjpt

Any clue why in 'markdown-link-check' job following links are failing:

  [✖] https://maven-badges.herokuapp.com/maven-central/io.opentelemetry/opentelemetry-api → Status: 503
  [✖] https://maven-badges.herokuapp.com/maven-central/io.opentelemetry/opentelemetry-api/badge.svg → Status: 503

How can we fix this?

Seems to be fixed now.

laurit avatar Oct 17 '24 08:10 laurit