Skip to main content

Systemd Receiver

Status Available in: contrib Maintainers: @atoulme Source: opentelemetry-collector-contrib

Supported Telemetry

Metrics

Overview

This scraper generates a metric with a label for service state with a value of 1 if the unit is in that state. For example, the following metrics will be generated if the nginx service is currently active:
systemd.unit.state{systemd.unit.name="nginx", systemd.unit.active_state="active"} = 1
systemd.unit.state{systemd.unit.name="nginx", systemd.unit.active_state="reloading"} = 0
systemd.unit.state{systemd.unit.name="nginx", systemd.unit.active_state="inactive"} = 0
systemd.unit.state{systemd.unit.name="nginx", systemd.unit.active_state="failed"} = 0
systemd.unit.state{systemd.unit.name="nginx", systemd.unit.active_state="activating"} = 0
systemd.unit.state{systemd.unit.name="nginx", systemd.unit.active_state="deactivating"} = 0
systemd.unit.state{systemd.unit.name="nginx", systemd.unit.active_state="maintenance"} = 0
systemd.unit.state{systemd.unit.name="nginx", systemd.unit.active_state="refreshing"} = 0

Configuration

FieldDefaultDescription
scopesystemThe service manager to gather units from, either system or user.
units["*.service"]The units to scrape, as a list of patterns.

Example

Basic configuration

In its default configuration, the systemd receiver will scrape all system-level services:
  receivers:
    systemd:

Advanced configuration

  receivers:
    systemd:
        scope: user
        units: ["emacs.service"]

Metrics

Metric NameDescriptionUnitTypeAttributes
systemd.service.cpu.timeTotal CPU time spent by this service.usCountercpu.mode
systemd.service.restartsNumber of automatic restarts for the service.{restarts}Counter
systemd.unit.state1 if the check resulted in active_state matching the current state, otherwise 0.1UpDownCountersystemd.unit.active_state

Attributes

Attribute NameDescriptionTypeValues
cpu.modeBreakdown of CPU usage by type.stringsystem, user
systemd.unit.active_stateThe active state of the unit (https://www.freedesktop.org/software/systemd/man/latest/systemd.html#Units)stringactive, reloading, inactive, failed, activating, deactivating, maintenance, refreshing

Resource Attributes

Attribute NameDescriptionTypeEnabled
systemd.unit.nameName of the systemd unitstring

Last generated: 2026-04-13