[Backport 7.56.x] Fixed the heat endpoint for the Openstack Controller #18104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport 5139e97 from #17996.
What does this PR do?
We noticed that the heat stacks weren't being discovered in the Openstack Controller integration:
2024-07-03 15:55:34 UTC | CORE | DEBUG | (pkg/collector/python/datadog_agent.go:133 in LogMessage) | - | (connectionpool.py:474) | [http://10.164.0.33:80](http://10.164.0.33/) "GET /heat-api/v1/***************************87d1e/v1/***************************87d1e/stacks HTTP/1.1" 404 154 2024-07-03 15:55:34 UTC | CORE | ERROR | (pkg/collector/python/datadog_agent.go:127 in LogMessage) | openstack_controller:92e51db26f99a1e5 | (component.py:79) | HTTPError: <Response [404]>
When reading the API documentation for heat (https://docs.openstack.org/api-ref/orchestration/v1/), there is no endpoint for /v1 or /v1/{tenant_id}.
So looking at how we get the endpoint in https://github.com/DataDog/integrations-core/blob/master/openstack_controller/datadog_checks/openstack_controller/api/api_rest.py#L34, either the project_id can be removed (causing /v1 to be made the endpoint) or the project_id can be kept (causing /v1/{tenant_id} to be the endpoint).
As such, a specific edge case needed to be added for generating the endpoint for the heat component.
Motivation
Additional Notes
Review checklist (to be filled by reviewers)
qa/skip-qa
label if the PR doesn't need to be tested during QA.backport/<branch-name>
label to the PR and it will automatically open a backport PR once this one is merged