-
Notifications
You must be signed in to change notification settings - Fork 641
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
snmp_packet stats are all zeros #950
Comments
I think the problem is that for every request, a brand new Registry is created and a brand new Collector put in it: I'm not entirely sure why it's done that way, but I'm guessing it's because But this means that c.metrics needs to be shared between |
Also, I notice that main.go declares some more metrics: AFAICS, these are intended to create metrics |
The fix to the latter problem is pretty straightforward:
However, it generates an explosion of NxM metrics, for every possible combination of auths and modules. In my case it's only 5 auths and 22 modules, which gives me 220 metrics (one sum and one count), but I don't think that will scale. I think the snmp_collection_duration_seconds metric overlaps with the new per-module stats that #945 is introducing, so could probably be dropped, although it does measure the total time of both scraping and emitting metrics. The snmp_request_errors_total is a single value, and refers to errors in the incoming HTTP request (missing or unknown target, auth, or module). It's reasonable to keep. |
Fixes prometheus#950 Signed-off-by: Brian Candler <[email protected]>
Fixes prometheus#950 Signed-off-by: Brian Candler <[email protected]>
Fixes prometheus#950 Signed-off-by: Brian Candler <[email protected]>
Fixes prometheus#950 Signed-off-by: Brian Candler <[email protected]>
Pass the default metrics register into the collector rather than the ephemeral register. This makes sure the internal metrics are preserved between scrapes. Fixes: #950 Signed-off-by: SuperQ <[email protected]>
Move exporter metric definitions and registration out of the collector package and into the main package. This fixes metrics always being empty due to the epehemeral collector registry. Fixes: #950 Signed-off-by: SuperQ <[email protected]>
Move exporter metric definitions and registration out of the collector package and into the main package. This fixes metrics always being empty due to the epehemeral collector registry. Fixes: #950 Signed-off-by: SuperQ <[email protected]>
Move exporter metric definitions and registration out of the collector package and into the main package. This fixes metrics always being empty due to the epehemeral collector registry. Fixes: #950 Signed-off-by: SuperQ <[email protected]>
These were fixed in the 0.24.0 release, but I think there are still some rough edges. Breaking changesThis wasn't called out in the release notes, but some metrics have (sensibly) moved from This includes the Cardinality of snmp_collection_duration_xxxThe
Can I suggest this be changed to grouping on just (Aside: I wonder if passing an explicit "class" scrape parameter, which defaults to the module name, might be a useful addition. You could then collect statistics specifically for a given target or group of targets. But the same effect could be achieved by simply duplicating a particular module under a different name) Error returnsIf there is a collection error, it appears that no message is returned over HTTP, nor is it logged (i.e. I thought it did before, although I could be mistaken. Here are two examples: Invalid module name
We get a 400 status code, but no message explaining the error. Modules with overlapping metricsHere, modules
Again, we get a 500 status code, but no error message. |
@candlerb Let's open separate new issues for those items. |
Move exporter metric definitions and registration out of the collector package and into the main package. This fixes metrics always being empty due to the epehemeral collector registry. Fixes: prometheus#950 Signed-off-by: SuperQ <[email protected]> Signed-off-by: Stephan Windischmann <[email protected]>
Host operating system: output of
uname -a
snmp_exporter version: output of
snmp_exporter -version
What device/snmpwalk OID are you using?
If this is a new device, please link to the MIB(s).
What did you do that produced an error?
Simple scrape (do it multiple times)
What did you expect to see?
The histogram snmp_packet_duration_seconds_bucket to increment; the counter snmp_packets_total to increment
(Note: these appear to be new. I tried with 0.21 and these metrics don't exist at all)
What did you see instead?
All metrics are zero, even after repeated scrapes:
The text was updated successfully, but these errors were encountered: