Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upProblems with kubernetes example #1312
Comments
This comment has been minimized.
This comment has been minimized.
|
Sorry, looks like we've got examples out of sync with releases - in this case sensible defaults for relabel regexes to reduce verbosity of config. The syntax in the example requires master. You can use |
This comment has been minimized.
This comment has been minimized.
|
New default values were introduced in master. Please check the same file at The example should be in sync with the code, the latest Docker tag points On Tue, Jan 12, 2016, 6:26 PM Tiago César Katcipis notifications@github.com
|
This comment has been minimized.
This comment has been minimized.
|
Using the prometheus:master image made everything work fine, thanks @jimmidyson. Now im having other problem. Im trying to scrap information from my RabbitMQ instance, that is running inside k8s. I added the exporter on the same pod as the rabbit and exported the container port. rc file:
svc file:
Then I check the running service, the endpoint is there:
Using the default configuration, found on the docs, I got no data (and no warning or error on the logs). If I configure prometheus to manually scrap the endpoint 10.244.50.21:9090, it works, so it is not connectivity. I thought I could have missed the annotation, but when I tried to create it I got the error:
So my rabbitmq svc is already annotated. Here is my whole config ( is where the address of the master would be, im working with ip right now, not DNS):
Any idea of what I may be doing wrong ? |
This comment has been minimized.
This comment has been minimized.
|
Does the pod show up as a target in the Prometheus status page? You may need to annotate the service with the port number to use like: |
This comment has been minimized.
This comment has been minimized.
|
@jimmidyson I was pretty stupid, taking a look on the status page made the problem quite clear. It is trying to scrap rabbitmq on the 5672 port, which is the first exported port. I thought the default port was 9090, but it seems to be the first exported one (on k8s, if you dont mention the port name it is an ambiguity, since there is multiple ports exported on the service). |
This comment has been minimized.
This comment has been minimized.
|
Ah OK! So the |
This comment has been minimized.
This comment has been minimized.
|
It worked, but by default it tried to scrap on "/" instead of "/metrics". Shouldn't "/metrics" be the default ? |
This comment has been minimized.
This comment has been minimized.
|
It worked, thanks @jimmidyson :-) (after I manually defined the path to be "/metrics"). I can add an example on the pod + service description to make RabbitMQ work on this setup. If it seems to be a good idea, where is the best place for me to add it on the project ? |
This comment has been minimized.
This comment has been minimized.
|
It certainly should default to Prometheus doesn't really have external example setup so not sure where best to put it. @fabxc @brian-brazil Any thoughts? Seems useful to me, using RabbitMQ as an example to show the configuration of the Kubernetes services required for discovery. |
This comment has been minimized.
This comment has been minimized.
|
@jimmidyson Maybe in a |
This comment has been minimized.
This comment has been minimized.
|
@sdurrheimer Nice idea. @katcipis PR welcome I'm sure. |
This comment has been minimized.
This comment has been minimized.
|
@katcipis The problem with the scrape path was just a small change to example relabeling - https://github.com/prometheus/prometheus/pull/1313/files |
This comment has been minimized.
This comment has been minimized.
|
@jimmidyson just tested here, worked like a charm ;-). I noticed that when I omit the relabeling prometheus tries to scrap everything from k8s (all pods, assuming the default DNS name of them). Is this expected ? |
katcipis
referenced this issue
Jan 12, 2016
Merged
Adding RabbitMQ deploy for kubernetes + prometheus integration #1314
brian-brazil
added
the
question
label
Jan 15, 2016
This comment has been minimized.
This comment has been minimized.
|
To quote @jimmidyson : "You can do this via relabelling. See https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus-kubernetes.yml#L53-L56 for an example. What this is doing is only Does that help? I assume this issue is solved. Please re-open with more information if not. |
beorn7
closed this
Feb 2, 2016
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 24, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
katcipis commentedJan 12, 2016
Im having some trouble following the kubernetes example, more specifically on the relabel part:
https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus-kubernetes.yml#L25-L33
Any of these relabel rules results on the following error on startup:
Im using the latest prometheus image at docker hub. Am I doing something wrong ?