imetrics

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package imetrics supports recording and submission of internal metrics from Beyla

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Prometheus PrometheusConfig `yaml:"prometheus,omitempty"`
}

Config options for the different metrics exporters

type NoopReporter

type NoopReporter struct{}

NoopReporter is a metrics Reporter that just does nothing

func (NoopReporter) OTELMetricExport

func (n NoopReporter) OTELMetricExport(_ int)

func (NoopReporter) OTELMetricExportError

func (n NoopReporter) OTELMetricExportError(_ error)

func (NoopReporter) OTELTraceExport

func (n NoopReporter) OTELTraceExport(_ int)

func (NoopReporter) OTELTraceExportError

func (n NoopReporter) OTELTraceExportError(_ error)

func (NoopReporter) PrometheusRequest

func (n NoopReporter) PrometheusRequest(_, _ string)

func (NoopReporter) Start

func (n NoopReporter) Start(_ context.Context)

func (NoopReporter) TracerFlush

func (n NoopReporter) TracerFlush(_ int)

type PrometheusConfig

type PrometheusConfig struct {
	Port int    `yaml:"port,omitempty" env:"BEYLA_INTERNAL_METRICS_PROMETHEUS_PORT"`
	Path string `yaml:"path,omitempty" env:"BEYLA_INTERNAL_METRICS_PROMETHEUS_PATH"`
}

type PrometheusReporter

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

PrometheusReporter is an internal metrics Reporter that exports to Prometheus

func NewPrometheusReporter

func NewPrometheusReporter(cfg *PrometheusConfig, manager *connector.PrometheusManager) *PrometheusReporter

func (*PrometheusReporter) OTELMetricExport

func (p *PrometheusReporter) OTELMetricExport(len int)

func (*PrometheusReporter) OTELMetricExportError

func (p *PrometheusReporter) OTELMetricExportError(err error)

func (*PrometheusReporter) OTELTraceExport

func (p *PrometheusReporter) OTELTraceExport(len int)

func (*PrometheusReporter) OTELTraceExportError

func (p *PrometheusReporter) OTELTraceExportError(err error)

func (*PrometheusReporter) PrometheusRequest

func (p *PrometheusReporter) PrometheusRequest(port, path string)

func (*PrometheusReporter) Start

func (p *PrometheusReporter) Start(ctx context.Context)

func (*PrometheusReporter) TracerFlush

func (p *PrometheusReporter) TracerFlush(len int)

type Reporter

type Reporter interface {
	// Start the reporter
	Start(ctx context.Context)
	// TracerFlush is invoked every time the eBPF tracer flushes a group of len traces.
	TracerFlush(len int)
	// OTELMetricExport is invoked every time the OpenTelemetry Metrics exporter successfully exports metrics to
	// a remote collector. It accounts the length, in metrics, for each invocation.
	OTELMetricExport(len int)
	// OTELMetricExportError is invoked every time the OpenTelemetry Metrics export fails with an error
	OTELMetricExportError(err error)
	// OTELTraceExport is invoked every time the OpenTelemetry Traces exporter successfully exports traces to
	// a remote collector. It accounts the length, in traces, for each invocation.
	OTELTraceExport(i int)
	// OTELTraceExportError is invoked every time the OpenTelemetry Traces export fails with an error
	OTELTraceExportError(err error)
	// PrometheusRequest is invoked every time the Prometheus exporter is invoked, for a given port and path
	PrometheusRequest(port, path string)
}

Reporter of internal metrics

Jump to

Keyboard shortcuts

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