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)