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

[connector/exceptions] Add trace id and span id to generated logs #28670

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions connector/exceptionsconnector/connector_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ func (c *logsConnector) attrToLogRecord(sl plog.ScopeLogs, serviceName string, s
logRecord.SetTimestamp(event.Timestamp())
logRecord.SetSeverityNumber(plog.SeverityNumberError)
logRecord.SetSeverityText("ERROR")
logRecord.SetSpanID(span.SpanID())
logRecord.SetTraceID(span.TraceID())
eventAttrs := event.Attributes()
spanAttrs := span.Attributes()

Expand Down
12 changes: 6 additions & 6 deletions connector/exceptionsconnector/testdata/logs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ resourceLogs:
body: {}
severityNumber: 17
severityText: ERROR
spanId: ""
traceId: ""
spanId: 2a00000000000000
traceId: 2a000000000000000000000000000000
- attributes:
- key: span.kind
value:
Expand All @@ -48,8 +48,8 @@ resourceLogs:
body: {}
severityNumber: 17
severityText: ERROR
spanId: ""
traceId: ""
spanId: 2a00000000000000
traceId: 2a000000000000000000000000000000
scope: {}
- resource: {}
scopeLogs:
Expand All @@ -76,6 +76,6 @@ resourceLogs:
body: {}
severityNumber: 17
severityText: ERROR
spanId: ""
traceId: ""
spanId: 2a00000000000000
traceId: 2a000000000000000000000000000000
scope: {}
Loading