record

package
v1.20.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package record provides functions for converting pdata to BindPlane records

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Log

type Log struct {
	Timestamp  time.Time              `json:"timestamp"`
	Body       interface{}            `json:"body"`
	Severity   string                 `json:"severity"`
	Attributes map[string]interface{} `json:"attributes"`
	Resource   map[string]interface{} `json:"resource"`
}

Log is a log record sent to bindplane

func ConvertLogs

func ConvertLogs(logs plog.Logs) []*Log

ConvertLogs gets log records from plogs

type Metric

type Metric struct {
	Name           string                 `json:"name"`
	Timestamp      time.Time              `json:"timestamp"`
	StartTimestamp time.Time              `json:"start_timestamp,omitempty"`
	Value          interface{}            `json:"value"`
	Unit           string                 `json:"unit"`
	Type           string                 `json:"type"`
	Attributes     map[string]interface{} `json:"attributes"`
	Resource       map[string]interface{} `json:"resource"`
}

Metric is a metric record sent to bindplane

func ConvertMetrics

func ConvertMetrics(ctx context.Context, metrics pmetric.Metrics) []*Metric

ConvertMetrics gets metric records from pmetrics

func (*Metric) AttributeString

func (m *Metric) AttributeString(name string, defaultValue string) string

AttributeString returns an Attribute as a string or the defaultValue if either an attribute with that name does not exist or an attribute with that name does exist but is not a string.

type Trace

type Trace struct {
	Name         string                 `json:"name"`
	TraceID      string                 `json:"trace_id"`
	SpanID       string                 `json:"span_id"`
	ParentSpanID string                 `json:"parent_span_id"`
	Start        time.Time              `json:"start"`
	End          time.Time              `json:"end"`
	Attributes   map[string]interface{} `json:"attributes"`
	Resource     map[string]interface{} `json:"resource"`
}

Trace is a trace record sent to bindplane

func ConvertTraces

func ConvertTraces(traces ptrace.Traces) []*Trace

ConvertTraces gets trace records from ptraces

Jump to

Keyboard shortcuts

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