collector

package
v1.8.3 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package collector implements a test OTEL collector to use in unit tests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricRecord

type MetricRecord struct {
	ResourceAttributes map[string]string
	Attributes         map[string]string
	Name               string
	Unit               string
	Type               pmetric.MetricType
	IntVal             int64
	FloatVal           float64
	Count              int
}

MetricRecord stores some metadata from the received metrics

type TestCollector

type TestCollector struct {
	ServerEndpoint string
	// contains filtered or unexported fields
}

TestCollector is a dummy OLTP test collector that allows retrieving part of the collected metrics Useful for unit testing

func Start

func Start(ctx context.Context) (*TestCollector, error)

func (*TestCollector) Records

func (tc *TestCollector) Records() chan MetricRecord

func (*TestCollector) ResetRecords added in v1.7.0

func (tc *TestCollector) ResetRecords()

func (*TestCollector) ResetTraceRecords added in v1.7.0

func (tc *TestCollector) ResetTraceRecords()

func (*TestCollector) TraceRecords

func (tc *TestCollector) TraceRecords() chan TraceRecord

type TraceRecord

type TraceRecord struct {
	ResourceAttributes map[string]string
	Attributes         map[string]string
	Name               string
	Kind               ptrace.SpanKind
}

Jump to

Keyboard shortcuts

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