{"action":"created","issue":{"url":"https://api.github.com/repos/prometheus/node_exporter/issues/1127","repository_url":"https://api.github.com/repos/prometheus/node_exporter","labels_url":"https://api.github.com/repos/prometheus/node_exporter/issues/1127/labels{/name}","comments_url":"https://api.github.com/repos/prometheus/node_exporter/issues/1127/comments","events_url":"https://api.github.com/repos/prometheus/node_exporter/issues/1127/events","html_url":"https://github.com/prometheus/node_exporter/issues/1127","id":374268667,"node_id":"MDU6SXNzdWUzNzQyNjg2Njc=","number":1127,"title":"memory_bsd.go has a sysctl which isn't available in recent DragonflyBSD (not sure about previous one)","user":{"login":"iori-yja","id":514632,"node_id":"MDQ6VXNlcjUxNDYzMg==","avatar_url":"https://avatars2.githubusercontent.com/u/514632?v=4","gravatar_id":"","url":"https://api.github.com/users/iori-yja","html_url":"https://github.com/iori-yja","followers_url":"https://api.github.com/users/iori-yja/followers","following_url":"https://api.github.com/users/iori-yja/following{/other_user}","gists_url":"https://api.github.com/users/iori-yja/gists{/gist_id}","starred_url":"https://api.github.com/users/iori-yja/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iori-yja/subscriptions","organizations_url":"https://api.github.com/users/iori-yja/orgs","repos_url":"https://api.github.com/users/iori-yja/repos","events_url":"https://api.github.com/users/iori-yja/events{/privacy}","received_events_url":"https://api.github.com/users/iori-yja/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"matthiasr","id":131590,"node_id":"MDQ6VXNlcjEzMTU5MA==","avatar_url":"https://avatars1.githubusercontent.com/u/131590?v=4","gravatar_id":"","url":"https://api.github.com/users/matthiasr","html_url":"https://github.com/matthiasr","followers_url":"https://api.github.com/users/matthiasr/followers","following_url":"https://api.github.com/users/matthiasr/following{/other_user}","gists_url":"https://api.github.com/users/matthiasr/gists{/gist_id}","starred_url":"https://api.github.com/users/matthiasr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthiasr/subscriptions","organizations_url":"https://api.github.com/users/matthiasr/orgs","repos_url":"https://api.github.com/users/matthiasr/repos","events_url":"https://api.github.com/users/matthiasr/events{/privacy}","received_events_url":"https://api.github.com/users/matthiasr/received_events","type":"User","site_admin":false},"assignees":[{"login":"matthiasr","id":131590,"node_id":"MDQ6VXNlcjEzMTU5MA==","avatar_url":"https://avatars1.githubusercontent.com/u/131590?v=4","gravatar_id":"","url":"https://api.github.com/users/matthiasr","html_url":"https://github.com/matthiasr","followers_url":"https://api.github.com/users/matthiasr/followers","following_url":"https://api.github.com/users/matthiasr/following{/other_user}","gists_url":"https://api.github.com/users/matthiasr/gists{/gist_id}","starred_url":"https://api.github.com/users/matthiasr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthiasr/subscriptions","organizations_url":"https://api.github.com/users/matthiasr/orgs","repos_url":"https://api.github.com/users/matthiasr/repos","events_url":"https://api.github.com/users/matthiasr/events{/privacy}","received_events_url":"https://api.github.com/users/matthiasr/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2018-10-26T07:57:09Z","updated_at":"2018-11-05T15:34:23Z","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\r\n### Summary ###\r\n\r\nThis error shown below is due to `vm.swap_total` sysctl that isn't available in recent DragonflyBSD (I am not sure about prior one, but FreeBSD has). I have changed the code as following patch which makes it works:\r\n```\r\niori@tech-y09-dfly% git diff\r\ndiff --git a/collector/memory_bsd.go b/collector/memory_bsd.go\r\nindex 8c7265e..268dccc 100644\r\n--- a/collector/memory_bsd.go\r\n+++ b/collector/memory_bsd.go\r\n@@ -98,7 +98,7 @@ func NewMemoryCollector() (Collector, error) {\r\n                        {\r\n                                name:        \"swap_size_bytes\",\r\n                                description: \"Total swap memory size\",\r\n-                               mib:         \"vm.swap_total\",\r\n+                               mib:         \"vm.swap_size\",\r\n                                dataType:    bsdSysctlTypeUint64,\r\n                        },\r\n                        // Descriptions via: top(1)\r\n```\r\n\r\nMy question is that whether should I make PR to diverge Dfly's memory.go from `memory_bsd.go`. If this is applicable for other version of DragonflyBSD, I think it is worth to make them separate. If it is only seen in recent version of Dfly, I am not sure what to handle this difference. Please give me some hints to make a PR without regression.\r\n### Host operating system: output of `uname -a`\r\nDragonFly tech-y09-dfly 5.3-DEVELOPMENT DragonFly v5.3.0.18494.gc70d4-DEVELOPMENT #1: Fri Aug 24 12:27:12 JST 2018     root@tech-y09-dfly:/usr/obj/usr/src/sys/X86_64_GENERIC  x86_64\r\n\r\n\r\n### node_exporter version: output of `node_exporter --version`\r\n<!-- If building from source, run `make` first. -->\r\nInstalled from source.\r\niori@tech-y09-dfly% git log | head -n 3\r\ncommit 751996761903af4cffe18cf2d980b8ae9a202204\r\nAuthor: Ben Kochie <superq@gmail.com>\r\nDate:   Sat Oct 20 08:21:51 2018 +0200\r\niori@tech-y09-dfly% node_exporter --version\r\nnode_exporter, version  (branch: , revision: )\r\n  build user:\r\n  build date:\r\n  go version:       go1.10.3\r\n\r\n### node_exporter command line flags\r\n<!-- Please list all of the command line flags -->\r\n`node_exporter` (default)\r\n### Are you running node_exporter in Docker?\r\n<!-- Please note the warning above. -->\r\nNo\r\n### What did you do that produced an error?\r\nWait for a couple of seconds.\r\n### What did you expect to see?\r\nNo errors\r\n### What did you see instead?\r\n\r\n```\r\niori@tech-y09-dfly% node_exporter\r\nINFO[0000] Starting node_exporter (version=, branch=, revision=)  source=\"node_exporter.go:82\"\r\nINFO[0000] Build context (go=go1.10.3, user=, date=)     source=\"node_exporter.go:83\"\r\nINFO[0000] Enabled collectors:                           source=\"node_exporter.go:90\"\r\nINFO[0000]  - boottime                                   source=\"node_exporter.go:97\"\r\nINFO[0000]  - cpu                                        source=\"node_exporter.go:97\"\r\nINFO[0000]  - exec                                       source=\"node_exporter.go:97\"\r\nINFO[0000]  - filesystem                                 source=\"node_exporter.go:97\"\r\nINFO[0000]  - loadavg                                    source=\"node_exporter.go:97\"\r\nINFO[0000]  - meminfo                                    source=\"node_exporter.go:97\"\r\nINFO[0000]  - netdev                                     source=\"node_exporter.go:97\"\r\nINFO[0000]  - textfile                                   source=\"node_exporter.go:97\"\r\nINFO[0000]  - time                                       source=\"node_exporter.go:97\"\r\nINFO[0000] Listening on :9100                            source=\"node_exporter.go:111\"\r\nERRO[0001] ERROR: meminfo collector failed after 0.000037s: couldn't get memory: no such file or directory  source=\"collector.go:132\" \r\nERRO[0006] ERROR: meminfo collector failed after 0.000034s: couldn't get memory: no such file or directory  source=\"collector.go:132\"\r\nERRO[0011] ERROR: meminfo collector failed after 0.000037s: couldn't get memory: no such file or directory  source=\"collector.go:132\"\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/prometheus/node_exporter/issues/comments/435918640","html_url":"https://github.com/prometheus/node_exporter/issues/1127#issuecomment-435918640","issue_url":"https://api.github.com/repos/prometheus/node_exporter/issues/1127","id":435918640,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNTkxODY0MA==","user":{"login":"discordianfish","id":275966,"node_id":"MDQ6VXNlcjI3NTk2Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/275966?v=4","gravatar_id":"","url":"https://api.github.com/users/discordianfish","html_url":"https://github.com/discordianfish","followers_url":"https://api.github.com/users/discordianfish/followers","following_url":"https://api.github.com/users/discordianfish/following{/other_user}","gists_url":"https://api.github.com/users/discordianfish/gists{/gist_id}","starred_url":"https://api.github.com/users/discordianfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/discordianfish/subscriptions","organizations_url":"https://api.github.com/users/discordianfish/orgs","repos_url":"https://api.github.com/users/discordianfish/repos","events_url":"https://api.github.com/users/discordianfish/events{/privacy}","received_events_url":"https://api.github.com/users/discordianfish/received_events","type":"User","site_admin":false},"created_at":"2018-11-05T15:34:23Z","updated_at":"2018-11-05T15:34:23Z","author_association":"MEMBER","body":"I think a simple check to use either swap_total or swap_size is probably fine.. But still, not using BSD and not knowing how dragonfly compares to freebsd I don't really have a opinion on that."}}
{"actor":{"display_login":"discordianfish"}}