-
Notifications
You must be signed in to change notification settings - Fork 209
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
Resource Attributes - refactor and add missing attributes #2111
base: main
Are you sure you want to change the base?
Resource Attributes - refactor and add missing attributes #2111
Conversation
0b04c97
to
32bcd16
Compare
86428fa
to
c1f6c3d
Compare
7ab9e5d
to
511aad1
Compare
6183e8a
to
9396435
Compare
ResourceAttributes: utils.GetResourceAttributes(kd.pw, kd.pod.Name), | ||
InitialConfig: sdkConfig, | ||
ServiceName: OtelServiceName, | ||
ResourceAttributes: resourceattributes.AfterPodStart(&resourceattributes.ContainerIdentifier{ |
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 think this change will drop the deployment.name
attribute we used to have - now the processor will add them. Why not add more attributes here if we can get them, instead of relying on the processor?
"extract": config.GenericMap{ | ||
"metadata": []string{ | ||
"k8s.deployment.name", | ||
"k8s.statefulset.name", | ||
"k8s.daemonset.name", | ||
"k8s.cronjob.name", | ||
"k8s.job.name", | ||
"k8s.cluster.uid", | ||
"k8s.node.name", | ||
"container.id", | ||
"container.image.name", | ||
"container.image.tag", | ||
}, | ||
}, |
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.
Does this make the add cluster info
action obsolete?
semconv "go.opentelemetry.io/otel/semconv/v1.26.0" | ||
) | ||
|
||
type Attributes []attribute.KeyValue |
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 type definition introduces a breaking change to the factory
API for eBPF instrumentation.
It adds some better syntax, but I prefer to just use the Otel
type. We could still have the util functions here.
Upsert modificationFunc = func(origVal string, newVal string) string { | ||
return newVal | ||
} | ||
|
||
AppendWithSpace modificationFunc = func(origVal string, newVal string) string { | ||
return origVal + " " + newVal | ||
} | ||
|
||
AppendWithComma modificationFunc = func(origVal string, newVal string) string { | ||
return origVal + "," + newVal | ||
} |
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.
If those are just used for testing, better to move them to the _test
file
This PR do the following changes:
k8sattributeprocessor
inodigos-data-collection
to fill the rest of the needed kubernetes resource attributes