Skip to content

Commit e0141a4

Browse files
committed
out_stackdriver: Add Special field spanId
Ref: [fluent-bit #4224](fluent/fluent-bit#4224) Signed-off-by: 0Delta <[email protected]>
1 parent e4fa2ba commit e0141a4

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

pipeline/outputs/stackdriver_special_fields.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Currently, we also support some special fields in fluent-bit:
1010
| logging.googleapis.com/insertId | insertId | A unique identifier for the log entry. It is used to order logEntries |
1111
| logging.googleapis.com/sourceLocation | sourceLocation | Additional information about the source code location that produced the log entry. |
1212
| logging.googleapis.com/http_request | httpRequest | A common proto for logging HTTP requests. |
13+
| logging.googleapis.com/spanId | spanId | The span ID within the trace associated with the log entry |
1314
| timestamp | timestamp | An object including the seconds and nanos fields that represents the time |
1415
| timestampSecond & timestampNanos | timestamp | The seconds and nanos that represents the time |
1516

@@ -313,6 +314,34 @@ the logEntry will be:
313314
}
314315
```
315316

317+
## Span ID
318+
319+
The span ID within the trace associated with the log entry.
320+
321+
The JSON representation is as followed:
322+
```text
323+
"spanId": string
324+
```
325+
326+
### Use Cases
327+
Set the input log as followed:
328+
```text
329+
jsonPayload {
330+
"logging.googleapis.com/spanId": "1234567890abcdef"
331+
...
332+
}
333+
```
334+
the logEntry will be:
335+
```text
336+
{
337+
"jsonPayload": {
338+
...
339+
}
340+
"spanId": "1234567890abcdef"
341+
...
342+
}
343+
```
344+
316345
## Timestamp
317346

318347
We support two formats of time-related fields:

0 commit comments

Comments
 (0)