class
Logit::Backend::OTLP::PayloadBuilder
- Logit::Backend::OTLP::PayloadBuilder
- Reference
- Object
Overview
Builds OTLP JSON payloads from Logit events.
Converts an array of events to the OTLP/HTTP JSON format for logs. Follows the OpenTelemetry Protocol specification: https://opentelemetry.io/docs/specs/otlp/
Defined in:
logit/backends/otlp/payload_builder.crConstant Summary
-
SEVERITY_MAP =
{LogLevel::Trace => 1, LogLevel::Debug => 5, LogLevel::Info => 9, LogLevel::Warn => 13, LogLevel::Error => 17, LogLevel::Fatal => 21} -
Maps Logit LogLevel to OTLP SeverityNumber. https://opentelemetry.io/docs/specs/otel/logs/data-model/#field-severitynumber
Constructors
Instance Method Summary
-
#build(events : Array(Event)) : String
Builds an OTLP JSON payload from an array of events.
Constructor Detail
def self.new(resource_attributes : Hash(String, String), scope_name : String, scope_version : String)
#
Instance Method Detail
Builds an OTLP JSON payload from an array of events.
Returns a JSON string ready to be sent to an OTLP collector.