config

package
v0.60.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Index

Constants

View Source
const AlwaysReturnInfoMetrics = "always-return-info-metrics"

AlwaysReturnInfoMetrics is a feature flag used to enable the return of info metrics even when there are no corresponding CloudWatch metrics

View Source
const AwsSdkV2 = "aws-sdk-v2"

AwsSdkV2 is a feature flag used to enable the use of aws sdk v2 which is expected to come with performance benefits

Variables

View Source
var SupportedServices = serviceConfigs{
	{
		Namespace: "CWAgent",
		Alias:     "cwagent",
	},
	{
		Namespace: "AWS/Usage",
		Alias:     "usage",
	},
	{
		Namespace: "AWS/CertificateManager",
		Alias:     "acm",
		ResourceFilters: []*string{
			aws.String("acm:certificate"),
		},
	},
	{
		Namespace: "AWS/ACMPrivateCA",
		Alias:     "acm-pca",
		ResourceFilters: []*string{
			aws.String("acm-pca:certificate-authority"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("(?P<PrivateCAArn>.*)"),
		},
	},
	{
		Namespace: "AmazonMWAA",
		Alias:     "airflow",
		ResourceFilters: []*string{
			aws.String("airflow"),
		},
	},
	{
		Namespace: "AWS/MWAA",
		Alias:     "mwaa",
	},
	{
		Namespace: "AWS/ApplicationELB",
		Alias:     "alb",
		ResourceFilters: []*string{
			aws.String("elasticloadbalancing:loadbalancer/app"),
			aws.String("elasticloadbalancing:targetgroup"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":(?P<TargetGroup>targetgroup/.+)"),
			regexp.MustCompile(":loadbalancer/(?P<LoadBalancer>.+)$"),
		},
	},
	{
		Namespace: "AWS/AppStream",
		Alias:     "appstream",
		ResourceFilters: []*string{
			aws.String("appstream"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":fleet/(?P<FleetName>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/Backup",
		Alias:     "backup",
		ResourceFilters: []*string{
			aws.String("backup"),
		},
	},
	{
		Namespace: "AWS/ApiGateway",
		Alias:     "apigateway",
		ResourceFilters: []*string{
			aws.String("apigateway"),
		},
		DimensionRegexps: []*regexp.Regexp{

			regexp.MustCompile("/restapis/(?P<ApiName>[^/]+)$"),
			regexp.MustCompile("/restapis/(?P<ApiName>[^/]+)/stages/(?P<Stage>[^/]+)$"),

			regexp.MustCompile("/apis/(?P<ApiId>[^/]+)$"),
			regexp.MustCompile("/apis/(?P<ApiId>[^/]+)/stages/(?P<Stage>[^/]+)$"),
			regexp.MustCompile("/apis/(?P<ApiId>[^/]+)/routes/(?P<Route>[^/]+)$"),
		},
	},
	{
		Namespace: "AWS/AmazonMQ",
		Alias:     "mq",
		ResourceFilters: []*string{
			aws.String("mq"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("broker:(?P<Broker>[^:]+)"),
		},
	},
	{
		Namespace: "AWS/AppSync",
		Alias:     "appsync",
		ResourceFilters: []*string{
			aws.String("appsync"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("apis/(?P<GraphQLAPIId>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/Athena",
		Alias:     "athena",
		ResourceFilters: []*string{
			aws.String("athena"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("workgroup/(?P<WorkGroup>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/AutoScaling",
		Alias:     "asg",
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("autoScalingGroupName/(?P<AutoScalingGroupName>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/ElasticBeanstalk",
		Alias:     "beanstalk",
		ResourceFilters: []*string{
			aws.String("elasticbeanstalk:environment"),
		},
	},
	{
		Namespace: "AWS/Billing",
		Alias:     "billing",
	},
	{
		Namespace: "AWS/Cassandra",
		Alias:     "cassandra",
		ResourceFilters: []*string{
			aws.String("cassandra"),
		},
	},
	{
		Namespace: "AWS/CloudFront",
		Alias:     "cloudfront",
		ResourceFilters: []*string{
			aws.String("cloudfront:distribution"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("distribution/(?P<DistributionId>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/Cognito",
		Alias:     "cognito-idp",
		ResourceFilters: []*string{
			aws.String("cognito-idp:userpool"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("userpool/(?P<UserPool>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/DataSync",
		Alias:     "datasync",
		ResourceFilters: []*string{
			aws.String("datasync:task"),
			aws.String("datasync:agent"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":task/(?P<TaskId>[^/]+)"),
			regexp.MustCompile(":agent/(?P<AgentId>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/DMS",
		Alias:     "dms",
		ResourceFilters: []*string{
			aws.String("dms"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("rep:[^/]+/(?P<ReplicationInstanceIdentifier>[^/]+)"),
			regexp.MustCompile("task:(?P<ReplicationTaskIdentifier>[^/]+)/(?P<ReplicationInstanceIdentifier>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/DDoSProtection",
		Alias:     "shield",
		ResourceFilters: []*string{
			aws.String("shield:protection"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("(?P<ResourceArn>.+)"),
		},
	},
	{
		Namespace: "AWS/DocDB",
		Alias:     "docdb",
		ResourceFilters: []*string{
			aws.String("rds:db"),
			aws.String("rds:cluster"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("cluster:(?P<DBClusterIdentifier>[^/]+)"),
			regexp.MustCompile("db:(?P<DBInstanceIdentifier>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/DX",
		Alias:     "dx",
		ResourceFilters: []*string{
			aws.String("directconnect"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":dxcon/(?P<ConnectionId>[^/]+)"),
			regexp.MustCompile(":dxlag/(?P<LagId>[^/]+)"),
			regexp.MustCompile(":dxvif/(?P<VirtualInterfaceId>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/DynamoDB",
		Alias:     "dynamodb",
		ResourceFilters: []*string{
			aws.String("dynamodb:table"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":table/(?P<TableName>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/EBS",
		Alias:     "ebs",
		ResourceFilters: []*string{
			aws.String("ec2:volume"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("volume/(?P<VolumeId>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/ElastiCache",
		Alias:     "ec",
		ResourceFilters: []*string{
			aws.String("elasticache:cluster"),
			aws.String("elasticache:serverlesscache"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("cluster:(?P<CacheClusterId>[^/]+)"),
			regexp.MustCompile("serverlesscache:(?P<clusterId>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/MemoryDB",
		Alias:     "memorydb",
		ResourceFilters: []*string{
			aws.String("memorydb:cluster"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("cluster/(?P<ClusterName>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/EC2",
		Alias:     "ec2",
		ResourceFilters: []*string{
			aws.String("ec2:instance"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("instance/(?P<InstanceId>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/EC2Spot",
		Alias:     "ec2Spot",
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("(?P<FleetRequestId>.*)"),
		},
	},
	{
		Namespace: "AWS/ECS",
		Alias:     "ecs-svc",
		ResourceFilters: []*string{
			aws.String("ecs:cluster"),
			aws.String("ecs:service"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":cluster/(?P<ClusterName>[^/]+)$"),
			regexp.MustCompile(":service/(?P<ClusterName>[^/]+)/(?P<ServiceName>[^/]+)$"),
		},
	},
	{
		Namespace: "ECS/ContainerInsights",
		Alias:     "ecs-containerinsights",
		ResourceFilters: []*string{
			aws.String("ecs:cluster"),
			aws.String("ecs:service"),
		},
		DimensionRegexps: []*regexp.Regexp{

			regexp.MustCompile(":cluster/(?P<ClusterName>[^/]+)$"),
			regexp.MustCompile(":service/(?P<ClusterName>[^/]+)/(?P<ServiceName>[^/]+)$"),
		},
	},
	{
		Namespace: "AWS/EFS",
		Alias:     "efs",
		ResourceFilters: []*string{
			aws.String("elasticfilesystem:file-system"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("file-system/(?P<FileSystemId>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/ELB",
		Alias:     "elb",
		ResourceFilters: []*string{
			aws.String("elasticloadbalancing:loadbalancer"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":loadbalancer/(?P<LoadBalancerName>.+)$"),
		},
	},
	{
		Namespace: "AWS/ElasticMapReduce",
		Alias:     "emr",
		ResourceFilters: []*string{
			aws.String("elasticmapreduce:cluster"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("cluster/(?P<JobFlowId>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/EMRServerless",
		Alias:     "emr-serverless",
		ResourceFilters: []*string{
			aws.String("emr-serverless:applications"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("applications/(?P<ApplicationId>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/ES",
		Alias:     "es",
		ResourceFilters: []*string{
			aws.String("es:domain"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":domain/(?P<DomainName>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/Firehose",
		Alias:     "firehose",
		ResourceFilters: []*string{
			aws.String("firehose"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":deliverystream/(?P<DeliveryStreamName>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/FSx",
		Alias:     "fsx",
		ResourceFilters: []*string{
			aws.String("fsx:file-system"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("file-system/(?P<FileSystemId>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/GameLift",
		Alias:     "gamelift",
		ResourceFilters: []*string{
			aws.String("gamelift"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":fleet/(?P<FleetId>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/GatewayELB",
		Alias:     "gwlb",
		ResourceFilters: []*string{
			aws.String("elasticloadbalancing:loadbalancer/gwy"),
			aws.String("elasticloadbalancing:targetgroup"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":(?P<TargetGroup>targetgroup/.+)"),
			regexp.MustCompile(":loadbalancer/(?P<LoadBalancer>.+)$"),
		},
	},
	{
		Namespace: "AWS/GlobalAccelerator",
		Alias:     "ga",
		ResourceFilters: []*string{
			aws.String("globalaccelerator"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("accelerator/(?P<Accelerator>[^/]+)$"),
			regexp.MustCompile("accelerator/(?P<Accelerator>[^/]+)/listener/(?P<Listener>[^/]+)$"),
			regexp.MustCompile("accelerator/(?P<Accelerator>[^/]+)/listener/(?P<Listener>[^/]+)/endpoint-group/(?P<EndpointGroup>[^/]+)$"),
		},
	},
	{
		Namespace: "Glue",
		Alias:     "glue",
		ResourceFilters: []*string{
			aws.String("glue:job"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":job/(?P<JobName>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/IoT",
		Alias:     "iot",
		ResourceFilters: []*string{
			aws.String("iot:rule"),
			aws.String("iot:provisioningtemplate"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":rule/(?P<RuleName>[^/]+)"),
			regexp.MustCompile(":provisioningtemplate/(?P<TemplateName>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/Kafka",
		Alias:     "kafka",
		ResourceFilters: []*string{
			aws.String("kafka:cluster"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":cluster/(?P<Cluster_Name>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/KafkaConnect",
		Alias:     "kafkaconnect",
		ResourceFilters: []*string{
			aws.String("kafka:cluster"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":connector/(?P<Connector_Name>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/Kinesis",
		Alias:     "kinesis",
		ResourceFilters: []*string{
			aws.String("kinesis:stream"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":stream/(?P<StreamName>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/KinesisAnalytics",
		Alias:     "kinesis-analytics",
		ResourceFilters: []*string{
			aws.String("kinesisanalytics:application"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":application/(?P<Application>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/KMS",
		Alias:     "kms",
		ResourceFilters: []*string{
			aws.String("kms:key"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":key/(?P<KeyId>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/Lambda",
		Alias:     "lambda",
		ResourceFilters: []*string{
			aws.String("lambda:function"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":function:(?P<FunctionName>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/Logs",
		Alias:     "logs",
		ResourceFilters: []*string{
			aws.String("logs:log-group"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":log-group:(?P<LogGroupName>.+)"),
		},
	},
	{
		Namespace: "AWS/MediaConnect",
		Alias:     "mediaconnect",
		ResourceFilters: []*string{
			aws.String("mediaconnect:flow"),
			aws.String("mediaconnect:source"),
			aws.String("mediaconnect:output"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("^(?P<FlowARN>.*:flow:.*)$"),
			regexp.MustCompile("^(?P<SourceARN>.*:source:.*)$"),
			regexp.MustCompile("^(?P<OutputARN>.*:output:.*)$"),
		},
	},
	{
		Namespace: "AWS/MediaConvert",
		Alias:     "mediaconvert",
		ResourceFilters: []*string{
			aws.String("mediaconvert"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("(?P<Queue>.*:.*:mediaconvert:.*:queues/.*)$"),
		},
	},
	{
		Namespace: "AWS/MediaLive",
		Alias:     "medialive",
		ResourceFilters: []*string{
			aws.String("medialive:channel"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":channel:(?P<ChannelId>.+)$"),
		},
	},
	{
		Namespace: "AWS/MediaTailor",
		Alias:     "mediatailor",
		ResourceFilters: []*string{
			aws.String("mediatailor:playbackConfiguration"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("playbackConfiguration/(?P<ConfigurationName>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/Neptune",
		Alias:     "neptune",
		ResourceFilters: []*string{
			aws.String("rds:db"),
			aws.String("rds:cluster"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":cluster:(?P<DBClusterIdentifier>[^/]+)"),
			regexp.MustCompile(":db:(?P<DBInstanceIdentifier>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/NetworkFirewall",
		Alias:     "nfw",
		ResourceFilters: []*string{
			aws.String("network-firewall:firewall"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("firewall/(?P<FirewallName>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/NATGateway",
		Alias:     "ngw",
		ResourceFilters: []*string{
			aws.String("ec2:natgateway"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("natgateway/(?P<NatGatewayId>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/NetworkELB",
		Alias:     "nlb",
		ResourceFilters: []*string{
			aws.String("elasticloadbalancing:loadbalancer/net"),
			aws.String("elasticloadbalancing:targetgroup"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":(?P<TargetGroup>targetgroup/.+)"),
			regexp.MustCompile(":loadbalancer/(?P<LoadBalancer>.+)$"),
		},
	},
	{
		Namespace: "AWS/PrivateLinkEndpoints",
		Alias:     "vpc-endpoint",
		ResourceFilters: []*string{
			aws.String("ec2:vpc-endpoint"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":vpc-endpoint/(?P<VPC_Endpoint_Id>.+)"),
		},
	},
	{
		Namespace: "AWS/PrivateLinkServices",
		Alias:     "vpc-endpoint-service",
		ResourceFilters: []*string{
			aws.String("ec2:vpc-endpoint-service"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":vpc-endpoint-service/(?P<Service_Id>.+)"),
		},
	},
	{
		Namespace: "AWS/Prometheus",
		Alias:     "amp",
	},
	{
		Namespace: "AWS/QLDB",
		Alias:     "qldb",
		ResourceFilters: []*string{
			aws.String("qldb"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":ledger/(?P<LedgerName>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/RDS",
		Alias:     "rds",
		ResourceFilters: []*string{
			aws.String("rds:db"),
			aws.String("rds:cluster"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":cluster:(?P<DBClusterIdentifier>[^/]+)"),
			regexp.MustCompile(":db:(?P<DBInstanceIdentifier>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/Redshift",
		Alias:     "redshift",
		ResourceFilters: []*string{
			aws.String("redshift:cluster"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":cluster:(?P<ClusterIdentifier>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/Route53Resolver",
		Alias:     "route53-resolver",
		ResourceFilters: []*string{
			aws.String("route53resolver"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":resolver-endpoint/(?P<EndpointId>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/Route53",
		Alias:     "route53",
		ResourceFilters: []*string{
			aws.String("route53"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":healthcheck/(?P<HealthCheckId>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/RUM",
		Alias:     "rum",
	},
	{
		Namespace: "AWS/S3",
		Alias:     "s3",
		ResourceFilters: []*string{
			aws.String("s3"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("(?P<BucketName>[^:]+)$"),
		},
	},
	{
		Namespace: "AWS/SecretsManager",
		Alias:     "secretsmanager",
	},
	{
		Namespace: "AWS/SES",
		Alias:     "ses",
	},
	{
		Namespace: "AWS/States",
		Alias:     "sfn",
		ResourceFilters: []*string{
			aws.String("states"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("(?P<StateMachineArn>.*)"),
		},
	},
	{
		Namespace: "AWS/SNS",
		Alias:     "sns",
		ResourceFilters: []*string{
			aws.String("sns"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("(?P<TopicName>[^:]+)$"),
		},
	},
	{
		Namespace: "AWS/SQS",
		Alias:     "sqs",
		ResourceFilters: []*string{
			aws.String("sqs"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("(?P<QueueName>[^:]+)$"),
		},
	},
	{
		Namespace: "AWS/StorageGateway",
		Alias:     "storagegateway",
		ResourceFilters: []*string{
			aws.String("storagegateway"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":gateway/(?P<GatewayId>[^:]+)$"),
			regexp.MustCompile(":share/(?P<ShareId>[^:]+)$"),
			regexp.MustCompile("^(?P<GatewayId>[^:/]+)/(?P<GatewayName>[^:]+)$"),
		},
	},
	{
		Namespace: "AWS/TransitGateway",
		Alias:     "tgw",
		ResourceFilters: []*string{
			aws.String("ec2:transit-gateway"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":transit-gateway/(?P<TransitGateway>[^/]+)"),
			regexp.MustCompile("(?P<TransitGateway>[^/]+)/(?P<TransitGatewayAttachment>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/TrustedAdvisor",
		Alias:     "trustedadvisor",
	},
	{
		Namespace: "AWS/VPN",
		Alias:     "vpn",
		ResourceFilters: []*string{
			aws.String("ec2:vpn-connection"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":vpn-connection/(?P<VpnId>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/ClientVPN",
		Alias:     "clientvpn",
		ResourceFilters: []*string{
			aws.String("ec2:client-vpn-endpoint"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":client-vpn-endpoint/(?P<Endpoint>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/WAFV2",
		Alias:     "wafv2",
		ResourceFilters: []*string{
			aws.String("wafv2"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile("/webacl/(?P<WebACL>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/WorkSpaces",
		Alias:     "workspaces",
		ResourceFilters: []*string{
			aws.String("workspaces:workspace"),
			aws.String("workspaces:directory"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":workspace/(?P<WorkspaceId>[^/]+)$"),
			regexp.MustCompile(":directory/(?P<DirectoryId>[^/]+)$"),
		},
	},
	{
		Namespace: "AWS/AOSS",
		Alias:     "aoss",
		ResourceFilters: []*string{
			aws.String("aoss:collection"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":collection/(?P<CollectionId>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/SageMaker",
		Alias:     "sagemaker",
		ResourceFilters: []*string{
			aws.String("sagemaker:endpoint"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":endpoint/(?P<EndpointName>[^/]+)$"),
		},
	},
	{
		Namespace: "/aws/sagemaker/Endpoints",
		Alias:     "sagemaker-endpoints",
		ResourceFilters: []*string{
			aws.String("sagemaker:endpoint"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":endpoint/(?P<EndpointName>[^/]+)$"),
		},
	},
	{
		Namespace: "/aws/sagemaker/TrainingJobs",
		Alias:     "sagemaker-training",
		ResourceFilters: []*string{
			aws.String("sagemaker:training-job"),
		},
	},
	{
		Namespace: "/aws/sagemaker/ProcessingJobs",
		Alias:     "sagemaker-processing",
		ResourceFilters: []*string{
			aws.String("sagemaker:processing-job"),
		},
	},
	{
		Namespace: "/aws/sagemaker/TransformJobs",
		Alias:     "sagemaker-transform",
		ResourceFilters: []*string{
			aws.String("sagemaker:transform-job"),
		},
	},
	{
		Namespace: "/aws/sagemaker/InferenceRecommendationsJobs",
		Alias:     "sagemaker-inf-rec",
		ResourceFilters: []*string{
			aws.String("sagemaker:inference-recommendations-job"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":inference-recommendations-job/(?P<JobName>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/Sagemaker/ModelBuildingPipeline",
		Alias:     "sagemaker-model-building-pipeline",
		ResourceFilters: []*string{
			aws.String("sagemaker:pipeline"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":pipeline/(?P<PipelineName>[^/]+)"),
		},
	},
	{
		Namespace: "AWS/IPAM",
		Alias:     "ipam",
		ResourceFilters: []*string{
			aws.String("ec2:ipam-pool"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":ipam-pool/(?P<IpamPoolId>[^/]+)$"),
		},
	},
	{
		Namespace: "AWS/Bedrock",
		Alias:     "bedrock",
	},
	{
		Namespace: "AWS/Events",
		Alias:     "event-rule",
		ResourceFilters: []*string{
			aws.String("events"),
		},
		DimensionRegexps: []*regexp.Regexp{
			regexp.MustCompile(":rule/(?P<EventBusName>[^/]+)/(?P<RuleName>[^/]+)$"),
			regexp.MustCompile(":rule/aws.partner/(?P<EventBusName>.+)/(?P<RuleName>[^/]+)$"),
		},
	},
}

Functions

func CtxWithFlags added in v0.51.0

func CtxWithFlags(ctx context.Context, ctrl FeatureFlags) context.Context

CtxWithFlags injects a FeatureFlags inside a given context.Context, so that they are easily communicated through layers.

Types

type CustomNamespace

type CustomNamespace struct {
	Regions                   []string  `yaml:"regions"`
	Name                      string    `yaml:"name"`
	Namespace                 string    `yaml:"namespace"`
	RecentlyActiveOnly        bool      `yaml:"recentlyActiveOnly"`
	Roles                     []Role    `yaml:"roles"`
	Metrics                   []*Metric `yaml:"metrics"`
	CustomTags                []Tag     `yaml:"customTags"`
	DimensionNameRequirements []string  `yaml:"dimensionNameRequirements"`
	RoundingPeriod            *int64    `yaml:"roundingPeriod"`
	JobLevelMetricFields      `yaml:",inline"`
}

type Dimension

type Dimension struct {
	Name  string `yaml:"name"`
	Value string `yaml:"value"`
}

type Discovery

type Discovery struct {
	ExportedTagsOnMetrics ExportedTagsOnMetrics `yaml:"exportedTagsOnMetrics"`
	Jobs                  []*Job                `yaml:"jobs"`
}

type ExportedTagsOnMetrics added in v0.56.0

type ExportedTagsOnMetrics map[string][]string

type FeatureFlags added in v0.51.0

type FeatureFlags interface {
	// IsFeatureEnabled tells if the feature flag identified by flag is enabled.
	IsFeatureEnabled(flag string) bool
}

FeatureFlags is an interface all objects that can tell wether or not a feature flag is enabled can implement.

func FlagsFromCtx added in v0.51.0

func FlagsFromCtx(ctx context.Context) FeatureFlags

FlagsFromCtx retrieves a FeatureFlags from a given context.Context, defaulting to one with all feature flags disabled if none is found.

type Job

type Job struct {
	Regions                     []string  `yaml:"regions"`
	Type                        string    `yaml:"type"`
	Roles                       []Role    `yaml:"roles"`
	SearchTags                  []Tag     `yaml:"searchTags"`
	CustomTags                  []Tag     `yaml:"customTags"`
	DimensionNameRequirements   []string  `yaml:"dimensionNameRequirements"`
	Metrics                     []*Metric `yaml:"metrics"`
	RoundingPeriod              *int64    `yaml:"roundingPeriod"`
	RecentlyActiveOnly          bool      `yaml:"recentlyActiveOnly"`
	IncludeContextOnInfoMetrics bool      `yaml:"includeContextOnInfoMetrics"`
	JobLevelMetricFields        `yaml:",inline"`
}

type JobLevelMetricFields

type JobLevelMetricFields struct {
	Statistics             []string `yaml:"statistics"`
	Period                 int64    `yaml:"period"`
	Length                 int64    `yaml:"length"`
	Delay                  int64    `yaml:"delay"`
	NilToZero              *bool    `yaml:"nilToZero"`
	AddCloudwatchTimestamp *bool    `yaml:"addCloudwatchTimestamp"`
}

type Metric

type Metric struct {
	Name                   string   `yaml:"name"`
	Statistics             []string `yaml:"statistics"`
	Period                 int64    `yaml:"period"`
	Length                 int64    `yaml:"length"`
	Delay                  int64    `yaml:"delay"`
	NilToZero              *bool    `yaml:"nilToZero"`
	AddCloudwatchTimestamp *bool    `yaml:"addCloudwatchTimestamp"`
}

type Role

type Role struct {
	RoleArn    string `yaml:"roleArn"`
	ExternalID string `yaml:"externalId"`
}

func (*Role) ValidateRole

func (r *Role) ValidateRole(roleIdx int, parent string) error

type ScrapeConf

type ScrapeConf struct {
	APIVersion      string             `yaml:"apiVersion"`
	StsRegion       string             `yaml:"sts-region"`
	Discovery       Discovery          `yaml:"discovery"`
	Static          []*Static          `yaml:"static"`
	CustomNamespace []*CustomNamespace `yaml:"customNamespace"`
}

func (*ScrapeConf) Load

func (c *ScrapeConf) Load(file string, logger logging.Logger) (model.JobsConfig, error)

func (*ScrapeConf) Validate

func (c *ScrapeConf) Validate(logger logging.Logger) (model.JobsConfig, error)

type ServiceConfig

type ServiceConfig struct {
	// Namespace is the formal AWS namespace identification string
	Namespace string
	// Alias is the formal AWS namespace alias
	Alias string
	// ResourceFilters is a list of strings used as filters in the
	// resourcegroupstaggingapi.GetResources request. It should always
	// be provided, except for those few namespaces where resources can't
	// be tagged.
	ResourceFilters []*string
	// DimensionRegexps is an optional list of regexes that allow to
	// extract dimensions names from a resource ARN. The regex should
	// use named groups that correspond to AWS dimensions names.
	// In cases where the dimension name has a space, it should be
	// replaced with an underscore (`_`).
	DimensionRegexps []*regexp.Regexp
}

ServiceConfig defines a namespace supported by discovery jobs.

func (ServiceConfig) ToModelDimensionsRegexp added in v0.57.0

func (sc ServiceConfig) ToModelDimensionsRegexp() []model.DimensionsRegexp

type Static

type Static struct {
	Name       string      `yaml:"name"`
	Regions    []string    `yaml:"regions"`
	Roles      []Role      `yaml:"roles"`
	Namespace  string      `yaml:"namespace"`
	CustomTags []Tag       `yaml:"customTags"`
	Dimensions []Dimension `yaml:"dimensions"`
	Metrics    []*Metric   `yaml:"metrics"`
}

type Tag added in v0.56.0

type Tag struct {
	Key   string `yaml:"key"`
	Value string `yaml:"value"`
}

Jump to

Keyboard shortcuts

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