Documentation
¶
Overview ¶
Package prometheusexporter exports metrics data as a Prometheus pull handler.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFactory ¶
NewFactory creates a new Prometheus exporter factory.
Types ¶
type Config ¶
type Config struct {
confighttp.ServerConfig `mapstructure:",squash"`
// QueueBatchConfig defines the queue configuration.
QueueBatchConfig configoptional.Optional[exporterhelper.QueueBatchConfig] `mapstructure:"sending_queue"`
// Namespace if set, exports metrics under the provided value.
Namespace string `mapstructure:"namespace"`
// ConstLabels are values that are applied for every exported metric.
ConstLabels prometheus.Labels `mapstructure:"const_labels"`
// SendTimestamps will send the underlying scrape timestamp with the export
SendTimestamps bool `mapstructure:"send_timestamps"`
// MetricExpiration defines how long metrics are kept without updates
MetricExpiration time.Duration `mapstructure:"metric_expiration"`
// ResourceToTelemetrySettings defines configuration for converting resource attributes to metric labels.
ResourceToTelemetrySettings resourcetotelemetry.Settings `mapstructure:"resource_to_telemetry_conversion"`
// EnableOpenMetrics enables the use of the OpenMetrics encoding option for the prometheus exporter.
EnableOpenMetrics bool `mapstructure:"enable_open_metrics"`
// WithoutScopeInfo controls the addition of labels for the instrumentation scope.
WithoutScopeInfo bool `mapstructure:"without_scope_info"`
// AddMetricSuffixes controls whether suffixes are added to metric names. Defaults to true.
//
// Deprecated: Use TranslationStrategy instead. This setting is ignored when TranslationStrategy is explicitly set.
AddMetricSuffixes bool `mapstructure:"add_metric_suffixes"`
// TranslationStrategy controls how OTLP metric and attribute names are translated into Prometheus metric and label names.
// When set, this takes precedence over AddMetricSuffixes.
TranslationStrategy translationStrategy `mapstructure:"translation_strategy"`
}
Config defines configuration for Prometheus exporter.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.