-
Notifications
You must be signed in to change notification settings - Fork 259
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
Add gauge subtype for prometheus unknown type #496
Conversation
Should we split the discussion between "Unknown", "Info" and "StatefulSet" metrics? I'd be more comfortable if we evaluated each change to the protocol individually. E.g. I'm not convinced of the encoding of Info/StatefulSet but I do think encoding |
@dashpole this also requires an "interoperability" explanation: how the new senders and old receivers should work such that nothing is broken. |
@dashpole one more thing that needs to be explored is what are the metric processors in the Collector supposed to do with the payloads that have these new fields set? If the processor is unaware of the new fields is existing processing logic still valid? When the Collector is updated to the new version of OTLP the fields will become available in the Collector and will be correctly passed through. However if a processor that knows nothing about these fields transforms a metric can it be a problem? |
If a new sender sends the new field, but the receiver does not know about it, ignoring it at the receiver is safe. This preserves the existing behavior today without the field. If an old sender sends data without the new field to a new receiver, using the default value of NONE subtypes is safe. It preserves existing behavior today without the field.
Processors themselves shouldn't need to do anything with this field, other than preserve it. Pdata's Gauge.CopyTo(), and Sum.CopyTo() would need to copy this field. Otherwise, I don't think any changes are required, and all existing processing logic should still be valid.
It won't be a problem. One of the primary reasons why this subtype proposal is preferable to additional attributes is that it is entirely "opt-in" for existing users of OTLP, since the subtype is always safe to ignore unless you explicitly care about it. |
@jsuereth I updated the wording for info and stateset based on open-telemetry/opentelemetry-specification#3058 (comment) in the latest commit. LMK what you think. If you still have concerns, I can cut |
This now only contains the gauge subtype for unknown. Given uncertainties around the future of OpenMetrics, it probably isn't the best idea to add those types right now. This should resolve @jsuereth's concerns as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM.
However, as @tigrannajaryan comments on how older clients and new clients interact, can you add the details from your PR comment into the protocol as comments for interaction?
i.e. I think it's totally fine to require NEWER generated OTLP producers + receivers to understand these new types. Effectively until you upgrade BOTH a producer of OTLP and a consumer of OTLP it will continue to treat these types the way they were previously.
That should be documented in the protocol itself for consumers, instead of just the PR comment.
Done. Added: // When receiving from older producers of OTLP, it is safe to assume the
// zero-value for sub_type, GAUGE_SUBTYPE_NONE. When sending OTLP to older
// consumers, it is safe for them to ignore the field. In both cases, the
// previous behavior without sub_type is maintained until producer and
// consumer are aware of the field. |
enum GaugeSubType { | ||
// GAUGE_SUBTYPE_NONE is the default GaugeSubType, which represents a gauge | ||
// that does not have a sub_type. | ||
GAUGE_SUBTYPE_NONE = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tigrannajaryan just want to confirm that this doesn't collide with any of the work you recently did to normalize enum values. For other enums in OTLP, we have the following patterns:
{ENUM_NAME}_UNSPECIFIED
{ENUM_NAME}_UNSET
{ENUM_NAME}_DO_NOT_USE
I think its fine but wanted to double check since we're stable now.
// which the type is not known, such as a Prometheus metric without a TYPE | ||
// comment. For example, the metric may be a monotonically-increasing counter, | ||
// or histogram, but type information was not included at the source. | ||
GAUGE_SUBTYPE_UNKNOWN = 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What other values do we anticipate adding to this enum?
Do we anticipate expanding this concept to other point types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See open-telemetry/opentelemetry-specification#3058 (comment) for my analysis of other protocols with types that aren't fully represented in OTel. For example, it might make sense (with proper justification) to add collectd's absolute
type, although i'm not aware of anyone that has asked for it, and it seems to itself be a "legacy" type it inherited from a tool.
I think the concept could be expanded to sums as well, but needs its own justification. See the linked comment for types that would potentially make sense as sum subtypes.
FWIW, I prefer the string approach proposed in this comment. I think the chances of collision are small, and I value the flexibility provided by string (i.e. no need to have lengthly discussions for each new proposal) more than I fear the collision potential of strings. |
@jack-berg I'm happy to make that change if there is consensus. I'll raise it tomorrow at the spec SIG meeting to see if there is consensus on the approach. |
I understand that OTel will go ahead with adding these types. Keeping in mind the potential addition of a couple more metric types that can/should not be produced by the SDKs (open-telemetry/opentelemetry-specification#3058 (comment)), has the usage of a separate metric type instead of using a subtype been discussed somewhere? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I read through all the feedback. I agree that just adding an unknown flag here is "just enough" and any other subtypes (including sum subtypes) could be debated later.
closing in favor of #514 |
Part of open-telemetry/opentelemetry-specification#3058
This an attempt at defining a "subtype" for OTel metric types, as suggested at the 2/7 Spec SIG meeting.
This is the Proposed solution described in the proposal here: open-telemetry/opentelemetry-specification#3058 (comment).