internal/proto/metrics/README.md
Defines the MetricsQueryService's set of APIs along with required data models.
Contained in this directory are a set of shared Protobuf data model definitions from https://github.com/OpenObservability/OpenMetrics, namely:
The reasons for adopting OpenMetrics' data model over OpenTelemetry's are:
Importing data models directly from the OpenObservability/OpenMetrics github repo (via a submodule) was considered and explored; however, without custom marshaling enabled, which is required for sending imported message types over the wire, errors such as the following result:
`panic: invalid Go type v1.Metric for field jaeger.api_v2.GetMetricsResponse.Metrics`
Enabling gogoproto's custom Marshal and Unmarshal methods to address the above issue result in compilation errors from the generated code as the referenced protobuf definition does not have gogoproto.marshaler_all, gogoproto.unmarshaler_all, etc. enabled.
Moreover, if direct imports of other repositories were possible, it would mean importing and generating code for transitive dependencies not required by Jaeger leading to longer build times, and potentially larger container image sizes.
Given the aforementioned limitations, selectively copying necessary messages and enums allow for:
The key trade-offs are:
It is anticipated that the maintenance effort to synchronize data models will be minimal considering
there is no direct dependency between Jaeger and OpenTelemetry in the context of querying metrics,
with exception to SpanKind, and the existing data model more than satisfies existing metrics querying requirements.
The OpenTelemetry metrics data model primarily serves as a carrier of metrics data, rather than a protocol of communication between Jaeger and OpenTelemetry components.