Trace to Log
Convert trace events to log events
status: beta
egress: stream
state: stateless
input: traces
output: logs
Converts a trace event into a log event. This preserves all trace
attributes (span IDs, trace IDs, etc.) as log fields without modification.
This transformation does not add any new fields, nor does it validate the
output events are valid traces.
Configuration
Example configurations
{
"transforms": {
"my_transform_id": {
"type": "trace_to_log",
"inputs": [
"my-source-or-transform-id"
]
}
}
}[transforms.my_transform_id]
type = "trace_to_log"
inputs = [ "my-source-or-transform-id" ]
transforms:
my_transform_id:
type: trace_to_log
inputs:
- my-source-or-transform-id
{
"transforms": {
"my_transform_id": {
"type": "trace_to_log",
"inputs": [
"my-source-or-transform-id"
]
}
}
}[transforms.my_transform_id]
type = "trace_to_log"
inputs = [ "my-source-or-transform-id" ]
transforms:
my_transform_id:
type: trace_to_log
inputs:
- my-source-or-transform-id
graph
optional objectExtra graph configuration
Configure output for component when generated with graph command
graph.node_attributes
optional objectNode attributes to add to this component’s node in resulting graph
They are added to the node as provided
graph.node_attributes.*
required string literalA single graph node attribute in graphviz DOT language.
inputs
required [string]A list of upstream source or transform IDs.
Wildcards (*) are supported.
See configuration for more info.
Input Types
The following table lists all telemetry data types supported by the component across possible configurations. Be
aware that the available data types may differ based on the specified codec configuration.
Traces
Trace events are supported.
Outputs
<component_id>
Default output stream of the component. Use this component’s ID as an input to downstream transforms and sinks.
Output Types
Logs
Warning
The fields shown below will be different if log namespacing is enabled. See
Log Namespacing for more details
The converted
log event.Telemetry
Metrics
linkcomponent_discarded_events_total
counterThe number of events dropped by this component.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host
optional
The hostname of the system Vector is running on.
intentional
True if the events were discarded intentionally, like a
filter transform, or false if due to an error.pid
optional
The process ID of the Vector instance.
component_errors_total
counterThe total number of errors encountered by this component.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
error_type
The type of the error
host
optional
The hostname of the system Vector is running on.
pid
optional
The process ID of the Vector instance.
stage
The stage within the component at which the error occurred.
component_received_event_bytes_total
counterThe number of event bytes accepted by this component either from
tagged origins like file and uri, or cumulatively from other origins.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
container_name
optional
The name of the container from which the data originated.
file
optional
The file from which the data originated.
host
optional
The hostname of the system Vector is running on.
mode
optional
The connection mode used by the component.
peer_addr
optional
The IP from which the data originated.
peer_path
optional
The pathname from which the data originated.
pid
optional
The process ID of the Vector instance.
pod_name
optional
The name of the pod from which the data originated.
uri
optional
The sanitized URI from which the data originated.
component_received_events_count
histogramA histogram of the number of events passed in each internal batch in Vector’s internal topology.
Note that this is separate than sink-level batching. It is mostly useful for low level debugging performance issues in Vector due to small internal batches.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
container_name
optional
The name of the container from which the data originated.
file
optional
The file from which the data originated.
host
optional
The hostname of the system Vector is running on.
mode
optional
The connection mode used by the component.
peer_addr
optional
The IP from which the data originated.
peer_path
optional
The pathname from which the data originated.
pid
optional
The process ID of the Vector instance.
pod_name
optional
The name of the pod from which the data originated.
uri
optional
The sanitized URI from which the data originated.
component_received_events_total
counterThe number of events accepted by this component either from tagged
origins like file and uri, or cumulatively from other origins.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
container_name
optional
The name of the container from which the data originated.
file
optional
The file from which the data originated.
host
optional
The hostname of the system Vector is running on.
mode
optional
The connection mode used by the component.
peer_addr
optional
The IP from which the data originated.
peer_path
optional
The pathname from which the data originated.
pid
optional
The process ID of the Vector instance.
pod_name
optional
The name of the pod from which the data originated.
uri
optional
The sanitized URI from which the data originated.
component_sent_event_bytes_total
counterThe total number of event bytes emitted by this component.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host
optional
The hostname of the system Vector is running on.
output
optional
The specific output of the component.
pid
optional
The process ID of the Vector instance.
component_sent_events_total
counterThe total number of events emitted by this component.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host
optional
The hostname of the system Vector is running on.
output
optional
The specific output of the component.
pid
optional
The process ID of the Vector instance.
transform_buffer_max_byte_size
gaugeThe maximum number of bytes the buffer that feeds into a transform can hold.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host
optional
The hostname of the system Vector is running on.
output
optional
The specific output of the component.
pid
optional
The process ID of the Vector instance.
transform_buffer_max_event_size
gaugeThe maximum number of events the buffer that feeds into a transform can hold.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host
optional
The hostname of the system Vector is running on.
output
optional
The specific output of the component.
pid
optional
The process ID of the Vector instance.
transform_buffer_utilization
histogramThe utilization level of the buffer that feeds into a transform.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host
optional
The hostname of the system Vector is running on.
output
optional
The specific output of the component.
pid
optional
The process ID of the Vector instance.
transform_buffer_utilization_level
gaugeThe current utilization level of the buffer that feeds into a transform.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host
optional
The hostname of the system Vector is running on.
output
optional
The specific output of the component.
pid
optional
The process ID of the Vector instance.
utilization
gaugeA ratio from 0 to 1 of the load on a component. A value of 0 would indicate a completely idle component that is simply waiting for input. A value of 1 would indicate a that is never idle. This value is updated every 5 seconds.
component_id
The Vector component ID.
component_kind
The Vector component kind.
component_type
The Vector component type.
host
optional
The hostname of the system Vector is running on.
pid
optional
The process ID of the Vector instance.
Examples
Trace to Log
Given this event...[{"trace":{"service":"my-service","span_id":"abc123","span_name":"test-span","trace_id":"xyz789"}}]transforms:
my_transform_id:
type: trace_to_log
inputs:
- my-source-or-transform-id
[transforms.my_transform_id]
type = "trace_to_log"
inputs = [ "my-source-or-transform-id" ]
{
"transforms": {
"my_transform_id": {
"type": "trace_to_log",
"inputs": [
"my-source-or-transform-id"
]
}
}
}[{"log":{"service":"my-service","span_id":"abc123","span_name":"test-span","trace_id":"xyz789"}}]How it works
Conversion Behavior
The trace to log conversion is a straightforward transformation that takes all fields
from the trace event and preserves them as fields in the resulting log event. This includes
span IDs, trace IDs, span names, and any other trace attributes. The conversion does not modify
or restructure the data, making it a simple pass-through with a type change from trace to log.
State
This component is stateless, meaning its behavior is consistent across each input.