Skip to content
Open
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
25 changes: 25 additions & 0 deletions .chloggen/fix-14202.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. receiver/otlp)
component: exporter/debug

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: "Added logging for dropped attributes, events, and links counts in debug exporter OTLP text traces marshaler."

# One or more tracking issues or pull requests related to the change
issues: [14202]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [user]
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ Span #0
End time : 1970-01-01 00:00:00 +0000 UTC
Status code : Unset
Status message :
DroppedAttributesCount: 0
DroppedEventsCount: 0
DroppedLinksCount: 0
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Span #0
End time : 2020-02-11 20:26:13.000000789 +0000 UTC
Status code : Error
Status message : status-cancelled
DroppedAttributesCount: 1
Events:
SpanEvent #0
-> Name: event-with-attr
Expand All @@ -27,6 +28,8 @@ SpanEvent #1
-> Name: event
-> Timestamp: 2020-02-11 20:26:13.000000123 +0000 UTC
-> DroppedAttributesCount: 2
DroppedEventsCount: 1
DroppedLinksCount: 0
Span #1
Trace ID :
Parent ID :
Expand All @@ -37,6 +40,8 @@ Span #1
End time : 2020-02-11 20:26:13.000000789 +0000 UTC
Status code : Unset
Status message :
DroppedAttributesCount: 0
DroppedEventsCount: 0
Links:
SpanLink #0
-> Trace ID:
Expand All @@ -50,3 +55,4 @@ SpanLink #1
-> ID:
-> TraceState:
-> DroppedAttributesCount: 4
DroppedLinksCount: 3
5 changes: 5 additions & 0 deletions exporter/debugexporter/internal/otlptext/traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
package otlptext // import "go.opentelemetry.io/collector/exporter/debugexporter/internal/otlptext"

import (
"strconv"

"go.opentelemetry.io/collector/pdata/ptrace"
)

Expand Down Expand Up @@ -50,8 +52,11 @@ func (textTracesMarshaler) MarshalTraces(td ptrace.Traces) ([]byte, error) {
buf.logAttr("Status message", span.Status().Message())

buf.logAttributes("Attributes", span.Attributes())
buf.logAttr("DroppedAttributesCount", strconv.FormatUint(uint64(span.DroppedAttributesCount()), 10))
buf.logEvents("Events", span.Events())
buf.logAttr("DroppedEventsCount", strconv.FormatUint(uint64(span.DroppedEventsCount()), 10))
buf.logLinks("Links", span.Links())
buf.logAttr("DroppedLinksCount", strconv.FormatUint(uint64(span.DroppedLinksCount()), 10))
}
}
}
Expand Down