clusteragent

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const (

	// RealIPHeader refers to the cluster level check runner ip passed in the request headers
	RealIPHeader = "X-Real-Ip"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CLCRunnerClient

type CLCRunnerClient struct {
	sync.Once
	// contains filtered or unexported fields
}

CLCRunnerClient is required to query the API of Datadog Cluster Level Check Runner

func (*CLCRunnerClient) GetRunnerStats

func (c *CLCRunnerClient) GetRunnerStats(IP string) (types.CLCRunnersStats, error)

GetRunnerStats fetches the runner stats exposed by the Cluster Level Check Runner

func (*CLCRunnerClient) GetVersion

func (c *CLCRunnerClient) GetVersion(IP string) (version.Version, error)

GetVersion fetches the version of the CLC Runner

type CLCRunnerClientInterface

type CLCRunnerClientInterface interface {
	GetVersion(IP string) (version.Version, error)
	GetRunnerStats(IP string) (types.CLCRunnersStats, error)
}

CLCRunnerClientInterface is required to query the API of Datadog Cluster Level Check Runner

func GetCLCRunnerClient

func GetCLCRunnerClient() (CLCRunnerClientInterface, error)

GetCLCRunnerClient returns or init the CLCRunnerClient

type DCAClient

type DCAClient struct {
	ClusterAgentVersion version.Version // Version of the cluster-agent we're connected to
	// contains filtered or unexported fields
}

DCAClient is required to query the API of Datadog cluster agent

func (*DCAClient) ClusterAgentAPIEndpoint

func (c *DCAClient) ClusterAgentAPIEndpoint() string

ClusterAgentAPIEndpoint returns the Agent API Endpoint URL as a string

func (*DCAClient) GetCFAppsMetadataForNode

func (c *DCAClient) GetCFAppsMetadataForNode(nodename string) (map[string][]string, error)

GetCFAppsMetadataForNode returns the CF application tags from the Cluster Agent.

func (*DCAClient) GetClusterCheckConfigs

func (c *DCAClient) GetClusterCheckConfigs(nodeName string) (types.ConfigResponse, error)

GetClusterCheckConfigs is called by the clustercheck config provider

func (*DCAClient) GetEndpointsCheckConfigs

func (c *DCAClient) GetEndpointsCheckConfigs(nodeName string) (types.ConfigResponse, error)

GetEndpointsCheckConfigs is called by the endpointscheck config provider

func (*DCAClient) GetKubernetesMetadataNames

func (c *DCAClient) GetKubernetesMetadataNames(nodeName, ns, podName string) ([]string, error)

GetKubernetesMetadataNames queries the datadog cluster agent to get nodeName/podName registered Kubernetes metadata.

func (*DCAClient) GetNodeLabels

func (c *DCAClient) GetNodeLabels(nodeName string) (map[string]string, error)

GetNodeLabels returns the node labels from the Cluster Agent.

func (*DCAClient) GetPodsMetadataForNode

func (c *DCAClient) GetPodsMetadataForNode(nodeName string) (apiv1.NamespacesPodsStringsSet, error)

GetPodsMetadataForNode queries the datadog cluster agent to get nodeName registered Kubernetes pods metadata.

func (*DCAClient) GetVersion

func (c *DCAClient) GetVersion() (version.Version, error)

GetVersion fetches the version of the Cluster Agent. Used in the agent status command.

func (*DCAClient) PostClusterCheckStatus

func (c *DCAClient) PostClusterCheckStatus(nodeName string, status types.NodeStatus) (types.StatusResponse, error)

PostClusterCheckStatus is called by the clustercheck config provider

func (*DCAClient) Version

func (c *DCAClient) Version() version.Version

Version returns ClusterAgentVersion already stored in the DCAClient

type DCAClientInterface

type DCAClientInterface interface {
	Version() version.Version
	ClusterAgentAPIEndpoint() string

	GetVersion() (version.Version, error)
	GetNodeLabels(nodeName string) (map[string]string, error)
	GetPodsMetadataForNode(nodeName string) (apiv1.NamespacesPodsStringsSet, error)
	GetKubernetesMetadataNames(nodeName, ns, podName string) ([]string, error)
	GetCFAppsMetadataForNode(nodename string) (map[string][]string, error)

	PostClusterCheckStatus(nodeName string, status types.NodeStatus) (types.StatusResponse, error)
	GetClusterCheckConfigs(nodeName string) (types.ConfigResponse, error)
	GetEndpointsCheckConfigs(nodeName string) (types.ConfigResponse, error)
}

DCAClientInterface is required to query the API of Datadog cluster agent

func GetClusterAgentClient

func GetClusterAgentClient() (DCAClientInterface, error)

GetClusterAgentClient returns or init the DCAClient

Jump to

Keyboard shortcuts

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