-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Open
Labels
component-stability-phase-1Part of the Phase 1 Component Stability Project.Part of the Phase 1 Component Stability Project.processor/k8sattributesk8s Attributes processork8s Attributes processor
Description
ref:
opentelemetry-collector-contrib/processor/k8sattributesprocessor/config.go
Lines 201 to 203 in 766b001
| // KeyRegex is a regular expression used to extract a Key that matches the regex. | |
| // Out of Key or KeyRegex, only one option is expected to be configured at a time. | |
| KeyRegex string `mapstructure:"key_regex"` |
In the docstring it is mentioned the following:
// When not specified, a default tag name will be used of the format:
// - k8s.pod.annotations.<annotation key> (or k8s.pod.annotation.<annotation key> when processor.k8sattributes.EmitV1K8sConventions is enabled)
// - k8s.pod.labels.<label key> (or k8s.pod.label.<label key> when processor.k8sattributes.EmitV1K8sConventions is enabled)
This means that the following works as expected:
labels:
- key: app
from: podand extracts the label as k8s.pod.labels.app: nginx
We should support the same for the key_regex option too:
labels:
- key_regex: (.*)
from: podThe above does not seem to work as expected: it should catch all labels and extract them using k8s.pod.labels.<label key> pattern)
Metadata
Metadata
Assignees
Labels
component-stability-phase-1Part of the Phase 1 Component Stability Project.Part of the Phase 1 Component Stability Project.processor/k8sattributesk8s Attributes processork8s Attributes processor
Type
Projects
Status
Workable