Documentation ¶
Overview ¶
Package clusteragent provides clients for the APIs exposed by the Cluster Agent and the Cluster Check Runners.
Index ¶
- Constants
- type CLCRunnerClient
- type CLCRunnerClientInterface
- type DCAClient
- func (c *DCAClient) ClusterAgentAPIEndpoint() string
- func (c *DCAClient) GetCFAppsMetadataForNode(nodename string) (map[string][]string, error)
- func (c *DCAClient) GetClusterCheckConfigs(ctx context.Context, identifier string) (types.ConfigResponse, error)
- func (c *DCAClient) GetEndpointsCheckConfigs(ctx context.Context, nodeName string) (types.ConfigResponse, error)
- func (c *DCAClient) GetKubernetesClusterID() (string, error)
- func (c *DCAClient) GetKubernetesMetadataNames(nodeName, ns, podName string) ([]string, error)
- func (c *DCAClient) GetNamespaceLabels(nsName string) (map[string]string, error)
- func (c *DCAClient) GetNamespaceMetadata(nsName string) (*Metadata, error)
- func (c *DCAClient) GetNodeAnnotations(nodeName string) (map[string]string, error)
- func (c *DCAClient) GetNodeLabels(nodeName string) (map[string]string, error)
- func (c *DCAClient) GetPodsMetadataForNode(nodeName string) (apiv1.NamespacesPodsStringsSet, error)
- func (c *DCAClient) PostClusterCheckStatus(ctx context.Context, identifier string, status types.NodeStatus) (types.StatusResponse, error)
- func (c *DCAClient) PostLanguageMetadata(ctx context.Context, data *pbgo.ParentLanguageAnnotationRequest) error
- func (c *DCAClient) SupportsNamespaceMetadataCollection() bool
- func (c *DCAClient) Version(withRefresh bool) version.Version
- type DCAClientInterface
- type Metadata
Constants ¶
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 ¶
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) GetRunnerWorkers ¶
func (c *CLCRunnerClient) GetRunnerWorkers(IP string) (types.Workers, error)
GetRunnerWorkers fetches the runner workers information 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) GetRunnerWorkers(IP string) (types.Workers, 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 {
// contains filtered or unexported fields
}
DCAClient is required to query the API of Datadog cluster agent
func (*DCAClient) ClusterAgentAPIEndpoint ¶
ClusterAgentAPIEndpoint returns the Agent API Endpoint URL as a string
func (*DCAClient) GetCFAppsMetadataForNode ¶
GetCFAppsMetadataForNode returns the CF application tags from the Cluster Agent.
func (*DCAClient) GetClusterCheckConfigs ¶
func (c *DCAClient) GetClusterCheckConfigs(ctx context.Context, identifier string) (types.ConfigResponse, error)
GetClusterCheckConfigs is called by the clustercheck config provider
func (*DCAClient) GetEndpointsCheckConfigs ¶
func (c *DCAClient) GetEndpointsCheckConfigs(ctx context.Context, nodeName string) (types.ConfigResponse, error)
GetEndpointsCheckConfigs is called by the endpointscheck config provider
func (*DCAClient) GetKubernetesClusterID ¶ added in v0.9.0
GetKubernetesClusterID queries the datadog cluster agent to get the Kubernetes cluster ID Prefer calling clustername.GetClusterID which has a cached response
func (*DCAClient) GetKubernetesMetadataNames ¶
GetKubernetesMetadataNames queries the datadog cluster agent to get nodeName/podName registered Kubernetes metadata.
func (*DCAClient) GetNamespaceLabels ¶ added in v0.9.0
GetNamespaceLabels returns the namespace labels from the Cluster Agent.
func (*DCAClient) GetNamespaceMetadata ¶
GetNamespaceMetadata returns the namespace metadata from the Cluster Agent.
func (*DCAClient) GetNodeAnnotations ¶
GetNodeAnnotations returns the node annotations from the Cluster Agent.
func (*DCAClient) GetNodeLabels ¶
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) PostClusterCheckStatus ¶
func (c *DCAClient) PostClusterCheckStatus(ctx context.Context, identifier string, status types.NodeStatus) (types.StatusResponse, error)
PostClusterCheckStatus is called by the clustercheck config provider
func (*DCAClient) PostLanguageMetadata ¶
func (c *DCAClient) PostLanguageMetadata(ctx context.Context, data *pbgo.ParentLanguageAnnotationRequest) error
PostLanguageMetadata is called by the core-agent's language detection client
func (*DCAClient) SupportsNamespaceMetadataCollection ¶
SupportsNamespaceMetadataCollection returns true only if the cluster agent supports collecting namespace metadata
type DCAClientInterface ¶
type DCAClientInterface interface { Version(withRefresh bool) version.Version ClusterAgentAPIEndpoint() string GetNodeLabels(nodeName string) (map[string]string, error) GetNodeAnnotations(nodeName string) (map[string]string, error) GetNamespaceLabels(nsName string) (map[string]string, error) GetNamespaceMetadata(nsName string) (*Metadata, error) GetPodsMetadataForNode(nodeName string) (apiv1.NamespacesPodsStringsSet, error) GetKubernetesMetadataNames(nodeName, ns, podName string) ([]string, error) GetCFAppsMetadataForNode(nodename string) (map[string][]string, error) PostClusterCheckStatus(ctx context.Context, nodeName string, status types.NodeStatus) (types.StatusResponse, error) GetClusterCheckConfigs(ctx context.Context, nodeName string) (types.ConfigResponse, error) GetEndpointsCheckConfigs(ctx context.Context, nodeName string) (types.ConfigResponse, error) GetKubernetesClusterID() (string, error) PostLanguageMetadata(ctx context.Context, data *pbgo.ParentLanguageAnnotationRequest) error SupportsNamespaceMetadataCollection() bool }
DCAClientInterface is required to query the API of Datadog cluster agent
func GetClusterAgentClient ¶
func GetClusterAgentClient() (DCAClientInterface, error)
GetClusterAgentClient returns or init the DCAClient