On Tuesday, December 1, 2020 at 4:25:13 PM UTC-5 [email protected] wrote:
> Federation is fine - although you could also just query the regular > 'query' API endpoint. > > Your label query is failing because of curl interpreting metacharacters > specially. Add the "-g" flag to curl and you should be OK. > Oops. Asleep at the wheel :( The query API won't do, as it returns a JSON object, and I need a single line that looks like the output of */metrics*. Thanks! /ji > > On Tuesday, 1 December 2020 at 19:22:44 UTC [email protected] wrote: > >> I scrape several node exporters and create a new metric in a rule. For >> example, each node exporter exports a *node_active_jobs* metric, and >> let's say that one of the labels is *job_class*, and I my rules file >> says: >> >> >> >> >> >> >> *groups: - name: alljobs rules: - record: active_jobs expr: >> sum (node_active_jobs) by (job_class) * >> How can I make the resulting *active_jobs *metric visible to some other >> scraper (in myh case: the Google Compute Engine autoscaler). The closest I >> have come to is use *http://localhost:9090/federate?match[]=active__jobs >> <http://localhost:9090/federate?match[]=active__jobs>,* but (a) this >> also appends a timestamp to the metric, which confuses the autoscaler, and >> (b) does not allow me to specify labels (*curl >> 'http://localhost:9090/federate?match[]=active__jobs{job_class= >> <http://localhost:9090/federate?match[]=active__jobs%7Bjob_class=>"priority"} >> *fails >> with 1:35: parse error: could not parse remaining input "=\"priority\""... >> >> Help? >> >> >> >> >> -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/50dadf7b-f47d-4b16-9b91-3011d795bfb0n%40googlegroups.com.

