Skip to content

[Azure Monitor] Check if resp.Interval for armmonitor list api can be nil #43725

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

Open
MichaelKatsoulis opened this issue Apr 7, 2025 · 2 comments
Assignees
Labels
Team:obs-ds-hosted-services Label for the Observability Hosted Services team

Comments

@MichaelKatsoulis
Copy link
Contributor

In line


we are dereferencing the resp.Interval pointer to get the interval from the api response.

We do not check if the pointer is not nil.
An error reported from a client:

"error": {
       "message": "runtime error: invalid memory address or nil pointer dereference"
   },
   "stack": "github.com/elastic/elastic-agent-libs/logp.Recover\n\tgithub.xingqwq.cn/elastic/elastic-agent-libs@v0.17.4/logp/global.go:101\nruntime.gopanic\n\truntime/panic.go:770\nruntime.panicmem\n\truntime/panic.go:261\nruntime.sigpanic\n\truntime/signal_unix.go:881\ngithub.xingqwq.cn/elastic/beats/v7/x-pack/metricbeat/module/azure.(*MonitorService).GetMetricValues\n\tgithub.xingqwq.cn/elastic/beats/v7/x-pack/metricbeat/module/azure/monitor_service.go:322\ngithub.xingqwq.cn/elastic/beats/v7/x-pack/metricbeat/module/azure.(*Client).GetMetricValues\n\tgithub.xingqwq.cn/elastic/beats/v7/x-pack/metricbeat/module/azure/client.go:240\ngithub.xingqwq.cn/elastic/beats/v7/x-pack/metricbeat/module/azure.(*MetricSet).Fetch\n\tgithub.xingqwq.cn/elastic/beats/v7/x-pack/metricbeat/module/azure/azure.go:136\ngithub.xingqwq.cn/elastic/beats/v7/metricbeat/mb/module.(*metricSetWrapper).fetch\n\tgithub.xingqwq.cn/elastic/beats/v7/metricbeat/mb/module/wrapper.go:279\ngithub.xingqwq.cn/elastic/beats/v7/metricbeat/mb/module.(*metricSetWrapper).startPeriodicFetching\n\tgithub.xingqwq.cn/elastic/beats/v7/metricbeat/mb/module/wrapper.go:261\ngithub.xingqwq.cn/elastic/beats/v7/metricbeat/mb/module.(*metricSetWrapper).run\n\tgithub.xingqwq.cn/elastic/beats/v7/metricbeat/mb/module/wrapper.go:235\ngithub.xingqwq.cn/elastic/beats/v7/metricbeat/mb/module.(*Wrapper).Start.func1\n\tgithub.xingqwq.cn/elastic/beats/v7/metricbeat/mb/module/wrapper.go:175",
   "ecs.version": "1.6.0"
}
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Apr 7, 2025
@MichaelKatsoulis MichaelKatsoulis self-assigned this Apr 14, 2025
@MichaelKatsoulis MichaelKatsoulis added the Team:obs-ds-hosted-services Label for the Observability Hosted Services team label Apr 14, 2025
@elasticmachine
Copy link
Collaborator

Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Apr 14, 2025
@MichaelKatsoulis
Copy link
Contributor Author

Can be handled together with #43885

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:obs-ds-hosted-services Label for the Observability Hosted Services team
Projects
None yet
Development

No branches or pull requests

2 participants