{"action":"opened","issue":{"url":"https://api.github.com/repos/prometheus/prometheus/issues/4008","repository_url":"https://api.github.com/repos/prometheus/prometheus","labels_url":"https://api.github.com/repos/prometheus/prometheus/issues/4008/labels{/name}","comments_url":"https://api.github.com/repos/prometheus/prometheus/issues/4008/comments","events_url":"https://api.github.com/repos/prometheus/prometheus/issues/4008/events","html_url":"https://github.com/prometheus/prometheus/issues/4008","id":308305504,"number":4008,"title":"Kubernetes ingress discovery does not set address label for ingresses without host ","user":{"login":"Mattias-","id":1002805,"avatar_url":"https://avatars1.githubusercontent.com/u/1002805?v=4","gravatar_id":"","url":"https://api.github.com/users/Mattias-","html_url":"https://github.com/Mattias-","followers_url":"https://api.github.com/users/Mattias-/followers","following_url":"https://api.github.com/users/Mattias-/following{/other_user}","gists_url":"https://api.github.com/users/Mattias-/gists{/gist_id}","starred_url":"https://api.github.com/users/Mattias-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mattias-/subscriptions","organizations_url":"https://api.github.com/users/Mattias-/orgs","repos_url":"https://api.github.com/users/Mattias-/repos","events_url":"https://api.github.com/users/Mattias-/events{/privacy}","received_events_url":"https://api.github.com/users/Mattias-/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-24T22:46:29Z","updated_at":"2018-03-24T22:46:29Z","closed_at":null,"author_association":"NONE","body":"**What did you do?**\r\nConfigured discovery of kubernetes ingresses.\r\n```\r\napiVersion: extensions/v1beta1\r\nkind: Ingress\r\nmetadata:\r\n  name: alertmanager-ingress\r\n  namespace: monitoring-prometheus\r\n  annotations:\r\n    kubernetes.io/ingress.class: \"nginx\"\r\n    nginx.ingress.kubernetes.io/rewrite-target: \"/\"\r\n    prometheus.io/probe: \"true\"\r\nspec:\r\n  rules:\r\n    - http:\r\n        paths:\r\n          - path: /alertmanager\r\n            backend:\r\n              serviceName: alertmanager\r\n              servicePort: http\r\n    - http:\r\n        paths:\r\n          - path: /alertmanager\r\n            backend:\r\n              serviceName: alertmanager\r\n              servicePort: http\r\n      host: alertmanager.local\r\n```\r\n\r\n**What did you expect to see?**\r\nAll annotated ingresses to show up as targets that can be successfully scraped.\r\n\r\n**What did you see instead? Under which circumstances?**\r\nNo target label is set for ingresses that hasn't specified a host and the scraping fail.\r\n![image](https://user-images.githubusercontent.com/1002805/37869690-84d0d0fe-2fbc-11e8-991b-5a89781d73cc.png)\r\n\r\n![image](https://user-images.githubusercontent.com/1002805/37869652-d1e5e7ae-2fbb-11e8-924e-9406528ab152.png)\r\n\r\n\r\n**Environment**\r\n\r\n* System information:\r\n\r\n`Linux 4.9.64 x86_64`\r\n\r\n* Prometheus version:\r\n\r\n`2.2.1` docker image\r\n\r\n* Prometheus configuration file:\r\n```\r\n    - job_name: 'kubernetes-ingresses'\r\n\r\n      metrics_path: /probe\r\n      params:\r\n        module: [http_2xx]\r\n\r\n      kubernetes_sd_configs:\r\n      - role: ingress\r\n\r\n      relabel_configs:\r\n      - source_labels: [__meta_kubernetes_ingress_annotation_prometheus_io_probe]\r\n        action: keep\r\n        regex: true\r\n      - source_labels: [__meta_kubernetes_ingress_scheme,__address__,__meta_kubernetes_ingress_path]\r\n        regex: (.+);(.+);(.+)\r\n        replacement: ${1}://${2}${3}\r\n        target_label: __param_target\r\n      - source_labels: [__meta_kubernetes_ingress_scheme,__meta_kubernetes_ingress_path]\r\n        regex: (.+);(.+)\r\n        replacement: ${1}://xx${2}\r\n        target_label: mylabel\r\n      - target_label: __address__\r\n        replacement: blackbox-exporter:9115\r\n      - source_labels: [__param_target]\r\n        target_label: instance\r\n      - action: labelmap\r\n        regex: __meta_kubernetes_ingress_label_(.+)\r\n      - source_labels: [__meta_kubernetes_namespace]\r\n        target_label: kubernetes_namespace\r\n      - source_labels: [__meta_kubernetes_ingress_name]\r\n        target_label: kubernetes_name\r\n```"}}
{"actor":{"display_login":"Mattias-"}}