metrics

package
v0.0.0-...-4a59535 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Module provided to fxlog
	// https://uber-go.github.io/fx/modules.html
	Module = fx.Module(
		"otelmetrixfx",
		metricsProviders,
		metricsInvokes,
	)
)

Functions

This section is empty.

Types

type AppMetrics

type AppMetrics interface {
	metric.Meter
}

func NewAppMeter

func NewAppMeter(name string, opts ...metric.MeterOption) AppMetrics

type MetricsOptions

type MetricsOptions struct {
	Host                      string         `mapstructure:"host"`
	Port                      string         `mapstructure:"port"`
	ServiceName               string         `mapstructure:"serviceName"`
	Version                   string         `mapstructure:"version"`
	MetricsRoutePath          string         `mapstructure:"metricsRoutePath"`
	EnableHostMetrics         bool           `mapstructure:"enableHostMetrics"`
	UseStdout                 bool           `mapstructure:"useStdout"`
	InstrumentationName       string         `mapstructure:"instrumentationName"`
	UseOTLP                   bool           `mapstructure:"useOTLP"`
	OTLPProviders             []OTLPProvider `mapstructure:"otlpProviders"`
	ElasticApmExporterOptions *OTLPProvider  `mapstructure:"elasticApmExporterOptions"`
	UptraceExporterOptions    *OTLPProvider  `mapstructure:"uptraceExporterOptions"`
	SignozExporterOptions     *OTLPProvider  `mapstructure:"signozExporterOptions"`
}

func ProvideMetricsConfig

func ProvideMetricsConfig(
	environment environment.Environment,
) (*MetricsOptions, error)

type OTLPProvider

type OTLPProvider struct {
	Name         string            `mapstructure:"name"`
	Enabled      bool              `mapstructure:"enabled"`
	OTLPEndpoint string            `mapstructure:"otlpEndpoint"`
	OTLPHeaders  map[string]string `mapstructure:"otlpHeaders"`
}

type OtelMetrics

type OtelMetrics struct {
	// contains filtered or unexported fields
}

func NewOtelMetrics

func NewOtelMetrics(
	config *MetricsOptions,
	logger logger.Logger,
	environment environment.Environment,
) (*OtelMetrics, error)

NewOtelMetrics adds otel metrics

func (*OtelMetrics) RegisterMetricsEndpoint

func (o *OtelMetrics) RegisterMetricsEndpoint(
	server contracts.EchoHttpServer,
)

func (*OtelMetrics) Shutdown

func (o *OtelMetrics) Shutdown(ctx context.Context) error

Directories

Path Synopsis
mediatr
messaging

Jump to

Keyboard shortcuts

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