Use GetMappingIndex()
to access the mapping index of OTLP locations
#4285
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 settinglocation.mapping_index = 0
for each location. This is a fully described behavior in the spec, asmapping_table[0]
must always be some sort of null mapping.Since
location.mapping_index
was markedoptional
, it becomes a*int32
rather than anint32
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.