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

Release v0.6.0 #106

Merged
merged 1 commit into from
Oct 30, 2023
Merged
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
49 changes: 3 additions & 46 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ executors:
# also be updated.
golang:
docker:
- image: cimg/go:1.20
- image: cimg/go:1.21

jobs:
test:
Expand All @@ -21,46 +21,6 @@ jobs:
- prometheus/store_artifact:
file: systemd_exporter

codespell:
docker:
- image: cimg/python:3.11

steps:
- checkout
- run: pip install codespell
- run: codespell --skip=".git,./vendor,ttar,go.mod,go.sum,*pem" -L uint,packages\',uptodate

build:
machine:
image: ubuntu-2204:current

environment:
DOCKER_TEST_IMAGE_NAME: quay.io/prometheus/golang-builder:1.18-base
REPO_PATH: github.com/prometheus-community/systemd_exporter

steps:
- checkout
- run: docker run --privileged linuxkit/binfmt:v0.8
- run: make promu
- run: promu crossbuild
- run: promu --config .promu.yml crossbuild
- persist_to_workspace:
root: .
paths:
- .build
- store_artifacts:
path: .build
destination: /build
- run:
command: |
if [ -n "$CIRCLE_TAG" ]; then
make docker DOCKER_IMAGE_TAG=$CIRCLE_TAG
else
make docker
fi
- run: docker images
- run: docker run --rm -t -v "$(pwd):/app" "${DOCKER_TEST_IMAGE_NAME}" -i "${REPO_PATH}" -T

workflows:
version: 2
systemd_exporter:
Expand All @@ -69,11 +29,8 @@ workflows:
filters:
tags:
only: /.*/
- build:
filters:
tags:
only: /.*/
- codespell:
- prometheus/build:
name: build
filters:
tags:
only: /.*/
Expand Down
11 changes: 10 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
---
linters:
enable:
- misspell
- revive

issues:
exclude-rules:
- path: _test.go
Expand All @@ -7,4 +12,8 @@ issues:

linters-settings:
errcheck:
exclude: scripts/errcheck_excludes.txt
exclude-functions:
# Used in HTTP handlers, any error is handled by the server itself.
- (net/http.ResponseWriter).Write
# Never check for logger errors.
- (github.com/go-kit/log.Logger).Log
3 changes: 1 addition & 2 deletions .promu.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
go:
# Whenever the Go version is updated here, .travis.yml and
# .circle/config.yml should also be updated.
version: 1.20
version: 1.21
repository:
path: github.com/prometheus-community/systemd_exporter
build:
binaries:
- name: systemd_exporter
flags: -a -tags 'netgo static_build'
ldflags: |
-X github.com/prometheus/common/version.Version={{.Version}}
-X github.com/prometheus/common/version.Revision={{.Revision}}
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## main / unreleased

## 0.6.0 / 2023-10-30

* [CHANGE] Remove broken metrics collection #68
* [CHANGE] Remove use of cgroups #105
* [FEATURE] Add unit timestamp metrics #58

## 0.5.0 / 2022-07-20

Now released under the Prometheus Community
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.0
0.6.0
3 changes: 1 addition & 2 deletions examples/kubernetes/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ spec:
privileged: true
args:
- --log.level=info
- --path.procfs=/host/proc
- --collector.unit-whitelist=kubelet.service|docker.service
- --collector.unit-include=kubelet.service|docker.service
ports:
- name: metrics
containerPort: 9558
Expand Down
4 changes: 0 additions & 4 deletions scripts/errcheck_excludes.txt

This file was deleted.

4 changes: 2 additions & 2 deletions systemd/systemd.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func (c *Collector) collectUnit(conn *dbus.Conn, ch chan<- prometheus.Metric, un
logger := log.With(c.logger, "unit", unit.Name)

// Collect unit_state for all
err := c.collectUnitState(conn, ch, unit)
err := c.collectUnitState(ch, unit)
if err != nil {
level.Warn(logger).Log("msg", errUnitMetricsMsg, "err", err)
// TODO should we continue processing here?
Expand Down Expand Up @@ -352,7 +352,7 @@ func (c *Collector) collectUnit(conn *dbus.Conn, ch chan<- prometheus.Metric, un
return nil
}

func (c *Collector) collectUnitState(conn *dbus.Conn, ch chan<- prometheus.Metric, unit dbus.UnitStatus) error {
func (c *Collector) collectUnitState(ch chan<- prometheus.Metric, unit dbus.UnitStatus) error {
// TODO: wrap GetUnitTypePropertyString(
// serviceTypeProperty, err := conn.GetUnitTypeProperty(unit.Name, "Timer", "NextElapseUSecMonotonic")

Expand Down