{"action":"created","issue":{"url":"https://api.github.com/repos/prometheus/node_exporter/issues/1082","repository_url":"https://api.github.com/repos/prometheus/node_exporter","labels_url":"https://api.github.com/repos/prometheus/node_exporter/issues/1082/labels{/name}","comments_url":"https://api.github.com/repos/prometheus/node_exporter/issues/1082/comments","events_url":"https://api.github.com/repos/prometheus/node_exporter/issues/1082/events","html_url":"https://github.com/prometheus/node_exporter/issues/1082","id":362316495,"node_id":"MDU6SXNzdWUzNjIzMTY0OTU=","number":1082,"title":"Systemd service metrics missing once they are stopped return upon starting","user":{"login":"hueyg","id":43451712,"node_id":"MDQ6VXNlcjQzNDUxNzEy","avatar_url":"https://avatars2.githubusercontent.com/u/43451712?v=4","gravatar_id":"","url":"https://api.github.com/users/hueyg","html_url":"https://github.com/hueyg","followers_url":"https://api.github.com/users/hueyg/followers","following_url":"https://api.github.com/users/hueyg/following{/other_user}","gists_url":"https://api.github.com/users/hueyg/gists{/gist_id}","starred_url":"https://api.github.com/users/hueyg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hueyg/subscriptions","organizations_url":"https://api.github.com/users/hueyg/orgs","repos_url":"https://api.github.com/users/hueyg/repos","events_url":"https://api.github.com/users/hueyg/events{/privacy}","received_events_url":"https://api.github.com/users/hueyg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2018-09-20T18:51:03Z","updated_at":"2018-09-21T18:55:53Z","closed_at":null,"author_association":"NONE","body":"<!--\r\n\tPlease note: GitHub issues should only be used for feature requests and\r\n\tbug reports. For general usage/help/discussions, please refer to one of:\r\n\r\n\t- #prometheus on freenode\r\n\t- the Prometheus Users list: https://groups.google.com/forum/#!forum/prometheus-users\r\n\r\n\tBefore filing a bug report, note that running node_exporter in Docker is\r\n\tnot recommended, for the reasons detailed in the README:\r\n\r\n\thttps://github.com/prometheus/node_exporter#using-docker\r\n\r\n\tFinally, also note that node_exporter is focused on *NIX kernels, and the\r\n\tWMI exporter should be used instead on Windows.\r\n\r\n\tFor bug reports, please fill out the below fields and provide as much detail\r\n\tas possible about your issue.  For feature requests, you may omit the\r\n\tfollowing template.\r\n-->\r\n### Host operating system: output of `uname -a`\r\n3.10.0-862.11.6.el7.x86_64\r\nRed Hat Enterprise Linux Server release 7.5 (Maipo)\r\n\r\n### node_exporter version: output of `node_exporter --version`\r\n<!-- If building from source, run `make` first. -->\r\nnode_exporter, version 0.16.0 (branch: HEAD, revision: d42bd70f4363dced6b77d8fc311ea57b63387e4f)\r\n  build user:       root@a67a9bc13a69\r\n  build date:       20180515-15:52:42\r\n  go version:       go1.9.6\r\n\r\n### node_exporter command line flags\r\n<!-- Please list all of the command line flags -->\r\nExecStart=/home/prometheus/node_exporter/node_exporter --collector.systemd\r\n\r\n### Are you running node_exporter in Docker?\r\n<!-- Please note the warning above. -->\r\nNo\r\n\r\n### What did you do that produced an error?\r\nHave a custom systemd service defined in /etc/systemd/system for the Keepalived daemon.  Running the following query returns the expected results with all five defined states:\r\nnode_systemd_unit_state{instance=\"x.x.x.x:9100\",name=\"keepalived.service\"}\r\n\r\nnode_systemd_unit_state{instance=\"192.245.221.215:9100\",job=\"node2\",name=\"keepalived.service\",state=\"activating\"}\t0\r\nnode_systemd_unit_state{instance=\"192.245.221.215:9100\",job=\"node2\",name=\"keepalived.service\",state=\"active\"}\t1\r\nnode_systemd_unit_state{instance=\"192.245.221.215:9100\",job=\"node2\",name=\"keepalived.service\",state=\"deactivating\"}\t0\r\nnode_systemd_unit_state{instance=\"192.245.221.215:9100\",job=\"node2\",name=\"keepalived.service\",state=\"failed\"}\t0\r\nnode_systemd_unit_state{instance=\"192.245.221.215:9100\",job=\"node2\",name=\"keepalived.service\",state=\"inactive\"}\t0\r\n\r\nOnce i issue a sudo systemctl stop keepalived.service and run the query again, then the prometheus returns nothing.  It is as if the service was never defined.  I run the query and don't filter on job name and every other service is returned.  Once I start the service, the metrics will return again.\r\n\r\n### What did you expect to see?\r\n\r\nExpected to continue to see the states returned, but with Active=0 and Inactive=1\r\n\r\n### What did you see instead?\r\n\r\nNo metrics for the service were returned period.  Nothing.  Blank screen.  I have an a secondary server which I thought was an exact mirror image of the server exhibiting the issue and it does not experience this problem.  Thank you for everyone's time."},"comment":{"url":"https://api.github.com/repos/prometheus/node_exporter/issues/comments/423638270","html_url":"https://github.com/prometheus/node_exporter/issues/1082#issuecomment-423638270","issue_url":"https://api.github.com/repos/prometheus/node_exporter/issues/1082","id":423638270,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzYzODI3MA==","user":{"login":"lucab","id":98086,"node_id":"MDQ6VXNlcjk4MDg2","avatar_url":"https://avatars1.githubusercontent.com/u/98086?v=4","gravatar_id":"","url":"https://api.github.com/users/lucab","html_url":"https://github.com/lucab","followers_url":"https://api.github.com/users/lucab/followers","following_url":"https://api.github.com/users/lucab/following{/other_user}","gists_url":"https://api.github.com/users/lucab/gists{/gist_id}","starred_url":"https://api.github.com/users/lucab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucab/subscriptions","organizations_url":"https://api.github.com/users/lucab/orgs","repos_url":"https://api.github.com/users/lucab/repos","events_url":"https://api.github.com/users/lucab/events{/privacy}","received_events_url":"https://api.github.com/users/lucab/received_events","type":"User","site_admin":false},"created_at":"2018-09-21T18:55:53Z","updated_at":"2018-09-21T18:55:53Z","author_association":"CONTRIBUTOR","body":"@SuperQ I think that's because the unit is inactive and disabled. Additionally, I fear that at some point the `ListUnits` DBus method may have changed semantics as its documentations mentions \"loaded units\" everywhere (or either the doc or the code is wrong). My suggestion would be to try using `ListUnitsFiltered` instead."}}
{"actor":{"display_login":"lucab"}}