{"action":"created","issue":{"url":"https://api.github.com/repos/prometheus/prometheus/issues/871","labels_url":"https://api.github.com/repos/prometheus/prometheus/issues/871/labels{/name}","comments_url":"https://api.github.com/repos/prometheus/prometheus/issues/871/comments","events_url":"https://api.github.com/repos/prometheus/prometheus/issues/871/events","html_url":"https://github.com/prometheus/prometheus/issues/871","id":92628812,"number":871,"title":"Can't relabel based on instance from pushgateway","user":{"login":"TheTincho","id":5602605,"avatar_url":"https://avatars.githubusercontent.com/u/5602605?v=3","gravatar_id":"","url":"https://api.github.com/users/TheTincho","html_url":"https://github.com/TheTincho","followers_url":"https://api.github.com/users/TheTincho/followers","following_url":"https://api.github.com/users/TheTincho/following{/other_user}","gists_url":"https://api.github.com/users/TheTincho/gists{/gist_id}","starred_url":"https://api.github.com/users/TheTincho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheTincho/subscriptions","organizations_url":"https://api.github.com/users/TheTincho/orgs","repos_url":"https://api.github.com/users/TheTincho/repos","events_url":"https://api.github.com/users/TheTincho/events{/privacy}","received_events_url":"https://api.github.com/users/TheTincho/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-07-02T12:47:58Z","updated_at":"2015-07-02T15:03:40Z","closed_at":null,"body":"Hi,\r\n\r\nI have set up a pushgateway to collect stats from logs in different instances of the same service. As I want to be able to easily match these data with the node_exporter stats, I am creating a label 'host' from the instance.\r\n\r\nThis works well for the node_exporter job (using the ```__address__``` meta metric as a source), but I cannot make it work with the pushgateway; I've tried ```relabel_configs``` and ```metric_relabel_configs``` with the same regex that works for the node_exporter, using the ```instance``` metric, but it seems that it is being ignored.\r\n\r\nConfig snippet:\r\n```\r\n  - job_name: pushgateway\r\n    metric_relabel_configs:\r\n      - source_labels: ['instance']\r\n        target_label: 'host'\r\n        regex: '^([\\w.-]*?)(?:-oam)?(\\.[\\w.-]*)(?::(\\d+))?$'\r\n        replacement: '${1}${2}'\r\n\r\n  - job_name: node\r\n    relabel_configs:\r\n      - source_labels: ['__address__']\r\n        target_label: 'host'\r\n        regex: '^([\\w.-]*?)(?:-oam)?(\\.[\\w.-]*)(?::(\\d+))?$'\r\n        replacement: '${1}${2}'\r\n```"},"comment":{"url":"https://api.github.com/repos/prometheus/prometheus/issues/comments/118060818","html_url":"https://github.com/prometheus/prometheus/issues/871#issuecomment-118060818","issue_url":"https://api.github.com/repos/prometheus/prometheus/issues/871","id":118060818,"user":{"login":"beorn7","id":5609886,"avatar_url":"https://avatars.githubusercontent.com/u/5609886?v=3","gravatar_id":"","url":"https://api.github.com/users/beorn7","html_url":"https://github.com/beorn7","followers_url":"https://api.github.com/users/beorn7/followers","following_url":"https://api.github.com/users/beorn7/following{/other_user}","gists_url":"https://api.github.com/users/beorn7/gists{/gist_id}","starred_url":"https://api.github.com/users/beorn7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beorn7/subscriptions","organizations_url":"https://api.github.com/users/beorn7/orgs","repos_url":"https://api.github.com/users/beorn7/repos","events_url":"https://api.github.com/users/beorn7/events{/privacy}","received_events_url":"https://api.github.com/users/beorn7/received_events","type":"User","site_admin":false},"created_at":"2015-07-02T15:03:40Z","updated_at":"2015-07-02T15:03:40Z","body":"But in this case, instance is set by the pushgateway already, isn't it?"}}