prometheusexporter

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: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CmonitorServiceNamePrefix = "cmonitor"
)
View Source
const Type = "prometheus"

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

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 Config

type Config struct {
	PromCfg      *PrometheusConfig `mapstructure:"prometheus"`
	CustomLabels map[string]string `mapstructure:"custom_labels"`
	// MetricAggregationMap map[string]MetricAggregationKind `mapstructure:"metric_aggregation_map"`
	AdapterConfig *AdapterConfig `mapstructure:"adapter_config"`
}

type MetricAggregationKind

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

type PrometheusConfig

type PrometheusConfig struct {
	Endpoint string `mapstructure:"endpoint,omitempty"`
}

Jump to

Keyboard shortcuts

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