collector

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 12 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 {
	Attributes map[string]string
	Name       string
	Unit       string
	Type       pmetric.MetricType
}

MetricRecord stores some metadata from the received metrics

type TestCollector

type TestCollector struct {
	ServerEndpoint string
	// TODO: add also traces history
	Records      chan MetricRecord
	TraceRecords chan TraceRecord
}

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)

type TraceRecord

type TraceRecord struct {
	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