-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[Prometheus Receiver] Prometheus Receiver configuration for etcd, kube-scheduler and kube-controller in standard K8s cluster not working #34211
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
I skimmed the issue, so apologize if I missed this. The otel collector interprets $1 as the environment variable. You need to escape it with |
LMK if that was your issue, or if I misread |
Hi @dashpole. Thank you very much for the response; it worked after using 2 dollars($). You saved actually. So, whatever works in standard Prometheus needs tweaking for running in OTel Prometheus receiver? Is the deviation in OTel from the standard Prometheus scrape config something architecturally specific that end users need to know? Thank you. |
It exists because the promethues server config doesn't support environment variables, but the otel collector does. |
Hi @dashpole , I have forgot to ask one query, thank you I have the below kube-scheduler scrape config which is working fine
So, with this configuration, I am able to see only one instance scheduler metrics ( I have 3 control plane nodes, so that means I have 3 schedulers) Is this expected behaviour in multi control plane (multi-master) K8s clusters? other scrape configs(other 2 control plane schedulers) are failing, but one of them is successful Here is the sample log of 2 instances failing Failed to scrape Prometheus endpoint {"kind": "receiver", "name": "prometheus", "data_type": "metrics", "scrape_timestamp": 1722538620170, "target_labels": "{name="up", instance=".11:10259", job="kube-scheduler"}"} Failed to scrape Prometheus endpoint {"kind": "receiver", "name": "prometheus", "data_type": "metrics", "scrape_timestamp": 1722538620179, "target_labels": "{name="up", instance=".10:10259", job="kube-scheduler"}"} Thank you. |
I would expect 3 metrics. Try raising the logging verbosity to DEBUG to see the detailed scrape failure reason |
@dashpole 2024-10-23T12:45:56.402Z debug scrape/scrape.go:1331 Scrape failed {"kind": "receiver", "name": "prometheus/3", "data_type": "metrics", "scrape_pool": "kube-scheduler", "target": "https://100.xx.xx.xx:10259/metrics", "error": "Get "https://100.xx.xx.xx:10259/metrics\": dial tcp 100.xx.xx.xx:10259: connect: connection refused"} I am exporting to VictoriaMetrics with prometheusremotewrite exporter. I only see below metrics in the destination server and all are zero
Any suggestions? |
I see kube scheduler pod present in kube-system namespace on my cluster, do I have a create a service too for the same before trying to scrape metrics? |
Component(s)
receiver/prometheus
What happened?
Description
Please bear with me for descriptive error message, however actually it is short.
I am trying to scrape prometheus metrics for the etcd, kube-scheduler and kube-controller. However, it resulting in the error , i have tried multiple relabel configurations to get the end URL address coreect, however it is still not working
I execed into pod and used curl to scrape respective pod ip targets, all worked but with scraping config, it is not working.
Steps to Reproduce
Keep the following scrape config in under receiver section of receiver
Expected Result
We usually see the metrics wherver being exported
Actual Result
I have tried multiple ,so I have got multiple errors, I will post all of them here
Second
and third
Seems like it is not building the complete URL , which we can see below error , instance for all 3 components
Collector version
latest image of contrib. here: otel/opentelemetry-collector-contrib:latest
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 22")
it is mult-control plane K8s cluster
I have 3 control plane nodes
so, I have 3 etcd services, 3 kube-control-mangers and 3 kube-schedulers
OpenTelemetry Collector configuration
Log output
Additional context
it is mult-control plane K8s cluster
Thank you, I have tried to build target, seems like it is not if my scraping is not correct, please give correct scraping config for 3 K8s components
Here are my pods of all 3 comoponents ,
Thank you
The text was updated successfully, but these errors were encountered: