Description
In order to correlate APM data with logs, we need to specify stable identifiers for the span ID and trace ID.
Note that for distributed tracing there are some changes in the data model. Most notably, we have the concept of a trace. The trace ID will be propagated to each service which participates in a "distributed transaction" aka trace. The format is a hex encoded 128 bit byte array string, for example cd03e525c1c801cc666099d5c2108e4e
Some suggestions for the field name:
trace.id
trace_id
event.trace_id
We still have a separation of transaction and span, although, with distributed tracing, the semantics of those are a bit blurred. Both have an id and a traceId A transaction is the first event in a particular service, also known as the entry point (or sometimes entry span). A span is a unit of work, like a DB request, within a transaction.
Open question: do we want different field names for the transaction and span ids?
I'd suggest just using the already defined id
field both for transaction ids and span ids. This makes it future-proof if we decide we want to merge the transaction and span concepts.
The format is a hex encoded 64 bit byte array string, for example dbebf61570c4dd6e
.
However, id
seems to be quite a generic name. It also does not seem to be namespaced like apm.id
right? Couldn't that lead to ambiguities?