Skip to content
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

[processor/k8sattributes] support extracting labels and annotations from Deployments #38343

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

odubajDT
Copy link
Contributor

@odubajDT odubajDT commented Mar 4, 2025

Description

Add support for extraction of labels and annotations from Deployments. This change comes with elevated RBAC permissions - adding Deployment permissions to the ClusterRole

Link to tracking issue

Fixes #37957

@github-actions github-actions bot added the processor/k8sattributes k8s Attributes processor label Mar 4, 2025
@odubajDT odubajDT force-pushed the k8sattributes-processor-workload-informers branch 2 times, most recently from aff9e65 to cad5b00 Compare March 10, 2025 12:47
@odubajDT odubajDT changed the title [processor/k8sattributes] support extracting metadata from high-level workloads [processor/k8sattributes] support extracting labels and annotations from k8s Deployments Mar 11, 2025
@odubajDT odubajDT force-pushed the k8sattributes-processor-workload-informers branch 3 times, most recently from 7a3bd1f to f1745c9 Compare March 11, 2025 14:10
@odubajDT odubajDT changed the title [processor/k8sattributes] support extracting labels and annotations from k8s Deployments [processor/k8sattributes] support extracting labels and annotations from Deployments Mar 11, 2025
@odubajDT odubajDT marked this pull request as ready for review March 11, 2025 15:04
@odubajDT odubajDT requested a review from a team as a code owner March 11, 2025 15:04
newInformer InformerProvider,
newNamespaceInformer InformerProviderNamespace,
newReplicaSetInformer InformerProviderReplicaSet,
informersFactory InformersFactoryList,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small refactoring for potential future extensions

@@ -478,14 +547,10 @@ func (c *WatchClient) extractPodAttributes(pod *api_v1.Pod) map[string]string {
if c.Rules.StartTime {
ts := pod.GetCreationTimestamp()
if !ts.IsZero() {
if enableRFC3339Timestamp.IsEnabled() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the feature gate is already in stable phase, therefore there is no possibility to disable it, therefore this if-else statement is unneeded, as the else branch is unreachable

… workloads

Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
@odubajDT odubajDT force-pushed the k8sattributes-processor-workload-informers branch from e9e79c1 to 87e27be Compare March 12, 2025 11:17
odubajDT and others added 3 commits March 12, 2025 12:32
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
processor/k8sattributes k8s Attributes processor
Projects
None yet
2 participants