encode

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package encode writes records as OTLP/JSON (docs/12 §2–3). Each record is encoded once, when it is queued; a request is the concatenation of its records' fragments under one ResourceLogs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HostName

func HostName() string

func Request

func Request(resource []record.Attr, records []Encoded) []byte

Request builds one ResourceLogs with one ScopeLogs per scope, in order of first appearance.

func Resource

func Resource(cfg ResourceConfig) []record.Attr

Resource returns the fixed resource attributes, then the configured ones that do not replace a fixed key.

Types

type Encoded

type Encoded struct {
	Scope string
	JSON  []byte
}

func Record

func Record(r *record.Record) Encoded

type ResourceConfig

type ResourceConfig struct {
	Service, Environment, Release string
	Attributes                    []record.Attr
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL