Skip to content

Commit 4fc64ae

Browse files
committed
Fix debug exporter: render TraceID and SpanID as attributes
1 parent 15a4484 commit 4fc64ae

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

exporter/debugexporter/internal/otlptext/logs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ func (textLogsMarshaler) MarshalLogs(ld plog.Logs) ([]byte, error) {
4444
}
4545
buf.logEntry("Body: %s", valueToString(lr.Body()))
4646
buf.logAttributes("Attributes", lr.Attributes())
47-
buf.logEntry("Trace ID: %s", lr.TraceID())
48-
buf.logEntry("Span ID: %s", lr.SpanID())
47+
buf.logAttr("Trace ID", lr.TraceID())
48+
buf.logAttr("Span ID", lr.SpanID())
4949
buf.logEntry("Flags: %d", lr.Flags())
5050
}
5151
}

exporter/debugexporter/internal/otlptext/testdata/logs/embedded_maps.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ Body: Map({"key1":"val1","key2":{"key21":"val21","key22":"val22"}})
1212
Attributes:
1313
-> key1: Map({"key11":"val11","key12":"val12","key13":{"key131":"val131"}})
1414
-> key2: Str(val2)
15-
Trace ID:
16-
Span ID:
15+
Trace ID :
16+
Span ID :
1717
Flags: 0

exporter/debugexporter/internal/otlptext/testdata/logs/log_with_event_name.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ Body: Str(This is a log message)
1313
Attributes:
1414
-> app: Str(server)
1515
-> instance_num: Int(1)
16-
Trace ID: 08040201000000000000000000000000
17-
Span ID: 0102040800000000
16+
Trace ID : 08040201000000000000000000000000
17+
Span ID : 0102040800000000
1818
Flags: 0

exporter/debugexporter/internal/otlptext/testdata/logs/logs_with_entity_refs.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ SeverityNumber: Info(9)
2727
Body: Str(This is a test log message)
2828
Attributes:
2929
-> test.attribute: Str(test-value)
30-
Trace ID:
31-
Span ID:
30+
Trace ID :
31+
Span ID :
3232
Flags: 0

exporter/debugexporter/internal/otlptext/testdata/logs/one_record.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ Body: Str(This is a log message)
1414
Attributes:
1515
-> app: Str(server)
1616
-> instance_num: Int(1)
17-
Trace ID: 08040201000000000000000000000000
18-
Span ID: 0102040800000000
17+
Trace ID : 08040201000000000000000000000000
18+
Span ID : 0102040800000000
1919
Flags: 0

exporter/debugexporter/internal/otlptext/testdata/logs/two_records.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Body: Str(This is a log message)
1414
Attributes:
1515
-> app: Str(server)
1616
-> instance_num: Int(1)
17-
Trace ID: 08040201000000000000000000000000
18-
Span ID: 0102040800000000
17+
Trace ID : 08040201000000000000000000000000
18+
Span ID : 0102040800000000
1919
Flags: 0
2020
LogRecord #1
2121
ObservedTimestamp: 1970-01-01 00:00:00 +0000 UTC
@@ -26,6 +26,6 @@ Body: Str(something happened)
2626
Attributes:
2727
-> customer: Str(acme)
2828
-> env: Str(dev)
29-
Trace ID:
30-
Span ID:
29+
Trace ID :
30+
Span ID :
3131
Flags: 0

0 commit comments

Comments
 (0)