Skip to content

Use GetMappingIndex() to access the mapping index of OTLP locations #4285

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

Merged
merged 1 commit into from
Jul 5, 2025

Conversation

fandreuz
Copy link
Contributor

@fandreuz fandreuz commented Jul 5, 2025

I got some mapping index is required errors while exporting valid profiles to Pyroscope. For those profiles I don't have mapping information, thus I'm setting location.mapping_index = 0 for each location. This is a fully described behavior in the spec, as mapping_table[0] must always be some sort of null mapping.

Since location.mapping_index was marked optional, it becomes a *int32 rather than an int32 in opentelemetry-proto-go. This is not the case anymore after open-telemetry/opentelemetry-proto#659, so this change is going to be required for Pyroscope after the next release of opentelemetry-proto.

The problem I experienced comes from the fact that Protobuf does not serialize fields set to their default value, thus all my locations have location.mapping_index == nil. I'm proposing to introduce this change now because it's not a big one, and I feel like Pyroscope rejects valid profiles in its present shape.

@korniltsev korniltsev merged commit 4a2d0a8 into grafana:main Jul 5, 2025
24 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