metricgen

package
v0.0.0-...-07f4370 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package metricgen generates Elastic APM V2 and OTLP data for smoke testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigOption

type ConfigOption func(*config)

func WithAPIKey

func WithAPIKey(s string) ConfigOption

func WithAPMServerURL

func WithAPMServerURL(s string) ConfigOption

func WithElasticAPMServiceName

func WithElasticAPMServiceName(s string) ConfigOption

WithElasticAPMServiceName specifies the service name that the Elastic APM agent will use.

This config will be ignored when using SendOTLPTrace.

func WithOTLPProtocol

func WithOTLPProtocol(p string) ConfigOption

WithOTLPProtocol specifies OTLP transport protocol to one of: grpc (default), http/protobuf.

This config will be ignored when using SendIntakeV2Trace

func WithOTLPServiceName

func WithOTLPServiceName(s string) ConfigOption

WithOTLPServiceName specifies the service name that the OpenTelemetry SDK will use.

This config will be ignored when using SendIntakeV2Trace.

func WithVerifyServerCert

func WithVerifyServerCert(b bool) ConfigOption

type EventStats

type EventStats struct {
	// MetricSent holds the number of metrics events sent.
	MetricSent int
}

EventStats holds client-side stats.

func SendIntakeV2

func SendIntakeV2(_ context.Context, opts ...ConfigOption) (EventStats, error)

SendIntakeV2 sends specific metrics to the configured Elastic APM intake V2.

Metrics sent are: - apm(float64, value=1.0); gathered from a apm.MetricGatherer - apmotel(float64, value=1.0); gathered from a otel MeterProvider through apmotel bridge All builtin APM Agent metrics have been disabled.

func SendOTLP

func SendOTLP(ctx context.Context, opts ...ConfigOption) (EventStats, error)

SendOTLP sends specific metrics to the configured Elastic APM OTLP intake.

Metrics are sent via the specified protocol.

Metrics sent are: - otlp(float64, value=1.0)

func (*EventStats) Add

func (e *EventStats) Add(metricSent int)

Add adds the statistics together.

type Gatherer

type Gatherer struct {
}

func (Gatherer) GatherMetrics

func (e Gatherer) GatherMetrics(ctx context.Context, out *apm.Metrics) error

GatherMetrics gathers metrics into out.

Jump to

Keyboard shortcuts

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