You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With an OpenTelemetryCollector in sidecar mode, the sidecar.opentelemetry.io/injected label gets added to the pod using the format [otc_namespace].[otc_name]
Under the right conditions, the label value can exceed 63 characters, which causes Kubernetes controllers to produce the following error:
Error creating: Pod "[name]-59ff54b4c6-9mh4g" is invalid: metadata.labels: Invalid value: "[otc_namespace].[otc_name]": must be no more than 63 characters
(Replace brackets with sufficiently long values.)
If the name of the OpenTelemetryCollector does not identify it as such, this error message is particularly cryptic as it is not obvious what is producing the invalid label. (Took me a while to dig through various controllers and mutating webhooks to find the culprit. Though arguably this is more an issue with how Kubernetes reports such errors.)
Possible solutions:
Move sidecar.opentelemetry.io/injected to annotations
Annotations do not have the same restrictions on values as labels
Allow user to disable addition of sidecar.opentelemetry.io/injected label
Presumably this would be an option in the OpenTelemetryCollector resource
Split the [otc_namespace] and [otc_name] across multiple labels
This is how I've seen other projects handle such cases. Since Kubernetes object names and label values have the same restrictions, you can safely put the [otc_namespace] in one label and the [otc_name] in another, guaranteeing that they will never exceed the character limit.
Would be happy to open a PR with your preferred solution. Thanks 🙂
The text was updated successfully, but these errors were encountered:
KevinSnyderCodes
changed the title
Label "sidecar.opentelemetry.io/injected" value longer than 63 characters
Label "sidecar.opentelemetry.io/injected" value longer than 63 characters in some cases
Aug 11, 2022
KevinSnyderCodes
changed the title
Label "sidecar.opentelemetry.io/injected" value longer than 63 characters in some cases
Label "sidecar.opentelemetry.io/injected" value sometimes longer than 63 characters
Aug 11, 2022
With an
OpenTelemetryCollector
insidecar
mode, thesidecar.opentelemetry.io/injected
label gets added to the pod using the format[otc_namespace].[otc_name]
opentelemetry-operator/pkg/sidecar/pod.go
Line 48 in 07b9f22
Under the right conditions, the label value can exceed 63 characters, which causes Kubernetes controllers to produce the following error:
(Replace brackets with sufficiently long values.)
If the name of the
OpenTelemetryCollector
does not identify it as such, this error message is particularly cryptic as it is not obvious what is producing the invalid label. (Took me a while to dig through various controllers and mutating webhooks to find the culprit. Though arguably this is more an issue with how Kubernetes reports such errors.)Possible solutions:
sidecar.opentelemetry.io/injected
to annotationssidecar.opentelemetry.io/injected
labelOpenTelemetryCollector
resource[otc_namespace]
and[otc_name]
across multiple labels[otc_namespace]
in one label and the[otc_name]
in another, guaranteeing that they will never exceed the character limit.Would be happy to open a PR with your preferred solution. Thanks 🙂
The text was updated successfully, but these errors were encountered: