Skip to content

Commit 86e17a7

Browse files
fix for panic in prometheus.exporter.snmp from the recent version upgrade (#900)
Signed-off-by: erikbaranowski <39704712+erikbaranowski@users.noreply.github.com>
1 parent 8afa972 commit 86e17a7

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

‎CHANGELOG.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ Main (unreleased)
2424

2525
### Bugfixes
2626

27+
- Fix panic for `prometheus.exporter.snmp` introduced in v1.1 with a version upgrade.
28+
This was due to an uninitialized new metric for the exporter. (@erikbaranowski)
29+
2730
- Fix panic when component ID contains `/` in `otelcomponent.MustNewType(ID)`.(@qclaogui)
2831

2932
- Fixed an issue with `prometheus.scrape` in which targets that move from one

‎internal/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.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)