adapters

package
v0.78.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddHTTPSDConfigToPromConfig added in v0.78.0

func AddHTTPSDConfigToPromConfig(prometheus map[interface{}]interface{}, taServiceName string) (map[interface{}]interface{}, error)

AddHTTPSDConfigToPromConfig adds HTTP SD (Service Discovery) configuration to the Prometheus configuration. This function removes any existing service discovery configurations (e.g., `sd_configs`, `dns_sd_configs`, `file_sd_configs`, etc.) from the `scrape_configs` section and adds a single `http_sd_configs` configuration. The `http_sd_configs` points to the TA (Target Allocator) endpoint that provides the list of targets for the given job.

func AddTAConfigToPromConfig added in v0.78.0

func AddTAConfigToPromConfig(prometheus map[interface{}]interface{}, taServiceName string) (map[interface{}]interface{}, error)

AddTAConfigToPromConfig adds or updates the target_allocator configuration in the Prometheus configuration. If the `EnableTargetAllocatorRewrite` feature flag for the target allocator is enabled, this function removes the existing scrape_configs from the collector's Prometheus configuration as it's not required.

func ConfigToPromConfig

func ConfigToPromConfig(cfg string) (map[interface{}]interface{}, error)

ConfigToPromConfig converts the incoming configuration object into the Prometheus receiver config.

func UnescapeDollarSignsInPromConfig added in v0.78.0

func UnescapeDollarSignsInPromConfig(cfg string) (map[interface{}]interface{}, error)

UnescapeDollarSignsInPromConfig replaces "$$" with "$" in the "replacement" fields of both "relabel_configs" and "metric_relabel_configs" in a Prometheus configuration file.

func ValidatePromConfig added in v0.78.0

func ValidatePromConfig(config map[interface{}]interface{}, targetAllocatorEnabled bool, targetAllocatorRewriteEnabled bool) error

ValidatePromConfig checks if the prometheus receiver config is valid given other collector-level settings.

Types

This section is empty.

Jump to

Keyboard shortcuts

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