-
Notifications
You must be signed in to change notification settings - Fork 246
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
feat(prom/exp/snmp): add support to pass multiple SNMP config files to prometheus.exporter.snmp
#967
base: main
Are you sure you want to change the base?
feat(prom/exp/snmp): add support to pass multiple SNMP config files to prometheus.exporter.snmp
#967
Changes from all commits
2bcc1dd
8451c20
3cf397c
af0abae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,6 +113,7 @@ func (w WalkParams) Convert() map[string]snmp_config.WalkParams { | |
|
||
type Arguments struct { | ||
ConfigFile string `alloy:"config_file,attr,optional"` | ||
ConfigFiles []string `alloy:"config_files,attr,optional"` | ||
Config alloytypes.OptionalSecret `alloy:"config,attr,optional"` | ||
Targets TargetBlock `alloy:"target,block"` | ||
WalkParams WalkParams `alloy:"walk_param,block,optional"` | ||
|
@@ -141,9 +142,10 @@ func (a *Arguments) UnmarshalAlloy(f func(interface{}) error) error { | |
// Convert converts the component's Arguments to the integration's Config. | ||
func (a *Arguments) Convert() *snmp_exporter.Config { | ||
return &snmp_exporter.Config{ | ||
SnmpConfigFile: a.ConfigFile, | ||
SnmpTargets: a.Targets.Convert(), | ||
WalkParams: a.WalkParams.Convert(), | ||
SnmpConfig: a.ConfigStruct, | ||
SnmpConfigFile: a.ConfigFile, | ||
SnmpConfigFiles: a.ConfigFiles, | ||
Comment on lines
+145
to
+146
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It'd be simpler if we return an error if both |
||
SnmpTargets: a.Targets.Convert(), | ||
WalkParams: a.WalkParams.Convert(), | ||
SnmpConfig: a.ConfigStruct, | ||
} | ||
} |
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.