test

package
v0.0.0-...-611c183 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSpanWithDuration

func GenerateSpanWithDuration(t *testing.T, spanName string, duration time.Duration) *ptrace.Span

GenerateSpanWithDuration returns a span with specified span name and duration.

Types

type GeneratedLogs

type GeneratedLogs struct {
	Logs  []*plog.LogRecord
	RLogs []*plog.ResourceLogs
	SLogs []*plog.ScopeLogs
}

func GenerateOTLPLogsPayload

func GenerateOTLPLogsPayload(t *testing.T, traceID, resourceCount int, scopeCount []int, spanCount [][]int) (plog.Logs, *GeneratedLogs)

type GeneratedMetrics

type GeneratedMetrics struct {
	Metrics  []*pmetric.Metric
	RMetrics []*pmetric.ResourceMetrics
	SMetrics []*pmetric.ScopeMetrics
}

func GenerateOTLPMetricsPayload

func GenerateOTLPMetricsPayload(t *testing.T, resourceCount int, scopeCount []int, dpCount [][]int) (pmetric.Metrics, *GeneratedMetrics)

type GeneratedSpans

type GeneratedSpans struct {
	Spans  []*ptrace.Span
	RSpans []*ptrace.ResourceSpans
	SSpans []*ptrace.ScopeSpans
}

func GenerateOTLPTracesPayload

func GenerateOTLPTracesPayload(t *testing.T, traceID, resourceCount int, scopeCount []int, spanCount [][]int) (ptrace.Traces, *GeneratedSpans)

This is written referencing following code: https://github.com/CtrlSpice/otel-desktop-viewer/blob/af38ec47a37564e5f03b6d9cefa20b2422033e03/desktopexporter/testdata/trace.go

Jump to

Keyboard shortcuts

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