Skip to content
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

Counter64 not a supported type #23897

Closed
bobbled opened this issue Jul 3, 2023 · 6 comments
Closed

Counter64 not a supported type #23897

bobbled opened this issue Jul 3, 2023 · 6 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed receiver/snmp

Comments

@bobbled
Copy link

bobbled commented Jul 3, 2023

Component(s)

receiver/snmp

What happened?

Description

snmpreceiver does not support collecting counter64 values.

Steps to Reproduce

Attempt to collect counter64 values with snmpreceiver.

Expected Result

counter64 objects are handled as int's and passed through the pipeline.

Actual Result

counter64 objects are treated as unsupported types.

Collector version

0.80.0

Environment information

Environment

OS: Ubuntu 20.04 (kubernetes)

OpenTelemetry Collector configuration

receivers:
  snmp/test:
    endpoint: udp://10.1.1.1:161
    version: v2c
    community: public
    metrics:
      ipSystemStatsHCInReceives:
        unit: "By"
        sum:
          aggregation: cumulative
          monotonic: false
          value_type: int
        scalar_oids:
          - oid: "1.3.6.1.2.1.4.31.1.1.4.1"
exporters:
  logging:
    loglevel: debug
service:
  telemetry:
    logs:
      level: debug
  pipelines:
    metrics:
      receivers: [snmp/test]
      processors: []
      exporters: [logging]

Log output

2023-07-03T16:04:48.309Z    error    scraperhelper/scrapercontroller.go:213    Error scraping metrics    {"kind": "receiver", "name": "snmp/test", "data_type": "metrics", "error": "problem with getting scalar data: data for OID '.1.3.6.1.2.1.4.31.1.1.4.1' not a supported type", "scraper": "snmp"}
go.opentelemetry.io/collector/receiver/scraperhelper.(*controller).scrapeMetricsAndReport
    go.opentelemetry.io/collector/receiver@v0.80.0/scraperhelper/scrapercontroller.go:213
go.opentelemetry.io/collector/receiver/scraperhelper.(*controller).startScraping.func1
go.opentelemetry.io/collector/receiver@v0.80.0/scraperhelper/scrapercontroller.go:192

Additional context

This may have been left out deliberately for some reason I can't see. It looks like it may have been an oversight, however.

The relevant line in the snmp receiver that lacks counter64 support.

The gosnmp const.

@bobbled bobbled added bug Something isn't working needs triage New item requiring triage labels Jul 3, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2023

Pinging code owners:

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

@djaglowski djaglowski added enhancement New feature or request help wanted Extra attention is needed and removed needs triage New item requiring triage bug Something isn't working labels Jul 5, 2023
@technimad-splunk
Copy link
Contributor

technimad-splunk commented Aug 25, 2023

Could a solution be to add gosnmp.Counter64 to the line like this:

        case gosnmp.Counter64, gosnmp.Counter32, gosnmp.Gauge32, gosnmp.Uinteger32, gosnmp.TimeTicks, gosnmp.Integer:

?

We cast to an int 64 in the next line anyway:

                value, err := c.toInt64(pdu.Name, pdu.Value)

@djaglowski
Copy link
Member

@technimad-splunk, can I assign this to you?

@technimad-splunk
Copy link
Contributor

@djaglowski Ok. I'll give it a go!

@technimad-splunk
Copy link
Contributor

@bobbled with these PR's merged I believe this issue can be closed. Can you agree and close the issue?

@bobbled
Copy link
Author

bobbled commented Oct 24, 2023

@technimad-splunk, yes thank you!

@bobbled bobbled closed this as completed Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed receiver/snmp
Projects
None yet
Development

No branches or pull requests

3 participants