We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I was working on a new feature for the podman receiver and I noticed that if the containers stats API endpoint returns an error, the receiver panics:
2022-04-21T20:48:51.763+0200 error podmanreceiver@v0.49.0/receiver.go:80 error fetching stats {"kind": "receiver", "name": "podman_stats", "error": "json: cannot unmarshal object into Go struct field containerStatsReport.Error of type string"} github.com/open-telemetry/opentelemetry-collector-contrib/receiver/podmanreceiver.(*receiver).scrape github.com/open-telemetry/opentelemetry-collector-contrib/receiver/podmanreceiver@v0.49.0/receiver.go:80 go.opentelemetry.io/collector/receiver/scraperhelper.ScrapeFunc.Scrape go.opentelemetry.io/collector@v0.49.0/receiver/scraperhelper/scraper.go:32 go.opentelemetry.io/collector/receiver/scraperhelper.(*controller).scrapeMetricsAndReport go.opentelemetry.io/collector@v0.49.0/receiver/scraperhelper/scrapercontroller.go:195 go.opentelemetry.io/collector/receiver/scraperhelper.(*controller).startScraping.func1 go.opentelemetry.io/collector@v0.49.0/receiver/scraperhelper/scrapercontroller.go:173 2022-04-21T20:48:51.763+0200 error scraperhelper/scrapercontroller.go:198 Error scraping metrics {"kind": "receiver", "name": "podman_stats", "error": "json: cannot unmarshal object into Go struct field containerStatsReport.Error of type string", "scraper": "podman_stats"} go.opentelemetry.io/collector/receiver/scraperhelper.(*controller).scrapeMetricsAndReport go.opentelemetry.io/collector@v0.49.0/receiver/scraperhelper/scrapercontroller.go:198 go.opentelemetry.io/collector/receiver/scraperhelper.(*controller).startScraping.func1 go.opentelemetry.io/collector@v0.49.0/receiver/scraperhelper/scrapercontroller.go:173
The error is because the actual structure used to unmarshal the api response:
type containerStatsReport struct { Error string Stats []containerStats }
As the Podman API documentation describes, the Error is a structure with three attributes: https://docs.podman.io/en/latest/_static/api.html#operation/ContainersStatsAllLibpod
The text was updated successfully, but these errors were encountered:
rogercoll
No branches or pull requests
I was working on a new feature for the podman receiver and I noticed that if the containers stats API endpoint returns an error, the receiver panics:
The error is because the actual structure used to unmarshal the api response:
As the Podman API documentation describes, the Error is a structure with three attributes:
https://docs.podman.io/en/latest/_static/api.html#operation/ContainersStatsAllLibpod
The text was updated successfully, but these errors were encountered: