Skip to content

Use Jackson for telemetry files#15319

Merged
trask merged 4 commits intoopen-telemetry:mainfrom
jaydeluca:fix-kafka-parsing
Nov 17, 2025
Merged

Use Jackson for telemetry files#15319
trask merged 4 commits intoopen-telemetry:mainfrom
jaydeluca:fix-kafka-parsing

Conversation

@jaydeluca
Copy link
Copy Markdown
Member

Fixes some parsing issues related to some of the kafka metric descriptions, which needed to be escaped. Rewrote the class that writes the .telemetry files to use jackson.

This was the error being fixed:

at [Source: (StringReader); line: 120, column: 61] (through reference chain: io.opentelemetry.instrumentation.docs.internal.EmittedMetrics["metrics_by_scope"]->java.util.ArrayList[0]->io.opentelemetry.instrumentation.docs.internal.EmittedMetrics$MetricsByScope["metrics"]->java.util.ArrayList[14])
Nov 16, 2025 2:24:50 AM io.opentelemetry.instrumentation.docs.parsers.EmittedMetricsParser lambda$parseAllMetricFiles$1
SEVERE: Error parsing metrics file (/home/runner/work/opentelemetry-java-instrumentation/opentelemetry-java-instrumentation/instrumentation/kafka/kafka-clients/kafka-clients-0.11/.telemetry/metrics-6309e954-0e9b-46e3-a896-04d2754a39a4.yaml): mapping values are not allowed here
in 'reader', line 120, column 61:
... rage lead of the partition. Note: For topic names with periods ( ...
^

@jaydeluca jaydeluca requested a review from a team as a code owner November 16, 2025 12:48
// We want to ignore test related attributes
private static final List<String> EXCLUDED_ATTRIBUTES =
List.of(
"asdf",
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread docs/instrumentation-list.yaml Outdated
Comment on lines +6903 to +6909
- name: kafka.consumer.assigned_partitions
description: The number of partitions currently assigned to this consumer
type: DOUBLE_GAUGE
unit: ''
attributes:
- name: client-id
type: STRING
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we should document telemetry that comes from metric bridges like kafka and micrometer?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it is useful to have this information, but I agree that maybe it doesn't fit in this current form. I have created #15333 to dig into this further.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR to remove these metrics: #15342

I removed any changes to the instrumentation-list.yaml from this PR, so now it just focuses on improving the parsing

@trask trask enabled auto-merge (squash) November 17, 2025 19:30
@trask trask merged commit 56b3b94 into open-telemetry:main Nov 17, 2025
89 checks passed
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.

2 participants