imetrics

package
v1.10.0-alloy Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package imetrics supports recording and submission of internal metrics from Beyla

Index

Constants

View Source
const (
	InternalMetricsExporterDisabled   = InternalMetricsExporter("disabled")
	InternalMetricsExporterPrometheus = InternalMetricsExporter("prometheus")
	InternalMetricsExporterOTEL       = InternalMetricsExporter("otel")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Prometheus PrometheusConfig        `yaml:"prometheus,omitempty"`
	Exporter   InternalMetricsExporter `yaml:"exporter,omitempty" env:"BEYLA_INTERNAL_METRICS_EXPORTER"`
}

Config options for the different metrics exporters

type InternalMetricsExporter

type InternalMetricsExporter string

func (InternalMetricsExporter) Valid

func (t InternalMetricsExporter) Valid() bool

type NoopReporter

type NoopReporter struct{}

NoopReporter is a metrics Reporter that just does nothing

func (NoopReporter) InstrumentProcess added in v1.7.0

func (n NoopReporter) InstrumentProcess(_ string)

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)

func (NoopReporter) UninstrumentProcess added in v1.7.0

func (n NoopReporter) UninstrumentProcess(_ string)

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, registry *prometheus.Registry) *PrometheusReporter

func (*PrometheusReporter) InstrumentProcess added in v1.7.0

func (p *PrometheusReporter) InstrumentProcess(processName string)

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)

func (*PrometheusReporter) UninstrumentProcess added in v1.7.0

func (p *PrometheusReporter) UninstrumentProcess(processName string)

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)
	// InstrumentProcess is invoked every time a new process is instrumented
	InstrumentProcess(processName string)
	// UninstrumentProcess is invoked every time a process is removed from the instrumented processed
	UninstrumentProcess(processName string)
}

Reporter of internal metrics

Jump to

Keyboard shortcuts

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