1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-09-16 09:26:25 +02:00

sdk/log: Record.Resource to return *resource.Resource (#6864)

Fixes https://github.com/open-telemetry/opentelemetry-go/issues/6863

From https://pkg.go.dev/go.opentelemetry.io/otel/sdk/resource#Resource:

> Resource is an immutable object
> [...]
> Resources should be passed and stored as pointers
(`*resource.Resource`)

In all other places the exported API uses `*resource.Resource` and not
`resource.Resource`.
This commit is contained in:
Robert Pająk
2025-06-04 07:05:17 +02:00
committed by GitHub
parent 1636bcdd1d
commit a99f9b56ce
5 changed files with 6 additions and 8 deletions

View File

@@ -106,7 +106,7 @@ func (e *Exporter) newRecordJSON(r sdklog.Record) recordJSON {
Attributes: make([]keyValue, 0, r.AttributesLen()),
Resource: &res,
Resource: res,
Scope: r.InstrumentationScope(),
DroppedAttributes: r.DroppedAttributes(),