Skip to content

Commit 135bff5

Browse files
committed
Send span lines with span logs.
1 parent 10ec95b commit 135bff5

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

senders/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func (sender *wavefrontSender) SendSpan(name string, startMillis, durationMillis
135135
}
136136

137137
if len(spanLogs) > 0 {
138-
logs, err := SpanLogJSON(traceId, spanId, spanLogs)
138+
logs, err := SpanLogJSON(traceId, spanId, spanLogs, line)
139139
if err != nil {
140140
sender.spanLogsInvalid.Inc()
141141
return err

senders/direct.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ func (sender *directSender) SendSpan(name string, startMillis, durationMillis in
192192
}
193193

194194
if len(spanLogs) > 0 {
195-
logs, err := SpanLogJSON(traceId, spanId, spanLogs)
195+
logs, err := SpanLogJSON(traceId, spanId, spanLogs, line)
196196
if err != nil {
197197
sender.spanLogsInvalid.Inc()
198198
return err

senders/formatter.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,12 @@ func SpanLine(name string, startMillis, durationMillis int64, source, traceId, s
195195
}
196196

197197
// SpanLogJSON is for internal use only.
198-
func SpanLogJSON(traceId, spanId string, spanLogs []SpanLog) (string, error) {
198+
func SpanLogJSON(traceId, spanId string, spanLogs []SpanLog, span string) (string, error) {
199199
l := SpanLogs{
200200
TraceId: traceId,
201201
SpanId: spanId,
202202
Logs: spanLogs,
203+
Span: span,
203204
}
204205
out, err := json.Marshal(l)
205206
if err != nil {

senders/proxy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ func (sender *proxySender) SendSpan(name string, startMillis, durationMillis int
255255
}
256256

257257
if len(spanLogs) > 0 {
258-
logs, err := SpanLogJSON(traceId, spanId, spanLogs)
258+
logs, err := SpanLogJSON(traceId, spanId, spanLogs, line)
259259
if err != nil {
260260
sender.spanLogsInvalid.Inc()
261261
return err

senders/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ type SpanLogs struct {
2020
TraceId string `json:"traceId"`
2121
SpanId string `json:"spanId"`
2222
Logs []SpanLog `json:"logs"`
23+
Span string `json:"span"`
2324
}
2425

2526
// MetricSender Interface for sending metrics to Wavefront

0 commit comments

Comments
 (0)