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 upFederate endpoint returns empty response for query #1811
Comments
This comment has been minimized.
This comment has been minimized.
|
I'm using hierarchical federation and want to scrape values the from the "child" prometheus instances. Therefore i'm using the external label in the match query (i followed the blog post here: http://www.robustperception.io/scaling-and-federating-prometheus/). Any idea why i get no results? |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Hi, Thx for the response. I just tried But there are definetely values having label example
|
This comment has been minimized.
This comment has been minimized.
|
My bad, at least one matcher must not match the empty string, so it should be Your second one satisfies the requirement by having the plain |
This comment has been minimized.
This comment has been minimized.
|
Thx a lot @fabxc, but URI More examples (see available examples metrics above): Returns empty result
Returns a result
Is there any way to get more information (logs) why queries against external label (@fabxc btw, i could also give you access to my playground env so you can try out yourself) |
This comment has been minimized.
This comment has been minimized.
|
And again my bad. At least the Testing with curl can avoid any ambiguities: Similarly, as Prometheus treats a non-existent label the same as an empty label so this should equally work: |
This comment has been minimized.
This comment has been minimized.
|
Hi, Many thx for your effort! Using external labels doesn't seem to work for me: $ curl -v -u xxx:yyy -G --data-urlencode 'match[]={monitor!=""}' https://mydomain.com/federate
$ # again nothing returned, status code 200same for: $ curl -v -u xxx:yyy -G --data-urlencode 'match[]={monitor=~".+"}' https://mydomain.com/federate
$ # again nothing returned, status code 200When using a different label, it works ('monitor' label is in the result) $ curl -v -u xxx:yyy -G --data-urlencode 'match[]={job=~".+"}' https://mydomain.com/federate
# TYPE node_network_transmit_drop untyped
node_network_transmit_drop{device="eth2",job="node",instance="bla.com:9100",monitor="codelab-monitor"} 0 1468502652522
# TYPE node_network_transmit_multicast untyped
node_network_transmit_multicast{job="node",instance="bla:9100",device="vethwe-bridge",monitor="codelab-monitor"} 0 1468502654905
# TYPE node_filesystem_readonly untyped
node_filesystem_readonly{instance="bla:9100",job="node",device="/dev/xvda1",fstype="ext4",mountpoint="/",monitor="codelab-monitor"} 0 1468502652057 |
This comment has been minimized.
This comment has been minimized.
|
Ah, this is about the external label. I totally missed that. Literally every time series eposed on What do you want to achieve here? |
This comment has been minimized.
This comment has been minimized.
|
External labels are added after filtering on the |
This comment has been minimized.
This comment has been minimized.
|
I'm having a "global" Prometheus server to scrape data from the other "slave" Prometheus servers (federation). These lower-level Prometheus servers (one per environment/DC) )scrape the data from the targets where the node-exporter is running to expose the metrics.. I want do the alerting and queries on the "global" Prometheus instance which therefore should have the data of all child Prometheus servers. What kind of match query can is use to scrape all the metrics from the "slave" Prometheus servers? |
This comment has been minimized.
This comment has been minimized.
The global shouldn't have all data, it should have aggregated data from the slaves. This is what the first example on http://www.robustperception.io/scaling-and-federating-prometheus/ is showing. |
This comment has been minimized.
This comment has been minimized.
|
@brian-brazil Our usecase is described in the documentation "Cross-service federation" (https://prometheus.io/docs/operating/federation/#cross-service-federation), We want to do the alerting and querying/graphing against a single Prometheus having all data (centralized). |
This comment has been minimized.
This comment has been minimized.
|
@brian-brazil btw, in your slave example your are using the match query |
This comment has been minimized.
This comment has been minimized.
This is generally a bad idea, you should push down a given alert as low as you can in your federation hierarchy to increase reliability. The only time to have alerts from cross-service data is when there's no other way such an alert can be expressed, and in that case you'd only pull in exactly the metrics you need via federation.
That'd come from a recording rule doing aggregation. |
This comment has been minimized.
This comment has been minimized.
|
Ok, that makes sense to me. Thx for the feedback! I think i will reconsider my setup and eventually get rid of the global instance and do alerting/querying against the the specific Prometheus instances. |
This comment has been minimized.
This comment has been minimized.
|
It's fine to have a global Prometheus, it's handy for some types of analysis and alerts such as around capacity planning. |
This comment has been minimized.
This comment has been minimized.
|
Yeah, it's fine to have a global Prometheus, just most of the alerts should Just for completeness' sake, even though it's not recommended, you can {name=~".+"} But yeah, matching against external labels doesn't work since those are On Thu, Jul 14, 2016 at 11:21 PM, Brian Brazil notifications@github.com
|
This comment has been minimized.
This comment has been minimized.
|
Seems we can close this, as this is intended behavior. Could be clearer in the docs somewhere maybe. |
juliusv
closed this
Jul 15, 2016
brian-brazil
referenced this issue
Sep 30, 2016
Closed
Make external labels available in federation matchers #2046
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. |
svenmueller commentedJul 13, 2016
What did you do?
When i call endpoint
/federate?match[]={__name__%3D~"^monitor%3A.*"}i get an empty response (status code200).What did you expect to see?
The endpoint should return values having label starting with "monitor". Another query shows that the external label is set (see label external "monitor")
What did you see instead? Under which circumstances?
Instead of values having label "monitor" i get an empty response with status code
200.Environment
System information:
Linux 3.13.0-91-generic x86_64
Prometheus version:
prometheus, version 0.20.0 (branch: master, revision: aeab25c)
build user: root@77050118f904
build date: 20160616-08:38:14
go version: go1.6.2
Prometheus configuration file:
Any idea why the query doesn't match anything?