Documentation ¶
Overview ¶
Package endpoints ... Copyright 2019 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0
Package endpoints ... Copyright 2019 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0
Package endpoints ... Copyright 2019 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0
Package endpoints ... Copyright 2019 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0
Package endpoints ... Copyright 2019 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0
Index ¶
Constants ¶
const (
NodeLegacyHostIP = "LegacyHostIP"
)
COPIED FROM Prometheus code
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KubernetesTargetRetriever ¶
type KubernetesTargetRetriever struct {
// contains filtered or unexported fields
}
KubernetesTargetRetriever sets the watchers for the different Targets and listens for the arrival of new data from them.
func NewKubernetesTargetRetriever ¶
func NewKubernetesTargetRetriever(scrapeEnabledLabel string, requireScrapeEnabledLabelForNodes bool, options ...Option) (*KubernetesTargetRetriever, error)
NewKubernetesTargetRetriever creates a new KubernetesTargetRetriever setting the required label to identified targets that can be scrapped.
func (*KubernetesTargetRetriever) GetTargets ¶
func (k *KubernetesTargetRetriever) GetTargets() ([]Target, error)
GetTargets returns a slice with all the targets currently registered.
func (*KubernetesTargetRetriever) Name ¶
func (k *KubernetesTargetRetriever) Name() string
Name returns the identifying name of the KubernetesTargetRetriever.
func (*KubernetesTargetRetriever) Watch ¶
func (k *KubernetesTargetRetriever) Watch() error
Watch retrieves and caches an initial list of URLs and triggers a process in background
type Option ¶
type Option func(*KubernetesTargetRetriever) error
Option is implemented by functions that configure the KubernetesTargetRetriever
func WithInClusterConfig ¶
func WithInClusterConfig() Option
WithInClusterConfig configures the KubernetesTargetRetriever to load the Kubernetes configuration from within a running pod in the cluster (/var/run/secrets/kubernetes.io/serviceaccount/*)
func WithKubeConfig ¶
WithKubeConfig configures the KubernetesTargetRetriever to load the Kubernetes configuration from a kubeconfig file. This file is usually found in ~/.kube/config
type TLSConfig ¶
type TLSConfig struct { CaFilePath string `mapstructure:"ca_file_path"` CertFilePath string `mapstructure:"cert_file_path"` KeyFilePath string `mapstructure:"key_file_path"` InsecureSkipVerify bool `mapstructure:"insecure_skip_verify"` }
TLSConfig is used to store all the configuration required to use Mutual TLS authentication.
type Target ¶
type Target struct { Name string Object Object URL url.URL TLSConfig TLSConfig // contains filtered or unexported fields }
Target is a prometheus endpoint which is exposed by an Object.
func EndpointToTarget ¶
func EndpointToTarget(tc TargetConfig) ([]Target, error)
EndpointToTarget returns a list of Targets from the provided TargetConfig struct. The URL processing for every Target follows the next conventions: - if no schema is provided, it assumes http - if no path is provided, it assumes /metrics For example, hostname:8080 will be interpreted as http://hostname:8080/metrics
type TargetConfig ¶
type TargetConfig struct { Description string URLs []string `mapstructure:"urls"` TLSConfig TLSConfig `mapstructure:"tls_config"` }
TargetConfig is used to parse endpoints from the configuration file.
type TargetRetriever ¶
TargetRetriever is implemented by any type that can return the URL of a set of Prometheus metrics providers
func FixedRetriever ¶
func FixedRetriever(targetCfgs ...TargetConfig) (TargetRetriever, error)
FixedRetriever creates a TargetRetriver that returns the targets belonging to the URLs passed as arguments
func SelfRetriever ¶
func SelfRetriever() (TargetRetriever, error)
SelfRetriever creates a TargetRetriver that returns the targets belonging to nri-prometheus.