otelexporter

package
v0.0.0-...-e368295 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Otel                    = "otelexporter"
	StdoutKindExporter      = "stdout"
	OtlpGrpcKindExporter    = "otlp"
	PrometheusKindExporter  = "prometheus"
	Int64BoundaryMultiplier = 1e6

	MeterName  = "kindling-instrument"
	TracerName = "kindling-tracer"
)
View Source
const (
	CmonitorServiceNamePrefix = "cmonitor"
)

Variables

This section is empty.

Functions

func GetCommonLabels

func GetCommonLabels(withUserInfo bool, logger *component.TelemetryLogger) []attribute.KeyValue

func GetHostname

func GetHostname() string

GetHostname Return hostname if no error thrown, and set hostname 'unknown' otherwise.

func NewExporter

func NewExporter(config interface{}, telemetry *component.TelemetryTools) exporter.Exporter

func StartServer

func StartServer(exporter *prometheus.Exporter, telemetry *component.TelemetryTools, port string) error

func WithDescription

func WithDescription(metricName string) metric.InstrumentOption

Types

type AdapterConfig

type AdapterConfig struct {
	NeedTraceAsResourceSpan bool `mapstructure:"need_trace_as_span"`
	NeedTraceAsMetric       bool `mapstructure:"need_trace_as_metric"`
	NeedPodDetail           bool `mapstructure:"need_pod_detail"`
	StoreExternalSrcIP      bool `mapstructure:"store_external_src_ip"`
}

type AsyncMetricGroup

type AsyncMetricGroup struct {
}

type Config

type Config struct {
	ExportKind           string                           `mapstructure:"export_kind"`
	PromCfg              *PrometheusConfig                `mapstructure:"prometheus"`
	OtlpGrpcCfg          *OtlpGrpcConfig                  `mapstructure:"otlp"`
	StdoutCfg            *StdoutConfig                    `mapstructure:"stdout"`
	CustomLabels         map[string]string                `mapstructure:"custom_labels"`
	MetricAggregationMap map[string]MetricAggregationKind `mapstructure:"metric_aggregation_map"`
	AdapterConfig        *AdapterConfig                   `mapstructure:"adapter_config"`
}

type MemCleanUpConfig

type MemCleanUpConfig struct {
	Enabled       bool `mapstructure:"enable,omitempty"`
	RestartPeriod int  `mapstructure:"restart_period,omitempty"`
}

type MetricAggregationKind

type MetricAggregationKind string
const (
	MAGaugeKind     MetricAggregationKind = "gauge"
	MACounterKind   MetricAggregationKind = "counter"
	MAHistogramKind MetricAggregationKind = "histogram"
)

type OtelExporter

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

func (*OtelExporter) Consume

func (e *OtelExporter) Consume(dataGroup *model.DataGroup) error

func (*OtelExporter) Export

func (e *OtelExporter) Export(results []*adapter.AdaptedResult)

func (*OtelExporter) NewMeter

func (e *OtelExporter) NewMeter(telemetry *component.TelemetryTools) error

type OtelOutputExporters

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

type OtlpGrpcConfig

type OtlpGrpcConfig struct {
	CollectPeriod time.Duration `mapstructure:"collect_period,omitempty"`
	Endpoint      string        `mapstructure:"endpoint,omitempty"`
}

type PrometheusConfig

type PrometheusConfig struct {
	Port             string            `mapstructure:"port,omitempty"`
	WithMemory       bool              `mapstructure:"with_memory,omitempty"`
	MemCleanUpConfig *MemCleanUpConfig `mapstructure:"memcleanup"`
}

type StdoutConfig

type StdoutConfig struct {
	CollectPeriod time.Duration `mapstructure:"collect_period,omitempty"`
}

Jump to

Keyboard shortcuts

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