There is an error with this alloy doc for snmp. The line
targets = encoding.from_yaml(local.file.targets.content)
is wrong. encoding.from_yaml does not return an array ( as you can see from here), which is what targets expect. Instead, file based discovery should be used here.
URL
https://grafana.com/docs/alloy/latest/reference/components/prometheus/prometheus.exporter.snmp/
Feedback
Slack discussion: https://raintank-corp.slack.com/archives/C5PG2JK8W/p1730395307519059
There is an error with this alloy doc for snmp. The line
targets = encoding.from_yaml(local.file.targets.content)
is wrong. encoding.from_yaml does not return an array ( as you can see from here), which is what targets expect. Instead, file based discovery should be used here.