datadog

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDatadogClient

func GetDatadogClient() *dd.APIClient

GetDatadogClient returns Datadog client.

func GetDatadogContext

func GetDatadogContext() context.Context

GetDatadogContext returns Datadog authentication context.

func GetMetadata

func GetMetadata(ctx context.Context, ddClient *dd.APIClient) (*dd.MonitorSearchResponseMetadata, error)

GetMetadata returns Datadog SearchMonitors Metadata.

func ListMonitors

func ListMonitors(
	ctx context.Context, ddClient *dd.APIClient, metadata *dd.MonitorSearchResponseMetadata,
) ([]dd.MonitorSearchResult, error)

ListMonitors returns a list of Datadog monitors.

func MakeUniq

func MakeUniq(arr [][]string) [][]string

MakeUniq removes duplicated entries.

Types

type IntegrationTarget

type IntegrationTarget string

IntegrationTarget represents datadog integration service type.

const (
	// AwsMetricsPrefix represents Datadog AWS Integration metrics prefix.
	AwsMetricsPrefix = "aws"

	// AwsAPIGateway represents AWS API Gateway integration.
	AwsAPIGateway IntegrationTarget = "aws_apigateway"
	// AwsAutoScalingGroup represents AWS AutoScalingGroup integration.
	AwsAutoScalingGroup IntegrationTarget = "aws_autoscaling"
	// AwsClb represents AWS CLB integration.
	AwsClb IntegrationTarget = "aws_elb"
	// AwsDynamoDB represents AWS DynamoDB integration.
	AwsDynamoDB IntegrationTarget = "aws_dynamodb"
	// AwsElastiCache represents AWS ElastiCache integration.
	AwsElastiCache IntegrationTarget = "aws_elasticache"
	// AwsElb represents AWS ALB/NLB integration.
	AwsElb IntegrationTarget = "aws_applicationelb"
	// AwsFirehose represents AWS Firehose integration.
	AwsFirehose IntegrationTarget = "aws_firehose"
	// AwsKinesis represents AWS Kinesis integration.
	AwsKinesis IntegrationTarget = "aws_kinesis"
	// AwsOpenSearchService represents AWS OpenSearch Service integration.
	AwsOpenSearchService IntegrationTarget = "aws_elasticsearchservice"
	// AwsRds represents AWS RDS integration.
	AwsRds IntegrationTarget = "aws_rds"
	// AwsSns represents AWS SNS integration.
	AwsSns IntegrationTarget = "aws_sns"
	// AwsStepFunction represents AWS StepFunction integration.
	AwsStepFunction IntegrationTarget = "aws_states"
	// AwsSqs represents AWS SQS integration.
	AwsSqs IntegrationTarget = "aws_sqs"

	// UnknownIntegration represents unknonwn integration.
	UnknownIntegration IntegrationTarget = "unknown"
)

func MetricToIntegrationTarget

func MetricToIntegrationTarget(metric string) IntegrationTarget

MetricToIntegrationTarget returns the IntegrationTarget to which the specified metric belongs.

type MonitorScopesMapping

type MonitorScopesMapping = map[string][]Scope

MonitorScopesMapping represents a mapping of Datadog monitor ID and its scope.

func GetMonitorScopesMapping

func GetMonitorScopesMapping(monitors []dd.MonitorSearchResult) (MonitorScopesMapping, error)

GetMonitorScopesMapping returns the latest MonitorScopesMapping.

type MonitorTagsMapping

type MonitorTagsMapping = map[string]Tags

MonitorTagsMapping represents a mapping of Datadog monitor ID and its tags.

func GetMonitorTagsMapping

func GetMonitorTagsMapping(monitors []dd.MonitorSearchResult) (MonitorTagsMapping, error)

GetMonitorTagsMapping returns the latest MonitorTagsMapping.

type Scope

type Scope = []string

Scope represents Datadog monitor scope. cf. []string{"stage:production", "service:user"}.

type Tags

type Tags = []string

Tags represents Datadog tags.

Jump to

Keyboard shortcuts

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