Documentation ¶
Index ¶
- func AddHTTPSDConfigToPromConfig(prometheus map[interface{}]interface{}, taServiceName string) (map[interface{}]interface{}, error)
- func AddTAConfigToPromConfig(prometheus map[interface{}]interface{}, taServiceName string) (map[interface{}]interface{}, error)
- func ConfigToPromConfig(cfg string) (map[interface{}]interface{}, error)
- func UnescapeDollarSignsInPromConfig(cfg string) (map[interface{}]interface{}, error)
- func ValidatePromConfig(config map[interface{}]interface{}, targetAllocatorEnabled bool, ...) error
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 ¶
ConfigToPromConfig converts the incoming configuration object into the Prometheus receiver config.
func UnescapeDollarSignsInPromConfig ¶ added in v0.78.0
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.