GitHub

OtlpSerializationService

API reference for OtlpSerializationService.

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
ParameterTypeDescription
tracesCallable[[TraceData], _body.HttpBody]
metricsCallable[[MetricsData], _body.HttpBody]
logsCallable[[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 = logs

traces

traces(data) -> _body.HttpBody

The request body of the trace export data (an OTLP ExportTraceServiceRequest), with its content type.

ParameterTypeDescription
dataTraceData

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.HttpBody

The request body of the metrics export data (an OTLP ExportMetricsServiceRequest), with its content type.

ParameterTypeDescription
dataMetricsData

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.HttpBody

The request body of the logs export data (an OTLP ExportLogsServiceRequest), with its content type.

ParameterTypeDescription
dataLogsData

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)