Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement resource serialization for stdoutlog #5213

Merged
merged 12 commits into from
Apr 22, 2024
5 changes: 3 additions & 2 deletions exporters/stdout/stdoutlog/record.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ type recordJSON struct {
TraceID trace.TraceID
SpanID trace.SpanID
TraceFlags trace.TraceFlags
Resource resource.Resource
Resource *resource.Resource
Scope instrumentation.Scope
AttributeValueLengthLimit int
AttributeCountLimit int
}

func (e *Exporter) newRecordJSON(r sdklog.Record) recordJSON {
res := r.Resource()
newRecord := recordJSON{
Severity: r.Severity(),
SeverityText: r.SeverityText(),
Expand All @@ -42,7 +43,7 @@ func (e *Exporter) newRecordJSON(r sdklog.Record) recordJSON {

Attributes: make([]log.KeyValue, 0, r.AttributesLen()),

Resource: r.Resource(),
Resource: &res,
Scope: r.InstrumentationScope(),
AttributeValueLengthLimit: r.AttributeValueLengthLimit(),
AttributeCountLimit: r.AttributeCountLimit(),
Expand Down