-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
kubeletstats lack labels #29880
Comments
Pinging code owners for receiver/kubeletstats: @dmitryax @TylerHelmuth. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Hello @bon77, the From the data you've included:
From my searching it looks like you want Can you share which exporter you plan to use to get data into your backend? Depending on your configuration you can either use the transform processor, or in some cases the exporter itself will have options available. |
Hi @crobert-1 , thanks for your response. I am using the HTTP exporter to connect to mimir. I do not see anything I could set there. Here the configuration (diff to previous cfg) I use: diff --git a/collector-values.yaml b/collector-values.yaml
index 29f75b0..e558c8d 100644
--- a/collector-values.yaml
+++ b/collector-values.yaml
@@ -92,6 +92,10 @@ config:
verbosity: normal
debug/detailed:
verbosity: detailed
+ otlphttp/mimir:
+ endpoint: http://mimir-distributor.mimir:8080/otlp
+ headers:
+ X-Scope-OrgID: BANANA
extensions:
# The health_check extension is mandatory for this chart.
# Without the health_check extension the collector will fail the readiness and liveliness probes.
@@ -152,6 +156,7 @@ config:
metrics:
exporters:
- debug/detailed
+ - otlphttp/mimir
processors:
- memory_limiter
- batch Thanks for pointing out the transform processor. That might work, but I can't seem to get the syntax right.
My test attribute gets set, but I cannot figure out how to address the Resource attribute I also tried using attributes processor, but I only get my 2 static test labels added.
Some additional information about my lab setup:
I also run a default Grafana instance in this lab for easier access:
|
I think I found a work-around for my problem. work-around in processors: processors:
batch: {}
# If set to null, will be overridden with values based on k8s resource limits
memory_limiter: null
k8sattributes: null
attributes/add_bon_labels:
actions:
- key: k8s_node_name
value: ${K8S_NODE_NAME}
action: upsert This depends on the extraEnvs:
- name: K8S_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName If anybody has a nicer solution, please share. |
You'd access the node name like this for the transform processor using the datapoint context:
|
@bon77 It looks like this is working now, so I'm going to close this issue. Please let us know if I missed anything, or if you have any more questions! |
Yes, that works for me. Thank you very much @crobert-1 ! |
Describe the bug
I collect the
kubeletstats
following the documentation.I can see them in the logs and find them in Grafana (explore), but they do not have any labels attached to them.
For the node related metrics, I would expect to have the label
node_name
attached.Steps to reproduce
Install the collector helm chart with the values below:
(I use kind, but I don't think that is of relevance)
What did you expect to see?
I expect to see a label containing the k8s.node.name, so that I can match the metrics in dash-boards etc.
What did you see instead?
What version did you use?
v0.91.0
Helm chart version: opentelemetry-collector-0.77.0
What config did you use?
Config: (e.g. the yaml config file)
collector-values.yaml
:Environment
OS: " Ubuntu 22.04.3 LTS"
ARCH: "x86_64"
Helm: "version.BuildInfo{Version:"v3.13.2", GitCommit:"2a2fb3b98829f1e0be6fb18af2f6599e0f4e8243", GitTreeState:"clean", GoVersion:"go1.20.10"}"
Additional context
What I want to achieve is:
Send these metrics to Mimir and use Grafana to display them.
For that to work, I need to get some relation between the node and the metrics.
The text was updated successfully, but these errors were encountered: