open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
2.73k stars 2.16k forks source link

Support SNMP Traps in snmp receiver #32358

Open hughesjj opened 2 months ago

hughesjj commented 2 months ago

Component(s)

receiver/snmp

Is your feature request related to a problem? Please describe.

We have customers who wish to use receive messages from SNMP traps

I see a reference to supporting snmp trap ingestion in the syslog receiver, but figured native snmp trap support may make more sense here (or, at least, point a user to docs in syslog receiver if not/in the short term)

Describe the solution you'd like

Support rfc1215 in this receiver (or maybe a bespoke snmptrap receiver)

Describe alternatives you've considered

Using syslog receiver, assuming it supports traps like the exporter claims to

Additional context

Some results from the top of my search engine for background context:

Additional RFCs which are useful

github-actions[bot] commented 2 months ago

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

alexraddas commented 2 months ago

Component(s)

receiver/snmp

Is your feature request related to a problem? Please describe.

We have customers who wish to use receive messages from SNMP traps

I see a reference to supporting snmp trap ingestion in the syslog receiver, but figured native snmp trap support may make more sense here (or, at least, point a user to docs in syslog receiver if not/in the short term)

Describe the solution you'd like

Support rfc1215 in this receiver (or maybe a bespoke snmptrap receiver)

Describe alternatives you've considered

Using syslog receiver, assuming it supports traps like the exporter claims to

Additional context

Some results from the top of my search engine for background context:

Additional RFCs which are useful

You might have a look at this open source solution from kentik https://github.com/kentik/ktranslate, they just added OTEL support. It provides SNMP traps/polling and includes device profiling to determine which MIBs are supported based on sysOID.

hughesjj commented 2 months ago

Thanks for the suggestion + information Alex! I'll note that we're currently using gosnmp, which has support for traps but possibly only snmpv2 traps.

That said, after thinking about it more, a new snmptrap receiver might make more sense that combining with this one, so I wouldn't worry too much about prior art.

i3149 commented 2 months ago

ktranslate author here. gosnmp does support v3 traps, highly recommend the library. This said, pulling packets off the wire is not even half the battle. The value add is around supporting secure ways to provide snmp credentials to the process and mapping from oid keys to human readable names.

Traps are naturally events but otel doesn't do events so I'm debating whether to map traps received as logs or a trace. Happy to team up / share code if there's interest.

cwegener commented 2 months ago

but otel doesn't do events

Could you elaborate on this. Are you referring to the lack of distinction between Events and Logs in the OTEL spec?

i3149 commented 2 months ago

but otel doesn't do events

Could you elaborate on this. Are you referring to the lack of distinction between Events and Logs in the OTEL spec?

Mostly I'm talking about the non 1.0 state of the golang API. Also yes, logs/events being run together.

github-actions[bot] commented 2 weeks ago

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.