📝 Simple log data structure for transmission over Rednet.

This is the wire format for sending log records from clients to collectors. Each log includes severity, context, and rich metadata for analysis.

const log: RednetLog = {
body: "User login successful",
severity: SeverityNumber.INFO,
attributes: { "user.id": "123", "login.method": "password" },
timestamp: os.epoch("utc"),
resource: { "service.name": "auth-service" },
scope: { name: "auth-service", version: "2.0.0" }
};
interface RednetLog {
    attributes: Record<string, unknown>;
    body: string;
    resource: Record<string, unknown>;
    scope: { name: string; version: string };
    severity: SeverityNumber;
    timestamp: number;
}

Properties

attributes: Record<string, unknown>

Key-value attributes providing context

body: string

The main log message or structured data

resource: Record<string, unknown>

Resource attributes identifying the source

scope: { name: string; version: string }

Instrumentation scope information

Type declaration

  • name: string

    Name of the instrumentation scope

  • version: string

    Version of the instrumentation scope

severity: SeverityNumber

Severity level using OpenTelemetry standard numbers

timestamp: number

Timestamp in nanoseconds since Unix epoch