open-telemetry / opentelemetry-proto

OpenTelemetry protocol (OTLP) specification and Protobuf definitions
https://opentelemetry.io/docs/specs/otlp/
Apache License 2.0
545 stars 242 forks source link

profiles: Add comments about 1-indexing and 0 meaning unset #554

Open brancz opened 1 month ago

brancz commented 1 month ago

As discussed in the last otel profiling call.

@felixge @florianl @petethepig @tigrannajaryan @jack-berg @simonswine

(feel free to tag anyone else)

jhalliday commented 1 month ago

Good Idea! Possible enhancements:

For the strings table there is a comment at point of declaration 'string_table[0] must always be "".' and likewise for the mapping tables 'mapping[0] will be the main binary.' (which may be construed as inconsistent with '1-indexed')

It would be useful I think to add similar at point of declaration for the function table and link table, which are likewise cases where a referring field is optional at the spec level but not at the protocol encoding level, thus leaving '0' as a problematic value, then also add similar comments at point of use

tigrannajaryan commented 1 month ago

@open-telemetry/profiling-maintainers you can ping me when the PR is ready to be merged (all conversations must be first resolved).