Can I have multiple jobs with the same name?

25 views
Skip to first unread message

Paddy Newman

unread,
Jul 9, 2020, 8:54:07 AM7/9/20
to Prometheus Users
Hi Everyone!

I'd love to be able to do this:

- job_name: f5
  static_configs:
  - targets:
    - 123.345.789.100:1234
  labels:
    location: eastcoast

- job_name: f5
  static_configs:
  - targets:
    - 123.345.789.200:1234
  labels:
    location: westcoast

...so that I'd only have one job name. As things stand I think I have to use two unique job names e.g., f5-eastcoast and f5-westcoast.

Has that come up before?

Ben Kochie

unread,
Jul 9, 2020, 8:57:14 AM7/9/20
to Paddy Newman, Prometheus Users
No, but your indenting is off for the static_configs. You can do what you're trying to do with multiple static_config entries.

- job_name: f5
  static_configs:
  - targets:
    - 123.345.789.100:1234
    labels:
      location: eastcoast
  - targets:
    - 123.345.789.200:1234
    labels:
      location: westcoast
--
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 prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/8711851a-d17a-4446-bfaf-51ce9d4332aco%40googlegroups.com.

Paddy Newman

unread,
Jul 9, 2020, 9:27:56 AM7/9/20
to Prometheus Users
Thanks, Ben! That's exactly what I need.
Reply all
Reply to author
Forward
0 new messages