That example can't be right.  What you have shown:

  - target_label: __address__
    replacement: ip:port

would put the literal text "ip:port" in the __address__ label, so it can't 
possibly work.

However, switching from static_configs to file_sd_configs isn't really 
related to this. The capabilities of file_sd_configs and static_configs are 
the same.  If you want different labels per host, you can do this with 
static_configs:

  static_configs:
  - targets: ['127.0.0.1:5666']
    labels:
      field1: 'text'
      field2: 'text'
      field3: 'text'
  - targets: ['1.2.3.4:5678']
    labels:
      field1: 'text2'
      field2: 'text2'
      field3: 'text2'

Or you can move this into file_sd_configs.  The format of my_file.yml is 
identical except indented to the left:

- targets: ['127.0.0.1:5666']
  labels:
    field1: 'text'
    field2: 'text'
    field3: 'text'
- targets: ['1.2.3.4:5678']
  labels:
    field1: 'text2'
    field2: 'text2'
    field3: 'text2'


There are more complex options such as making a structured value for the 
__address__, matching it with a regexp, and pulling out the values you 
require into specific labels.  Examples of these sorts of relabelling 
configs have been posted to the list before.

-- 
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/60293c82-63f1-49d4-bb7e-012740d52f28o%40googlegroups.com.

Reply via email to