-
Notifications
You must be signed in to change notification settings - Fork 151
adding additional labels for an EXTERNAL probe #255
Comments
Sorry for the lack of documentation on special data types -- map and distributions. What you're trying to use here is the 'map' data type. Your printf statement and what you wrote afterwards don't match, but if your string looks like the following it should work: An example map string from the tests: cloudprober/metrics/map_test.go Line 84 in 361f0d9
Can you confirm that's how your output looks like? I tested the same at my end and it worked fine. I ran this script through the external prober: echo "service_resource_health map:service,database:1,elasticsearch:1" and it generated following metrics for prometheus: |
CFG looks like:
|
for some reason it just skips over the former external cloudprober output. The golang code (sorry for the earlier pasting, i took out the
Which then is simply returned via fmt.Println of the returned string |
@jbkc85 Can you also share which cloudprober version are you using? Support for parsing maps was added to external probe in May 2019.. and is available only in the version from the head (or docker latest label). |
|
that may explain it. I was seeing it done with the I dont suppose this will be in a 'release' anytime soon will it? 😬 |
Argh, sorry :( It will be. I'll cut a new release some time this week. Just waiting for last few changes to go in. |
@manugarg thats awesome! I just built off of master and verified its working. I will be happy to submit some documentation too. We are basically transitioning all of our Nagios 'health' checks (which read JSON) to a interface-enabled golang external probe triggered via CloudProber. We also have consul-template feeding our cloudprober config, so though the cfg itself is super messy right now, it will automatically generate upon new deployments (we dont have K8s or Docker yet and still check server by server). Anyway, will be happy to contribute whenever/wherever we can! |
@jbkc85 That's excellent. If you can write a Github gist or share in the form of a Github issue (especially here: #123) how you're using cloudprober that will be great. If it works for you, you can also update the documentation directly at https://github.com/google/cloudprober/tree/master/docs/content. Also, just a heads up, I'll most likely cut a new release (v0.10.3) on Tuesday (2019-07-16) now. |
Just circling back here. v0.10.3 has been released in case you want to use the named version. |
Hi @manugarg,
I'm trying to use more that one label but it gives me an error. Can you tell me if this is possible? If I printed this:
it will work fine. And label service=database will be added. But what if I want to add another label called env=prod? I was trying something like
Thanks |
@MohamedMSaeed No, I'm afraid, that won't work. Our map type supports only 1 key. As a workaround, you can consider splitting your probe into two:
Additional label example: |
Thank you for your fast reply. Can I use dynamic labels in config file and values comes from the go code that I run? If so it will solve my issue. |
I am attempting to run an EXTERNAL probe that provides additional label values (based on the validation and HTTP examples). Here is what I came up with:
Yet, cloudprober does not want to read this and quickly removes it from the parsed metric values. Am I doing something wrong here? Is adding additional labels on runtime of an EXTERNAL probe not allowed?
The text was updated successfully, but these errors were encountered: