Commit adbd65e
authored
[processor/resourcedetection] Add support for hetzner cloud (#42477)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
This PR adds support for resource detection in Hetzner Cloud.
I have not added the Hetzner cloud into semantic conventions, but I can
open a PR for it.
<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Fixes #42476
<!--Describe what testing was performed and which tests were added.-->
#### Testing
Added tests to cover most of the cases, and I personally tested on a
Hetzner server.
```
2025-09-03T17:31:23.666+0100 info service@v0.134.0/service.go:211 Starting otelcontribcol... {"resource": {"service.instance.id": "f054fbb3-ad03-4aef-8c7a-1e38550cfec7", "service.name": "otelcontribcol", "service.version": "0.134.0-dev"}, "Version": "0.134.0-dev", "NumCPU": 8}
2025-09-03T17:31:23.666+0100 info extensions/extensions.go:41 Starting extensions... {"resource": {"service.instance.id": "f054fbb3-ad03-4aef-8c7a-1e38550cfec7", "service.name": "otelcontribcol", "service.version": "0.134.0-dev"}}
2025-09-03T17:31:23.666+0100 info internal/resourcedetection.go:137 began detecting resource information {"resource": {"service.instance.id": "f054fbb3-ad03-4aef-8c7a-1e38550cfec7", "service.name": "otelcontribcol", "service.version": "0.134.0-dev"}, "otelcol.component.id": "resourcedetection", "otelcol.component.kind": "processor", "otelcol.pipeline.id": "metrics", "otelcol.signal": "metrics"}
2025-09-03T17:31:23.672+0100 info internal/resourcedetection.go:188 detected resource information {"resource": {"service.instance.id": "f054fbb3-ad03-4aef-8c7a-1e38550cfec7", "service.name": "otelcontribcol", "service.version": "0.134.0-dev"}, "otelcol.component.id": "resourcedetection", "otelcol.component.kind": "processor", "otelcol.pipeline.id": "metrics", "otelcol.signal": "metrics", "resource": {"cloud.availability_zone":"nbg1-dc3","cloud.provider":"hetzner","cloud.region":"eu-central","host.id":"30727666","host.name":"vm1"}}
2025-09-03T17:31:23.672+0100 info service@v0.134.0/service.go:234 Everything is ready. Begin running and processing data. {"resource": {"service.instance.id": "f054fbb3-ad03-4aef-8c7a-1e38550cfec7", "service.name": "otelcontribcol", "service.version": "0.134.0-dev"}}
2025-09-03T17:31:24.673+0100 info Metrics {"resource": {"service.instance.id": "f054fbb3-ad03-4aef-8c7a-1e38550cfec7", "service.name": "otelcontribcol", "service.version": "0.134.0-dev"}, "otelcol.component.id": "debug", "otelcol.component.kind": "exporter", "otelcol.signal": "metrics", "resource metrics": 3, "metrics": 5, "data points": 73}
2025-09-03T17:31:24.673+0100 info ResourceMetrics #0
Resource SchemaURL: https://opentelemetry.io/schemas/1.9.0
Resource attributes:
-> cloud.provider: Str(hetzner)
-> host.id: Str(30727666)
-> host.name: Str(vm1)
-> cloud.region: Str(eu-central)
-> cloud.availability_zone: Str(nbg1-dc3)
```
<!--Describe the documentation added.-->
#### Documentation
Updated the `README.md` with this new detector.
<!--Please delete paragraphs that you did not use before submitting.-->
---------
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>1 parent 61cc72c commit adbd65e
File tree
35 files changed
+744
-43
lines changed- .chloggen
- .github
- ISSUE_TEMPLATE
- connector/datadogconnector
- exporter/datadogexporter
- integrationtest
- processor/resourcedetectionprocessor
- internal/hetzner
- internal/metadata
- testdata
35 files changed
+744
-43
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| 208 | + | |
208 | 209 | | |
209 | 210 | | |
210 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| 210 | + | |
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
212 | 213 | | |
213 | 214 | | |
214 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| 189 | + | |
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
| 38 | + | |
| 39 | + | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| |||
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
335 | | - | |
| 335 | + | |
336 | 336 | | |
337 | 337 | | |
338 | 338 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments