Skip to content

Commit eb01156

Browse files
fix for panic with snmp exporter from the recent version upgrade (#6921)
* fix for panic with snmp exporter from the recent version upgrade Signed-off-by: erikbaranowski <[email protected]> --------- Signed-off-by: erikbaranowski <[email protected]>
1 parent ecfb3ed commit eb01156

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ Main (unreleased)
5050

5151
### Bugfixes
5252

53+
- Fix panic for `prometheus.exporter.snmp` and snmp_exporter integration
54+
introduced in v0.40.5 with a version upgrade. This was due to an
55+
uninitialized new metric for the exporter. (@erikbaranowski)
56+
5357
- Fix an issue where JSON string array elements were not parsed correctly in `loki.source.cloudflare`. (@thampiotr)
5458

5559
- Fix SSRF vulnerability in `faro.receiver` by disabling source map download. (@hainenber)

static/integrations/snmp_exporter/snmp_exporter.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,13 @@ func NewSNMPMetrics(reg prometheus.Registerer) collector.Metrics {
155155
Help: "Number of SNMP packet retries.",
156156
},
157157
),
158+
SNMPInflight: promauto.With(reg).NewGauge(
159+
prometheus.GaugeOpts{
160+
Namespace: namespace,
161+
Name: "request_in_flight",
162+
Help: "Current number of SNMP scrapes being requested.",
163+
},
164+
),
158165
}
159166
}
160167

0 commit comments

Comments
 (0)