diff --git a/.chloggen/lock-attributes-gate.yaml b/.chloggen/lock-attributes-gate.yaml index ab105ad951a..f2b113767d6 100644 --- a/.chloggen/lock-attributes-gate.yaml +++ b/.chloggen/lock-attributes-gate.yaml @@ -7,18 +7,27 @@ change_type: breaking component: service # A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). -note: Set the `telemetry.newPipelineTelemetry` feature gate to stable. +note: Restrict the `telemetry.newPipelineTelemetry` feature gate to metrics. # One or more tracking issues or pull requests related to the change -issues: [12856] +issues: [12856, 12933] # (Optional) One or more lines of additional information to render under the primary note. # These lines will be padded with 2 spaces and then inserted directly into the document. # Use pipe (|) for multiline entries. subtext: | - The off state of this feature gate introduced a regression, where the Collector's internal logs were missing component attributes. See issue #12870 for more details on this bug. Since there does not appear to be much benefit to disabling the gate, we are immediately moving it to stable in order to lock in the correct behavior. + The "off" state of this feature gate introduced a regression, where the Collector's internal logs were missing component attributes. See issue #12870 for more details on this bug. - This comes with a breaking change, where internal logs exported through OTLP will now use instrumentation scope attributes to identify the source component instead of log attributes. This does not affect the Collector's stderr output. See the changelog for v0.123.0 for a more detailed description of the gate's effects. + On the other hand, the "on" state introduced an issue with the Collector's default internal metrics, because the Prometheus exporter does not currently support instrumentation scope attributes. + + To solve both of these issues, this change turns on the new scope attributes for logs and traces by default regardless of the feature gate. + However, the new scope attributes for metrics stay locked behind the feature gate, and will remain off by default until the Prometheus exporter is updated to support scope attributes. + + Please understand that enabling the `telemetry.newPipelineTelemetry` feature gate may break the export of Collector metrics through, depending on your configuration. + Having a `batch` processor in multiple pipelines is a known trigger for this. + + This comes with a breaking change, where internal logs exported through OTLP will now use instrumentation scope attributes to identify the source component instead of log attributes. + This does not affect the Collector's stderr output. See the changelog for v0.123.0 for a more detailed description of the gate's effects. # Optional: The change log or logs in which this entry should be included. # e.g. '[user]' or '[user, api]' diff --git a/internal/telemetry/telemetry.go b/internal/telemetry/telemetry.go index df6fb4a2565..5ebe2d55dde 100644 --- a/internal/telemetry/telemetry.go +++ b/internal/telemetry/telemetry.go @@ -16,10 +16,10 @@ import ( var NewPipelineTelemetryGate = featuregate.GlobalRegistry().MustRegister( "telemetry.newPipelineTelemetry", - featuregate.StageStable, + featuregate.StageAlpha, featuregate.WithRegisterFromVersion("v0.123.0"), - featuregate.WithRegisterToVersion("v0.127.0"), featuregate.WithRegisterReferenceURL("https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/rfcs/component-universal-telemetry.md"), + featuregate.WithRegisterDescription("Injects component-identifying scope attributes in internal Collector metrics"), ) // IMPORTANT: This struct is reexported as part of the public API of @@ -53,6 +53,8 @@ func WithAttributeSet(ts TelemetrySettings, attrs attribute.Set) TelemetrySettin ts.extraAttributes = attrs ts.Logger = componentattribute.ZapLoggerWithAttributes(ts.Logger, ts.extraAttributes) ts.TracerProvider = componentattribute.TracerProviderWithAttributes(ts.TracerProvider, ts.extraAttributes) - ts.MeterProvider = componentattribute.MeterProviderWithAttributes(ts.MeterProvider, ts.extraAttributes) + if NewPipelineTelemetryGate.IsEnabled() { + ts.MeterProvider = componentattribute.MeterProviderWithAttributes(ts.MeterProvider, ts.extraAttributes) + } return ts }