Multiple targets on single node in openstack service discovery

16 views
Skip to first unread message

pah...@gmail.com

unread,
Aug 27, 2020, 10:42:40 PM8/27/20
to Prometheus Users

Here's our current configuration for openstack service discovery for node exporter:


scrape_configs:
  - job_name: 'openstack_service_discovery'
    openstack_sd_configs:
      - identity_endpoint: 'http://openstack.somewhere.org:5000/v3'
        role: instance
        region: RegionOne
        username: <username>
        password: <password>
        domain_name: default
        project_name: project
    relabel_configs:
    - source_labels: [__meta_openstack_private_ip]
      regex:         ^172\.18\..*
      action:        keep
    - source_labels: [__meta_openstack_tag_node_exporter]
      regex: ^true
      action: keep
    - source_labels: [__address__]
      regex:         (.*):80
      target_label: __address__
      replacement: $1:9100
    - source_labels: [__meta_openstack_instance_name]
      target_label: openstack_instance_name

We'd like to add a relabel configuration to detect cadvisor exporter targets that may or may not exist on the same nodes on port 8080. Is it possible to do this without having to set up a new job and thus double our openstack api calls? Or triple them in the future if we add another exporter, etc.? Is it somehow possible to do multiple relabel configurations that re-use the data from the one job? What would the syntax look like? We basically want to add (differences highlighted):

    - source_labels: [__meta_openstack_private_ip]
      regex:         ^172\.18\..*
      action:        keep
    - source_labels: [__meta_openstack_tag_cadvisor]
      regex: ^true
      action: keep
    - source_labels: [__address__]
      regex:         (.*):80
      target_label: __address__
      replacement: $1:8080
    - source_labels: [__meta_openstack_instance_name]
      target_label: openstack_instance_name
Reply all
Reply to author
Forward
0 new messages