Skip to content

Commit

Permalink
Bump snmp_exporter and modules to v0.28.0 (#2830)
Browse files Browse the repository at this point in the history
* Update go.mod

* add generate-snmp target

* Update comment

* Fix makefile

* Update snmp to v0.28.0

* Update comment

* Update changelog

* Update

* Update test

* Fix int test

* Update expected modules count

* Use gotemplate

* Add comment

* Update comment

* Update snmp.yml.gz
  • Loading branch information
v-zhuravlev authored Mar 6, 2025
1 parent 0a02315 commit 090f9c8
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 42,945 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Main (unreleased)
- Add livedebugging support for `prometheus.scrape` (@ravishankar15, @wildum)

- Have `loki.echo` log the `entry_timestamp` and `structured_metadata` for any loki entries received (@dehaansa)
- Bump snmp_exporter and embedded modules in `prometheus.exporter.snmp` to v0.28.0 (@v-zhuravlev)


- Update mysqld_exporter to v0.17.2, most notable changes: (@cristiangreco)
- [0.17.1] Add perf_schema quantile columns to collector
Expand Down
17 changes: 15 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
## generate-ui Generate the UI assets.
## generate-versioned-files Generate versioned files.
## generate-winmanifest Generate the Windows application manifest.
## generate-snmp Generate SNMP modules from prometheus/snmp_exporter for prometheus.exporter.snmp and bumps SNMP version in _index.md.t.
##
## Other targets:
##
Expand Down Expand Up @@ -211,8 +212,8 @@ alloy-image-windows:
# Targets for generating assets
#

.PHONY: generate generate-drone generate-helm-docs generate-helm-tests generate-ui generate-versioned-files generate-winmanifest
generate: generate-drone generate-helm-docs generate-helm-tests generate-ui generate-versioned-files generate-docs generate-winmanifest
.PHONY: generate generate-drone generate-helm-docs generate-helm-tests generate-ui generate-versioned-files generate-winmanifest generate-snmp
generate: generate-drone generate-helm-docs generate-helm-tests generate-ui generate-versioned-files generate-docs generate-winmanifest generate-snmp

generate-drone:
drone jsonnet -V BUILD_IMAGE_VERSION=$(BUILD_IMAGE_VERSION) --stream --format --source .drone/drone.jsonnet --target .drone/drone.yml
Expand Down Expand Up @@ -258,6 +259,18 @@ ifeq ($(USE_CONTAINER),1)
else
go generate ./internal/winmanifest
endif

generate-snmp:
ifeq ($(USE_CONTAINER),1)
$(RERUN_IN_CONTAINER)
else
# Fetch snmp.yml file of the same version as the snmp_exporter go module, use sed to update the file we need to fetch in common.go:
@LATEST_SNMP_VERSION=$$(go list -f '{{ .Version }}' -m github.com/prometheus/snmp_exporter); \
sed -i "s|snmp_exporter/[^/]*/snmp.yml|snmp_exporter/$$LATEST_SNMP_VERSION/snmp.yml|" internal/static/integrations/snmp_exporter/common/common.go; \
go generate ./internal/static/integrations/snmp_exporter/common; \
sed -i "s/SNMP_VERSION: v[0-9]\+\.[0-9]\+\.[0-9]\+/SNMP_VERSION: $$LATEST_SNMP_VERSION/" docs/sources/_index.md.t
endif

#
# Other targets
#
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cascade:
ALLOY_RELEASE: v1.8.0
OTEL_VERSION: v0.119.0
PROM_WIN_EXP_VERSION: v0.27.3
SNMP_VERSION: v0.27.0
SNMP_VERSION: v0.28.0
FULL_PRODUCT_NAME: Grafana Alloy
PRODUCT_NAME: Alloy
hero:
Expand Down
2 changes: 1 addition & 1 deletion docs/sources/_index.md.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cascade:
ALLOY_RELEASE: $ALLOY_VERSION
OTEL_VERSION: v0.119.0
PROM_WIN_EXP_VERSION: v0.27.3
SNMP_VERSION: v0.27.0
SNMP_VERSION: v0.28.0
FULL_PRODUCT_NAME: Grafana Alloy
PRODUCT_NAME: Alloy
hero:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ require (
github.com/prometheus/node_exporter v1.6.0
github.com/prometheus/procfs v0.15.1
github.com/prometheus/prometheus v0.55.1 // replaced by a fork of v2.54.1 further down this file
github.com/prometheus/snmp_exporter v0.27.0 // if you update the snmp_exporter version, make sure to update the SNMP_VERSION in _index
github.com/prometheus/snmp_exporter v0.28.0 // if you update the snmp_exporter version, make sure to update the SNMP_VERSION in _index
github.com/prometheus/statsd_exporter v0.22.8
github.com/richardartoul/molecule v1.0.1-0.20221107223329-32cfee06a052
github.com/rogpeppe/go-internal v1.13.1
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2333,6 +2333,8 @@ github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/prometheus/snmp_exporter v0.27.0 h1:ZQDMq/bXZnl6azn6EhZg6YTX8+Bzwm520Wg0KNJG8J8=
github.com/prometheus/snmp_exporter v0.27.0/go.mod h1:rxdBALtsEnTVlnvdgUKvCTrs6cS35W3NGlxKEumK3Ww=
github.com/prometheus/snmp_exporter v0.28.0 h1:ZrDctRWvKbSCQWumlDAuVDI410yV1+B5w0L+cUDU+oE=
github.com/prometheus/snmp_exporter v0.28.0/go.mod h1:XRoxh0SCElY79wIhQM3KCicJjaK1321HBTVp5Q6Fcpk=
github.com/prometheus/statsd_exporter v0.22.8 h1:Qo2D9ZzaQG+id9i5NYNGmbf1aa/KxKbB9aKfMS+Yib0=
github.com/prometheus/statsd_exporter v0.22.8/go.mod h1:/DzwbTEaFTE0Ojz5PqcSk6+PFHOPWGxdXVr6yC8eFOM=
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
Expand Down
6 changes: 3 additions & 3 deletions internal/cmd/integration-tests/tests/snmp/config.alloy
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ modules:
oid: 1.3.6.1.2.1.1.1.0
type: DisplayString
help: "A textual description of the entity."
hrDevice:
hrDeviceForTest:
walk:
- 1.3.6.1.2.1.25.3
metrics:
Expand All @@ -127,13 +127,13 @@ modules:
type: gauge
help: A unique value for each device contained by the host - 1.3.6.1.2.1.25.3.2.1.1
indexes:
- labelname: hrDeviceIndex
- labelname: hrDevice
type: gauge
`
concurrency = 2
target "t1" {
address = "localhost:161"
module = "default,hrDevice"
module = "default,hrDeviceForTest"
auth = "public_v2"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestSNMPMetrics(t *testing.T) {
"snmp_scrape_walk_duration_seconds",
"snmp_unexpected_pdu_type_total",
"sysDescr",
"hrDeviceIndex",
"hrDeviceID",
"up",
}
common.MimirMetricsTest(t, SNMPMetrics, []string{}, "snmp_metrics")
Expand Down
4 changes: 2 additions & 2 deletions internal/static/integrations/snmp_exporter/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"gopkg.in/yaml.v2"
)

//go:generate curl https://raw.githubusercontent.com/prometheus/snmp_exporter/main/snmp.yml --output snmp.yml
//go:generate gzip -9 snmp.yml
//go:generate curl -s https://raw.githubusercontent.com/prometheus/snmp_exporter/v0.28.0/snmp.yml --output snmp.yml
//go:generate gzip -9 -f snmp.yml
//go:embed snmp.yml.gz
var content []byte

Expand Down
Loading

0 comments on commit 090f9c8

Please sign in to comment.