Skip to content

Commit adbd65e

Browse files
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

35 files changed

+744
-43
lines changed

.chloggen/feat_42476.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: "enhancement"
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: "processor/resourcedetection"
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: "Add support for hetzner cloud in resourcedetectionprocessor"
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [42476]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [user]

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ processor/redactionprocessor/ @open-telemetry
205205
processor/remotetapprocessor/ @open-telemetry/collector-contrib-approvers @atoulme @jaronoff97
206206
processor/resourcedetectionprocessor/ @open-telemetry/collector-contrib-approvers @Aneurysm9 @dashpole
207207
processor/resourcedetectionprocessor/internal/dynatrace/ @open-telemetry/collector-contrib-approvers @bacherfl @evan-bradley
208+
processor/resourcedetectionprocessor/internal/hetzner/ @open-telemetry/collector-contrib-approvers @Aneurysm9 @dashpole @paulojmdias
208209
processor/resourceprocessor/ @open-telemetry/collector-contrib-approvers @dmitryax
209210
processor/schemaprocessor/ @open-telemetry/collector-contrib-approvers @MovieStoreGuy @ankitpatel96 @dineshg13
210211
processor/spanprocessor/ @open-telemetry/collector-contrib-approvers @boostchicken

.github/ISSUE_TEMPLATE/beta_stability.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ body:
207207
- processor/resource
208208
- processor/resourcedetection
209209
- processor/resourcedetection/internal/dynatrace
210+
- processor/resourcedetection/internal/hetzner
210211
- processor/schema
211212
- processor/span
212213
- processor/sumologic

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ body:
210210
- processor/resource
211211
- processor/resourcedetection
212212
- processor/resourcedetection/internal/dynatrace
213+
- processor/resourcedetection/internal/hetzner
213214
- processor/schema
214215
- processor/span
215216
- processor/sumologic

.github/ISSUE_TEMPLATE/feature_request.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ body:
204204
- processor/resource
205205
- processor/resourcedetection
206206
- processor/resourcedetection/internal/dynatrace
207+
- processor/resourcedetection/internal/hetzner
207208
- processor/schema
208209
- processor/span
209210
- processor/sumologic

.github/ISSUE_TEMPLATE/other.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ body:
204204
- processor/resource
205205
- processor/resourcedetection
206206
- processor/resourcedetection/internal/dynatrace
207+
- processor/resourcedetection/internal/hetzner
207208
- processor/schema
208209
- processor/span
209210
- processor/sumologic

.github/ISSUE_TEMPLATE/unmaintained.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ body:
209209
- processor/resource
210210
- processor/resourcedetection
211211
- processor/resourcedetection/internal/dynatrace
212+
- processor/resourcedetection/internal/hetzner
212213
- processor/schema
213214
- processor/span
214215
- processor/sumologic

.github/component_labels.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ processor/redactionprocessor processor/redaction
186186
processor/remotetapprocessor processor/remotetap
187187
processor/resourcedetectionprocessor processor/resourcedetection
188188
processor/resourcedetectionprocessor/internal/dynatrace processor/resourcedetection/internal/dynatrace
189+
processor/resourcedetectionprocessor/internal/hetzner processor/resourcedetection/internal/hetzner
189190
processor/resourceprocessor processor/resource
190191
processor/schemaprocessor processor/schema
191192
processor/spanprocessor processor/span

connector/datadogconnector/go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ require (
3535
go.opentelemetry.io/collector/processor/batchprocessor v0.134.0
3636
go.opentelemetry.io/collector/receiver v1.40.0
3737
go.opentelemetry.io/collector/receiver/otlpreceiver v0.134.0
38-
go.opentelemetry.io/otel v1.37.0
39-
go.opentelemetry.io/otel/metric v1.37.0
38+
go.opentelemetry.io/otel v1.38.0
39+
go.opentelemetry.io/otel/metric v1.38.0
4040
go.uber.org/zap v1.27.0
4141
google.golang.org/protobuf v1.36.8
4242
)
@@ -332,7 +332,7 @@ require (
332332
go.opentelemetry.io/otel/sdk v1.37.0 // indirect
333333
go.opentelemetry.io/otel/sdk/log v0.13.0 // indirect
334334
go.opentelemetry.io/otel/sdk/metric v1.37.0 // indirect
335-
go.opentelemetry.io/otel/trace v1.37.0 // indirect
335+
go.opentelemetry.io/otel/trace v1.38.0 // indirect
336336
go.opentelemetry.io/proto/otlp v1.7.0 // indirect
337337
go.uber.org/atomic v1.11.0 // indirect
338338
go.uber.org/dig v1.19.0 // indirect

connector/datadogconnector/go.sum

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)