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

Add transaction.data to contexts.trace.data #864

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
17 changes: 11 additions & 6 deletions tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -760,12 +760,13 @@
// A TraceContext carries information about an ongoing trace and is meant to be
// stored in Event.Contexts (as *TraceContext).
type TraceContext struct {
TraceID TraceID `json:"trace_id"`
SpanID SpanID `json:"span_id"`
ParentSpanID SpanID `json:"parent_span_id"`
Op string `json:"op,omitempty"`
Description string `json:"description,omitempty"`
Status SpanStatus `json:"status,omitempty"`
TraceID TraceID `json:"trace_id"`
SpanID SpanID `json:"span_id"`
ParentSpanID SpanID `json:"parent_span_id"`
Op string `json:"op,omitempty"`
Description string `json:"description,omitempty"`
Status SpanStatus `json:"status,omitempty"`
Data map[string]interface{} `json:"data,omitempty"`
}

func (tc *TraceContext) MarshalJSON() ([]byte, error) {
Expand Down Expand Up @@ -808,6 +809,10 @@
m["status"] = tc.Status
}

if len(tc.Data) > 0 {
m["data"] = tc.Data

Check warning on line 813 in tracing.go

View check run for this annotation

Codecov / codecov/patch

tracing.go#L813

Added line #L813 was not covered by tests
}

return m
}

Expand Down
Loading