TRACES_PATH
TRACES_PATH = '/v1/traces'
The path a collector accepts spans on.
Renders spans and metrics as OTLP over HTTP with a JSON body.
A pure transform with no client and no configuration beyond the resource attributes, so the wire shape is unit-testable without a collector. The protobuf encoding is the other OTLP transport and would need an extension or a generated stub library; the JSON one is accepted by every collector this would be pointed at and costs nothing to ship.
Ids travel as hex, not as bytes. OTLP/JSON specifies base16 for traceId and spanId, unlike
the protobuf encoding which carries raw bytes. A collector fed base64 there accepts the request
and then silently indexes the trace under the wrong id.
Integers travel as strings. Unix nanoseconds exceed what a JSON number can hold exactly in a
consumer using doubles, so the specification requires fixed64 fields to be quoted. Sending them
unquoted loses the low digits of every timestamp, which reorders spans inside a trace.
__construct(string $serviceName = 'strata', string $version = '', array$resource = []) : mixed
Constructs a payload renderer.
| string | $serviceName | What the collector files this process under. |
| string | $version | The module version, so a graph can be split across a deploy. |
| array |
$resource | Further resource attributes, such as the site id and the deployment environment. |