-
Notifications
You must be signed in to change notification settings - Fork 634
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
Add support for parsing SNMP transport from target #914
Conversation
* Syntax: `[transport://]host[:port]` Signed-off-by: Hugo Hromic <[email protected]>
Signed-off-by: Hugo Hromic <[email protected]>
Signed-off-by: Hugo Hromic <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, thanks.
@RichiH Any comments on the syntax here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remain torn on "URL via SD" vs "config", but have come to accept that URL is probably Least Bad overall.
Feature itself is very nice, even though I have never needed it myself.
I suspect some tests are missing, see comment. Other than that, LGTM.
As a further argument, take as an example the approach from the blackbox exporter: scrape_configs:
- job_name: 'blackbox'
metrics_path: /probe
params:
module: [http_2xx] # Look for a HTTP 200 response.
static_configs:
- targets:
- http://prometheus.io # Target to probe with http.
- https://prometheus.io # Target to probe with https.
- http://example.com:8080 # Target to probe with http on port 8080.
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 127.0.0.1:9115 # The blackbox exporter's real hostname:port. As you can see, the targets contain the scheme ( |
Yes, thinking about blackbox_exporter yesterday night is what made me flip over to URL scheme. I had a whole thing written on why config is slightly preferable, but... I was wrong and didn't send it :) |
I now added an example SNMP device via TCP for Prometheus to the README file as well. |
Signed-off-by: Hugo Hromic <[email protected]>
Signed-off-by: Hugo Hromic <[email protected]>
I still think config is slightly preferable. But I also don't object to this format. |
I still don't see how that would work :). The transport is a simple property of each target, like the port number to use, independent of the auth or module used. In the same way insecure or secure HTTP (the scheme) is a property of an URL. In any case, thanks for merging this contribution! |
It would simply be a property of either the auth or module, like the SNMP version or the walk params (max_repititions, etc). Which is also part of the "Transport" IMO. The thing is, the |
Ah I see, yes seems closer to snmp_exporter/config/config.go Lines 77 to 83 in 03bc586
I always have seen The same could be argued about timeouts and retries even. In my humble opinion, most of these walk params are more a specific target-related set of properties than the class of the target (module). Especially when changing those. For example, if we want a different transport or timeout for the same device, we would have to modify the huge |
BREAKING CHANGES: This version of the exporter introduces a new configuration file format. This new format separates the walk and metric mappings from the connection and authentication settings. This allows for easier configuration of different auth params without having to duplicate the full walk and metric mapping. See auth-split-migration.md for more details. * [CHANGE] Split config of auth and modules #859 * [FEATURE] Improved Lookup process for label information #908 * [ENHANCEMENT] Add support for parsing SNMP transport from target #914 * [BUGFIX] Fix metrics path not using command-line argument value #904 Signed-off-by: SuperQ <[email protected]>
BREAKING CHANGES: This version of the exporter introduces a new configuration file format. This new format separates the walk and metric mappings from the connection and authentication settings. This allows for easier configuration of different auth params without having to duplicate the full walk and metric mapping. See auth-split-migration.md for more details. * [CHANGE] Split config of auth and modules #859 * [FEATURE] Improved Lookup process for label information #908 * [ENHANCEMENT] Add support for parsing SNMP transport from target #914 * [BUGFIX] Fix metrics path not using command-line argument value #904 Signed-off-by: SuperQ <[email protected]>
BREAKING CHANGES: This version of the exporter introduces a new configuration file format. This new format separates the walk and metric mappings from the connection and authentication settings. This allows for easier configuration of different auth params without having to duplicate the full walk and metric mapping. See auth-split-migration.md for more details. * [CHANGE] Split config of auth and modules #859 * [FEATURE] Add support for parsing SNMP transport from target #914 * [ENHANCEMENT] Improved Lookup process for label information #908 * [BUGFIX] Fix metrics path not using command-line argument value #904 Signed-off-by: SuperQ <[email protected]>
BREAKING CHANGES: This version of the exporter introduces a new configuration file format. This new format separates the walk and metric mappings from the connection and authentication settings. This allows for easier configuration of different auth params without having to duplicate the full walk and metric mapping. See auth-split-migration.md for more details. * [CHANGE] Split config of auth and modules #859 * [FEATURE] Add support for parsing SNMP transport from target #914 * [ENHANCEMENT] Improved Lookup process for label information #908 * [BUGFIX] Fix metrics path not using command-line argument value #904 Signed-off-by: SuperQ <[email protected]>
BREAKING CHANGES: This version of the exporter introduces a new configuration file format. This new format separates the walk and metric mappings from the connection and authentication settings. This allows for easier configuration of different auth params without having to duplicate the full walk and metric mapping. See auth-split-migration.md for more details. * [CHANGE] Split config of auth and modules #859 * [FEATURE] Add support for parsing SNMP transport from target #914 * [ENHANCEMENT] Improved Lookup process for label information #908 * [BUGFIX] Fix metrics path not using command-line argument value #904 Signed-off-by: SuperQ <[email protected]>
BREAKING CHANGES: This version of the exporter introduces a new configuration file format. This new format separates the walk and metric mappings from the connection and authentication settings. This allows for easier configuration of different auth params without having to duplicate the full walk and metric mapping. See auth-split-migration.md for more details. * [CHANGE] Split config of auth and modules #859 * [FEATURE] Add support for parsing SNMP transport from target #914 * [ENHANCEMENT] Improved Lookup process for label information #908 * [BUGFIX] Fix metrics path not using command-line argument value #904 Signed-off-by: SuperQ <[email protected]>
* Release v0.23.0 BREAKING CHANGES: This version of the exporter introduces a new configuration file format. This new format separates the walk and metric mappings from the connection and authentication settings. This allows for easier configuration of different auth params without having to duplicate the full walk and metric mapping. See auth-split-migration.md for more details. * [CHANGE] Split config of auth and modules #859 * [FEATURE] Add support for parsing SNMP transport from target #914 * [ENHANCEMENT] Improved Lookup process for label information #908 * [BUGFIX] Fix metrics path not using command-line argument value #904 Signed-off-by: SuperQ <[email protected]> * Lint dashboards Update dashboards to latest mixin linting. Signed-off-by: SuperQ <[email protected]> --------- Signed-off-by: SuperQ <[email protected]>
* Add support for parsing SNMP transport from target * Syntax: `[transport://]host[:port]` --------- Signed-off-by: Hugo Hromic <[email protected]> Signed-off-by: Stephan Windischmann <[email protected]>
BREAKING CHANGES: This version of the exporter introduces a new configuration file format. This new format separates the walk and metric mappings from the connection and authentication settings. This allows for easier configuration of different auth params without having to duplicate the full walk and metric mapping. See auth-split-migration.md for more details. * [CHANGE] Split config of auth and modules prometheus#859 * [FEATURE] Add support for parsing SNMP transport from target prometheus#914 * [ENHANCEMENT] Improved Lookup process for label information prometheus#908 * [BUGFIX] Fix metrics path not using command-line argument value prometheus#904 Signed-off-by: SuperQ <[email protected]> Signed-off-by: Stephan Windischmann <[email protected]>
* Release v0.23.0 BREAKING CHANGES: This version of the exporter introduces a new configuration file format. This new format separates the walk and metric mappings from the connection and authentication settings. This allows for easier configuration of different auth params without having to duplicate the full walk and metric mapping. See auth-split-migration.md for more details. * [CHANGE] Split config of auth and modules prometheus#859 * [FEATURE] Add support for parsing SNMP transport from target prometheus#914 * [ENHANCEMENT] Improved Lookup process for label information prometheus#908 * [BUGFIX] Fix metrics path not using command-line argument value prometheus#904 Signed-off-by: SuperQ <[email protected]> * Lint dashboards Update dashboards to latest mixin linting. Signed-off-by: SuperQ <[email protected]> --------- Signed-off-by: SuperQ <[email protected]> Signed-off-by: Stephan Windischmann <[email protected]>
This PR implements support for parsing the SNMP transport to use from the
target
query parameter.target
:[transport://]host[:port]
gosnmp.GoSNMP
instance from a parsedtarget
string.transport://
is not provided,Transport
is left unconfigured and GoSNMP defaults toudp
.Target
andPort
in GoSNMP is left as it was in the original implementation.target
parameter in README that includes transport support.I tested connectivity as well. The snmp exporter can now connect via TCP to an SNMP server.
Closes #555