Skip to content

Conversation

@paulojmdias
Copy link
Member

@paulojmdias paulojmdias commented Aug 13, 2025

Description

This PR introduces a new resource detection processor for OpenStack Nova, similar to the existing AWS EC2 and GCP GCE detectors.
It uses the Nova instance metadata service to populate standard cloud.* and host.* attributes, and optionally captures selected meta labels as resource attributes based on user-defined regex filters.

Despite the current semantic convention discussion in open-telemetry/semantic-conventions#2622, I made this PR ready for review for the code and discussed improvements. So when this PR was marked ready for review, the following values were set hardcoded temporarily.

d.rb.SetCloudProvider("openstack")
d.rb.SetCloudPlatform("openstack_nova")

Link to tracking issue

Fixes #39117

Testing

I tested against OpenStack instances, and the output was the expected.

Resource attributes:
     -> host.type: Str(REDACTED)
     -> cloud.provider: Str(openstack)
     -> cloud.platform: Str(openstack_nova)
     -> cloud.account.id: Str(REDACTED)
     -> cloud.availability_zone: Str(REDACTED)
     -> host.id: Str(680a44a7-a2f1-40bc-9b19-6f6ad9592290)
     -> host.name: Str(instance01)
     -> openstack.nova.meta.key1: Str(value1)
     -> openstack.nova.meta.key2: Str(value2)

I also added tests to cover all the cases. If I'm missing something, please let me know.

Documentation

Added documentation for how to enable the detection for nova and also the docs generated with mdatagen.

…ection processor

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
paulojmdias and others added 4 commits August 13, 2025 13:48
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
@paulojmdias paulojmdias marked this pull request as ready for review August 13, 2025 20:55
@paulojmdias paulojmdias requested review from a team and dashpole as code owners August 13, 2025 20:55
@github-actions github-actions bot requested a review from Aneurysm9 August 13, 2025 20:55
@atoulme
Copy link
Contributor

atoulme commented Aug 18, 2025

@paulojmdias would you like to become the codeowner of this code path? We will need your expertise to maintain this code.

@paulojmdias
Copy link
Member Author

@atoulme sure yes 🙏

I appreciate the invite and I really want to continue helping the community 🙌

@atoulme
Copy link
Contributor

atoulme commented Aug 18, 2025

@atoulme sure yes 🙏

I appreciate the invite and I really want to continue helping the community 🙌

I am pinging you on the CNCF slack with instructions.

@github-actions
Copy link
Contributor

github-actions bot commented Sep 2, 2025

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Sep 2, 2025
@paulojmdias
Copy link
Member Author

/label never-stale -stale

@github-actions github-actions bot removed the Stale label Sep 3, 2025
…-contrib into feat/39117

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
…-contrib into feat/39117

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
@paulojmdias
Copy link
Member Author

I added myself as a code owner, together with the parent codeowners of resourcedetectionprocessor.

@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Sep 23, 2025
@paulojmdias
Copy link
Member Author

/label -stale never-stale

@github-actions github-actions bot removed the Stale label Sep 24, 2025
…-contrib into feat/39117

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
@paulojmdias
Copy link
Member Author

@dashpole @atoulme I already rebased the branch and removed @Aneurysm9 from the code owners of this detector.

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
@atoulme atoulme added the ready to merge Code review completed; ready to merge by maintainers label Oct 7, 2025
@atoulme atoulme merged commit 2479f24 into open-telemetry:main Oct 7, 2025
202 of 203 checks passed
@github-actions github-actions bot added this to the next release milestone Oct 7, 2025
@paulojmdias paulojmdias deleted the feat/39117 branch October 7, 2025 06:25
mashhurs pushed a commit to mashhurs/opentelemetry-collector-contrib that referenced this pull request Oct 9, 2025
…ection processor (open-telemetry#41973)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

This PR introduces a new resource detection processor for OpenStack
Nova, similar to the existing AWS EC2 and GCP GCE detectors.
It uses the Nova instance metadata service to populate standard
`cloud.*` and `host.*` attributes, and optionally captures selected meta
labels as resource attributes based on user-defined regex filters.

Despite the current semantic convention discussion in
open-telemetry/semantic-conventions#2622, I made
this PR ready for review for the code and discussed improvements. So
when this PR was marked ready for review, the following values were set
hardcoded temporarily.

```go
d.rb.SetCloudProvider("openstack")
d.rb.SetCloudPlatform("openstack_nova")
```

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#39117 

<!--Describe what testing was performed and which tests were added.-->
#### Testing
I tested against OpenStack instances, and the output was the expected.

```sh
Resource attributes:
     -> host.type: Str(REDACTED)
     -> cloud.provider: Str(openstack)
     -> cloud.platform: Str(openstack_nova)
     -> cloud.account.id: Str(REDACTED)
     -> cloud.availability_zone: Str(REDACTED)
     -> host.id: Str(680a44a7-a2f1-40bc-9b19-6f6ad9592290)
     -> host.name: Str(instance01)
     -> openstack.nova.meta.key1: Str(value1)
     -> openstack.nova.meta.key2: Str(value2)
```

I also added tests to cover all the cases. If I'm missing something,
please let me know.

<!--Describe the documentation added.-->
#### Documentation
Added documentation for how to enable the detection for `nova` and also
the docs generated with `mdatagen`.
<!--Please delete paragraphs that you did not use before submitting.-->

---------

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Co-authored-by: Antoine Toulme <atoulme@splunk.com>
tommyers-elastic pushed a commit to tommyers-elastic/opentelemetry-collector-contrib that referenced this pull request Oct 10, 2025
…ection processor (open-telemetry#41973)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

This PR introduces a new resource detection processor for OpenStack
Nova, similar to the existing AWS EC2 and GCP GCE detectors.
It uses the Nova instance metadata service to populate standard
`cloud.*` and `host.*` attributes, and optionally captures selected meta
labels as resource attributes based on user-defined regex filters.

Despite the current semantic convention discussion in
open-telemetry/semantic-conventions#2622, I made
this PR ready for review for the code and discussed improvements. So
when this PR was marked ready for review, the following values were set
hardcoded temporarily.

```go
d.rb.SetCloudProvider("openstack")
d.rb.SetCloudPlatform("openstack_nova")
```

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes open-telemetry#39117 

<!--Describe what testing was performed and which tests were added.-->
#### Testing
I tested against OpenStack instances, and the output was the expected.

```sh
Resource attributes:
     -> host.type: Str(REDACTED)
     -> cloud.provider: Str(openstack)
     -> cloud.platform: Str(openstack_nova)
     -> cloud.account.id: Str(REDACTED)
     -> cloud.availability_zone: Str(REDACTED)
     -> host.id: Str(680a44a7-a2f1-40bc-9b19-6f6ad9592290)
     -> host.name: Str(instance01)
     -> openstack.nova.meta.key1: Str(value1)
     -> openstack.nova.meta.key2: Str(value2)
```

I also added tests to cover all the cases. If I'm missing something,
please let me know.

<!--Describe the documentation added.-->
#### Documentation
Added documentation for how to enable the detection for `nova` and also
the docs generated with `mdatagen`.
<!--Please delete paragraphs that you did not use before submitting.-->

---------

Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Co-authored-by: Antoine Toulme <atoulme@splunk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal/metadataproviders processor/resourcedetection Resource detection processor ready to merge Code review completed; ready to merge by maintainers waiting-for-code-owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Openstack to resourcedetection processor

4 participants