Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### Added

- Configuration file can now be set via `OTEL_CONFIG_FILE` in `go.opentelemetry.io/contrib/otelconf`. (#8639)
- Added support for `service` resource detector in `go.opentelemetry.io/contrib/otelconf`. (#8674)

### Changed

Expand Down
2 changes: 1 addition & 1 deletion otelconf/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.42.0
go.opentelemetry.io/otel/log v0.18.0
go.opentelemetry.io/otel/metric v1.42.0
go.opentelemetry.io/otel/sdk v1.42.0
go.opentelemetry.io/otel/sdk v1.42.1-0.20260312144007-6d79ac393692
go.opentelemetry.io/otel/sdk/log v0.18.0
go.opentelemetry.io/otel/sdk/log/logtest v0.18.0
go.opentelemetry.io/otel/sdk/metric v1.42.0
Expand Down
4 changes: 2 additions & 2 deletions otelconf/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ go.opentelemetry.io/otel/log v0.18.0 h1:XgeQIIBjZZrliksMEbcwMZefoOSMI1hdjiLEiiB0
go.opentelemetry.io/otel/log v0.18.0/go.mod h1:KEV1kad0NofR3ycsiDH4Yjcoj0+8206I6Ox2QYFSNgI=
go.opentelemetry.io/otel/metric v1.42.0 h1:2jXG+3oZLNXEPfNmnpxKDeZsFI5o4J+nz6xUlaFdF/4=
go.opentelemetry.io/otel/metric v1.42.0/go.mod h1:RlUN/7vTU7Ao/diDkEpQpnz3/92J9ko05BIwxYa2SSI=
go.opentelemetry.io/otel/sdk v1.42.0 h1:LyC8+jqk6UJwdrI/8VydAq/hvkFKNHZVIWuslJXYsDo=
go.opentelemetry.io/otel/sdk v1.42.0/go.mod h1:rGHCAxd9DAph0joO4W6OPwxjNTYWghRWmkHuGbayMts=
go.opentelemetry.io/otel/sdk v1.42.1-0.20260312144007-6d79ac393692 h1:KxM/2erC3Bx97dBXg+Nx3NALLb1BKk2bZIJvpqR0LG8=
go.opentelemetry.io/otel/sdk v1.42.1-0.20260312144007-6d79ac393692/go.mod h1:xaSffVzFG55EcPDReZb7hNa30cBwL0AMXQgPeGkMPtk=
go.opentelemetry.io/otel/sdk/log v0.18.0 h1:n8OyZr7t7otkeTnPTbDNom6rW16TBYGtvyy2Gk6buQw=
go.opentelemetry.io/otel/sdk/log v0.18.0/go.mod h1:C0+wxkTwKpOCZLrlJ3pewPiiQwpzycPI/u6W0Z9fuYk=
go.opentelemetry.io/otel/sdk/log/logtest v0.18.0 h1:l3mYuPsuBx6UKE47BVcPrZoZ0q/KER57vbj2qkgDLXA=
Expand Down
5 changes: 3 additions & 2 deletions otelconf/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ func resourceOpts(detectors []ExperimentalResourceDetector) []resource.Option {
if d.Process != nil {
opts = append(opts, resource.WithProcess())
}
// TODO: implement service:
// Waiting on https://github.com/open-telemetry/opentelemetry-go/pull/7642
if d.Service != nil {
opts = append(opts, resource.WithService())
}
}
return opts
}
Expand Down
4 changes: 4 additions & 0 deletions otelconf/resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func TestResourceOptsWithDetectors(t *testing.T) {
wantHostAttributes bool
wantOSAttributes bool
wantProcessAttribute bool
wantServiceAttribute bool
}{
{
name: "no-detectors",
Expand All @@ -115,10 +116,12 @@ func TestResourceOptsWithDetectors(t *testing.T) {
{Container: ExperimentalContainerResourceDetector{}},
{Host: ExperimentalHostResourceDetector{}},
{Process: ExperimentalProcessResourceDetector{}},
{Service: ExperimentalServiceResourceDetector{}},
},
wantHostAttributes: true,
wantOSAttributes: true,
wantProcessAttribute: true,
wantServiceAttribute: true,
},
}
for _, tt := range tests {
Expand All @@ -141,6 +144,7 @@ func TestResourceOptsWithDetectors(t *testing.T) {
assert.Equal(t, tt.wantHostAttributes, attrSet[semconv.HostNameKey], "should have host.name attribute")
assert.Equal(t, tt.wantOSAttributes, attrSet[semconv.OSTypeKey], "should have os.type attribute (from WithOS()")
assert.Equal(t, tt.wantProcessAttribute, attrSet[semconv.ProcessPIDKey], "should have process.pid attribute")
assert.Equal(t, tt.wantServiceAttribute, attrSet[semconv.ServiceInstanceIDKey], "should have service.instance.id attribute")
})
}
}
Loading