prometheus / prometheus/node_exporter

implement handling of systemd active (exited) status

Open
#1,350 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
13.8k
Forks
2.7k
Avg merge
1d 23h
Merged PRs (30d)
8

Description

Host operating system: output of uname -a

uname -a
Linux test-zone-1 3.16.0-4-amd64 #1 SMP Debian 3.16.51-3 (2017-12-13) x86_64 GNU/Linux

node_exporter version: output of node_exporter --version

node_exporter, version 0.17.0 (branch: HEAD, revision: f6f6194a436b9a63d0439abc585c76b19a206b21)
build user: root@322511e06ced
build date: 20181130-15:51:33
go version: go1.11.2

node_exporter command line flags
  - '--path.rootfs=/'
  - '--collector.systemd'
Are you running node_exporter in Docker?

yes. via docker compose
docker -v
Docker version 18.06.3-ce, build d7080c1
docker-compose -v
docker-compose version 1.24.0-rc1, build 0f3d4dda

What did you do that produced an error?

suddenly my service became active (exited)

What did you expect to see?

I expected to see a change of a metric value
node_systemd_unit_state{state=active}

What did you see instead?

metric stood at value of 1.

and that there's no difference between active (running) and active (exited) statuses for the exporter.

Is there a possibility to handle such cases?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the --collector.systemd entry point and inspect how node_systemd_unit_state represents systemd unit states. Reproduce the active (running) and active (exited) cases on Linux, then verify that the metric exposes distinct values for those statuses.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, linux, prometheus
Domain
observability, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.