Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup metric types #9

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@

### **Breaking changes**

* `systemd_unit_state` label `type` has new meaning
Now shows Unit type (`service`, `scope`, etc), not Service Unit types (`simple`, `forking`, etc)
or mount unit types(`aufs`,`ext3`, etc). Service and mount types have been moved to `systemd_unit_info`
* `systemd_unit_state` label `type` has new meaning. Previously `type` contained service unit type (`simple`, `forking`, etc) or mount unit types (`aufs`, `ext3`, etc). Now `systemd_unit_state{type}` contains overall unit type (`service`, `scope`, etc) to allow easy PromQL group by clauses. Service and mount types have been moved to `systemd_unit_info`

### Changes

- [FEATURE] Read unit CPU usage from cgroup. Added `systemd_unit_cpu_seconds_total` metric. **Note** - Untested on unified hierarchy
- [FEATURE] Add `systemd_unit_info` with metainformation about units incl. subtype specific info
- [ENHANCEMENT] Added `type` label to all metrics named `systemd_unit-*` to support PromQL grouping
* [ENHANCEMENT] `systemd_unit_state` works for all unit types, not just service and mount units
* [ENHANCEMENT] Scrapes are approx 80% faster. If needed, set GOMAXPROCS to limit max concurrency
* [CHANGE] Start tracking metric cardinality in readme
* [CHANGE] Expanded default set of unit types monitored. Only device unit types are not enabled by default
* [BUGFIX] `timer_last_trigger_seconds` metric is now exported as expected for all timers
- [ENHANCEMENT] `systemd_unit_state` works for all unit types, not just service and mount units
- [ENHANCEMENT] Scrapes are approx 80% faster. If needed, set GOMAXPROCS to limit max concurrency
- [CHANGE] Start tracking metric cardinality in readme
- [CHANGE] Expanded default set of unit types monitored. Only device unit types are not enabled by default
- [BUGFIX] `timer_last_trigger_seconds` metric is now exported as expected for all timers

## 0.2.0 / 2019-03-20

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ Note that a number of unit types are filtered by default
| ----------------------------------------- | ----------- | -------- | ------------------------------------------------------------------ |
| systemd_exporter_build_info | Gauge | UNSTABLE | 1 per systemd-exporter |
| systemd_unit_info | Gauge | UNSTABLE | 1 per service + 1 per mount |
| systemd_unit_cpu_seconds_total | Gauge | UNSTABLE | 2 per mount/scope/slice/socket/swap {mode="system/user"} |
| systemd_unit_cpu_seconds_total | Counter | UNSTABLE | 2 per mount/scope/slice/socket/swap {mode="system/user"} |
| systemd_unit_state | Gauge | UNSTABLE | 5 per unit {state="activating/active/deactivating/failed/inactive} |
| systemd_unit_tasks_current | Gauge | UNSTABLE | 1 per service |
| systemd_unit_tasks_max | Gauge | UNSTABLE | 1 per service |
| systemd_unit_start_time_seconds | Gauge | UNSTABLE | 1 per service |
| systemd_service_restart_total | Gauge | UNSTABLE | 1 per service |
| systemd_service_restart_total | Counter | UNSTABLE | 1 per service |
| systemd_socket_accepted_connections_total | Counter | UNSTABLE | 1 per socket |
| systemd_socket_current_connections | Gauge | UNSTABLE | 1 per socket |
| systemd_socket_refused_connections_total | Gauge | UNSTABLE | 1 per socket |
| systemd_socket_refused_connections_total | Counter | UNSTABLE | 1 per socket. Requires systemd>239 |
| systemd_timer_last_trigger_seconds | Gauge | UNSTABLE | 1 per timer |
| systemd_process_resident_memory_bytes | Gauge | UNSTABLE | 1 per service |
| systemd_process_virtual_memory_bytes | Gauge | UNSTABLE | 1 per service |
Expand Down
2 changes: 1 addition & 1 deletion systemd/systemd.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ func (c *Collector) collectSocketConnMetrics(conn *dbus.Conn, ch chan<- promethe
return errors.Wrapf(err, errGetPropertyMsg, "NRefused")
}
ch <- prometheus.MustNewConstMetric(
c.socketRefusedConnectionsDesc, prometheus.GaugeValue,
c.socketRefusedConnectionsDesc, prometheus.CounterValue,
float64(refusedConnectionCount.Value.Value().(uint32)), unit.Name)

return nil
Expand Down