Limit prometheus exemplar labels#6791
Limit prometheus exemplar labels#6791harshitrjpt wants to merge 5 commits intoopen-telemetry:mainfrom
Conversation
Codecov ReportAttention: Patch coverage is
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 ☔ View full report in Codecov by Sentry. |
.../prometheus/src/main/java/io/opentelemetry/exporter/prometheus/Otel2PrometheusConverter.java
Outdated
Show resolved
Hide resolved
.../prometheus/src/main/java/io/opentelemetry/exporter/prometheus/Otel2PrometheusConverter.java
Outdated
Show resolved
Hide resolved
.../prometheus/src/main/java/io/opentelemetry/exporter/prometheus/Otel2PrometheusConverter.java
Outdated
Show resolved
Hide resolved
|
Any clue why in 'markdown-link-check' job following links are failing: How can we fix this? |
Seems to be fixed now. |
| Level.WARNING, | ||
| "exemplar labels have " | ||
| + codePoints | ||
| + " codePoints, exceeding the limit of " |
There was a problem hiding this comment.
i'd replace codePoints with unicode code points to make it easier to understand what this warning means
There was a problem hiding this comment.
@laurit addressed.
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
.../prometheus/src/main/java/io/opentelemetry/exporter/prometheus/Otel2PrometheusConverter.java
Outdated
Show resolved
Hide resolved
| private static final String OTEL_SCOPE_VERSION = "otel_scope_version"; | ||
| private static final long NANOS_PER_MILLISECOND = TimeUnit.MILLISECONDS.toNanos(1); | ||
| static final int MAX_CACHE_SIZE = 10; | ||
| static final int EXEMPLAR_MAX_CODE_POINTS = 128; |
There was a problem hiding this comment.
Is this based on the specification somewhere?
| null, // scope attributes are only needed for point's attributes | ||
| exemplar.getFilteredAttributes()), | ||
| exemplar.getEpochNanos() / NANOS_PER_MILLISECOND); | ||
| labels = convertAttributes(null, null, exemplar.getFilteredAttributes()); |
There was a problem hiding this comment.
Can you add a test that covers this (codecov claims it's not tested, and it seems like it would be good to have it covered)
Changes done:
a) exemplar labels below max rune
b) exemplar labels above max rune