ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
submit_log_records_request Struct Referencefinal

Request to submit a batch of log records to the server. More...

#include <log_records_protocol.hpp>

Collaboration diagram for submit_log_records_request:
Collaboration graph

Public Member Functions

std::vector< std::byte > serialize () const
 Serialize request to bytes.
 

Static Public Member Functions

static std::expected< submit_log_records_request, ores::utility::serialization::error_code > deserialize (std::span< const std::byte > data)
 Deserialize request from bytes.
 

Public Attributes

std::vector< domain::log_recordrecords
 The batch of log records to submit.
 

Detailed Description

Request to submit a batch of log records to the server.

This is a fire-and-forget message. The client does not wait for a response and continues processing immediately. The server stores the records in the telemetry database for analysis and correlation.

Records should be batched for efficiency. Typical batch sizes are 50-100 records, or send when a flush interval (e.g., 5 seconds) has elapsed.

Member Function Documentation

◆ serialize()

std::vector< std::byte > serialize ( ) const

Serialize request to bytes.

Format:

  • 4 bytes: record count (uint32) For each record:
  • 8 bytes: timestamp (milliseconds since epoch, uint64)
  • 1 byte: severity level (uint8)
  • 2 bytes: body length
  • N bytes: body (UTF-8)
  • 2 bytes: logger_name length
  • N bytes: logger_name (UTF-8)
  • 1 byte: has_trace (boolean)
  • 32 bytes: trace_id hex string (if has_trace)
  • 1 byte: has_span (boolean)
  • 16 bytes: span_id hex string (if has_span)
  • 2 bytes: service_name length
  • N bytes: service_name (UTF-8, from resource if present)