logsink

package
v3.3.18 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const OTELJsonFormat = `` /* 1503-byte string literal not displayed */

OTELJsonFormat is useful for testing. All the examples are taken from https://github.com/tigrannajaryan/rfcs/blob/feature/tigran/log-data-model/text/0097-log-data-model.md#example-log-records

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log struct {
	TraceID        string                 `json:"traceId,omitempty"` // byte sequences
	SpanID         string                 `json:"spanId,omitempty"`  // byte sequences
	SeverityText   string                 `json:"severityText,omitempty"`
	ShortName      string                 `json:"shortName,omitempty"`
	Body           interface{}            `json:"body"`
	TimeStamp      uint64                 `json:"timestamp"`
	Resource       map[string]interface{} `json:"resource,omitempty"`
	Attributes     map[string]interface{} `json:"attributes,omitempty"`
	TraceFlag      byte                   `json:"traceFlags,omitempty"`
	SeverityNumber int8                   `json:"severityNumber,omitempty"`
}

Log is a record or event that has occurred

type Logs

type Logs []*Log

Logs is a list of logs

type MiddlewareConstructor

type MiddlewareConstructor func(sendTo Sink) Sink

A MiddlewareConstructor is used by FromChain to chain together a bunch of sinks that forward to each other

func NextWrap

func NextWrap(wrapping NextSink) MiddlewareConstructor

NextWrap wraps a NextSink to make it usable by MiddlewareConstructor

type NextSink

type NextSink interface {
	AddLogs(ctx context.Context, logs []*Log, next Sink) error
}

NextSink is a special case of a sink that forwards to another sink

type Sink

type Sink interface {
	AddLogs(ctx context.Context, logs []*Log) error
}

A Sink is an object that can accept log record and do something with them, life forward them to some endpoint

func FromChain

func FromChain(endSink Sink, sinks ...MiddlewareConstructor) Sink

FromChain creates an endpoint Sink that sends calls between multiple middlewares for things like counting traces in between.

Jump to

Keyboard shortcuts

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