How each signal's payload becomes a request body:
layer_json and layer_protobuf provide one, and
OtlpSerializationService(traces=..., metrics=..., logs=...) makes
one of functions.
Functions#
__init__#
__init__(traces, metrics, logs) -> None| Parameter | Type | Description |
|---|---|---|
traces | Callable[[TraceData], _body.HttpBody] | |
metrics | Callable[[MetricsData], _body.HttpBody] | |
logs | Callable[[LogsData], _body.HttpBody] |
def __init__(
self,
traces: Callable[[TraceData], _body.HttpBody],
metrics: Callable[[MetricsData], _body.HttpBody],
logs: Callable[[LogsData], _body.HttpBody],
) -> None:
self._traces = traces
self._metrics = metrics
self._logs = logstraces#
traces(data) -> _body.HttpBodyThe request body of the trace export data (an OTLP
ExportTraceServiceRequest), with its content type.
| Parameter | Type | Description |
|---|---|---|
data | TraceData |
Returns _body.HttpBody
def traces(self, data: TraceData) -> _body.HttpBody:
"""The request body of the trace export ``data`` (an OTLP
``ExportTraceServiceRequest``), with its content type."""
return self._traces(data)metrics#
metrics(data) -> _body.HttpBodyThe request body of the metrics export data (an OTLP
ExportMetricsServiceRequest), with its content type.
| Parameter | Type | Description |
|---|---|---|
data | MetricsData |
Returns _body.HttpBody
def metrics(self, data: MetricsData) -> _body.HttpBody:
"""The request body of the metrics export ``data`` (an OTLP
``ExportMetricsServiceRequest``), with its content type."""
return self._metrics(data)logs#
logs(data) -> _body.HttpBodyThe request body of the logs export data (an OTLP
ExportLogsServiceRequest), with its content type.
| Parameter | Type | Description |
|---|---|---|
data | LogsData |
Returns _body.HttpBody
def logs(self, data: LogsData) -> _body.HttpBody:
"""The request body of the logs export ``data`` (an OTLP
``ExportLogsServiceRequest``), with its content type."""
return self._logs(data)