dt-obs-aws
Original:🇺🇸 English
Translated
AWS cloud resources including EC2, RDS, Lambda, ECS/EKS, VPC networking, load balancers, databases, serverless, messaging, and cost optimization. Monitor AWS infrastructure, analyze resource usage, optimize costs, and ensure security compliance.
3installs
Added on
NPX Install
npx skill4agent add dynatrace/dynatrace-for-ai dt-obs-awsTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →AWS Cloud Infrastructure
Monitor and analyze AWS resources using Dynatrace Smartscape and DQL. Query AWS services, optimize costs, manage security, and plan capacity across your AWS infrastructure.
When to Use This Skill
Use this skill when the user needs to work with AWS resources in Dynatrace. Load the reference file for the task type:
| Task | File to load |
|---|---|
| Inventory and topology queries | (no additional file — use core patterns above) |
| Query AWS metric timeseries (CPU, errors, latency) | Load |
| VPC topology, security groups, subnet analysis | Load |
| RDS, DynamoDB, ElastiCache investigation | Load |
| Lambda, ECS, EKS investigation | Load |
| ALB/NLB topology, API Gateway | Load |
| SQS, SNS, EventBridge, MSK | Load |
| Unattached resources, tag compliance, lifecycle | Load |
| Cost savings, unused resources | Load |
| Capacity headroom, subnet IP, ASG limits | Load |
| Security audit, encryption, public access | Load |
| SG rule analysis (0.0.0.0/0, open ports) | Load |
| S3 public access, bucket encryption | Load |
| EBS volume encryption audit | Load |
| Cost allocation, chargeback, ownership | Load |
Core Concepts
Entity Types
AWS resources use the prefix and can be queried using the function. All AWS entities are automatically discovered and modeled in Dynatrace Smartscape.
AWS_*smartscapeNodesCompute: , , , ,
Networking: , , , ,
Database: , , ,
Storage: , ,
Load Balancing: ,
Messaging: , , ,
AWS_EC2_INSTANCEAWS_LAMBDA_FUNCTIONAWS_ECS_CLUSTERAWS_ECS_SERVICEAWS_EKS_CLUSTERAWS_EC2_VPCAWS_EC2_SUBNETAWS_EC2_SECURITYGROUPAWS_EC2_NATGATEWAYAWS_EC2_VPCENDPOINTAWS_RDS_DBINSTANCEAWS_RDS_DBCLUSTERAWS_DYNAMODB_TABLEAWS_ELASTICACHE_CACHECLUSTERAWS_S3_BUCKETAWS_EC2_VOLUMEAWS_EFS_FILESYSTEMAWS_ELASTICLOADBALANCINGV2_LOADBALANCERAWS_ELASTICLOADBALANCINGV2_TARGETGROUPAWS_SQS_QUEUEAWS_SNS_TOPICAWS_EVENTS_EVENTBUSAWS_MSK_CLUSTERCommon AWS Fields
All AWS entities include:
- - AWS account identifier
aws.account.id - - AWS region (e.g., us-east-1)
aws.region - - Unique resource identifier
aws.resource.id - - Resource name
aws.resource.name - - Amazon Resource Name
aws.arn - - VPC identifier (for VPC-attached resources)
aws.vpc.id - - Subnet identifier
aws.subnet.id - - Availability zone
aws.availability_zone - - Security group IDs (array)
aws.security_group.id - - Resource tags (use
tags)tags[TagName]
Relationship Types
AWS entities use these relationship types:
- - Exclusive attachment (e.g., volume to instance)
is_attached_to - - Dependency relationship (e.g., instance uses security group)
uses - - Vertical relationship (e.g., instance runs on AZ)
runs_on - - Composition (e.g., instance in cluster)
is_part_of - - Aggregation (e.g., service belongs to cluster)
belongs_to - - Load balancing (e.g., target group balances instances)
balances - - Reverse of balances
balanced_by
AWS Metric Naming Convention
Dynatrace ingests AWS metrics and exposes them using this naming pattern:
cloud.aws.<service>.<MetricName>.By.<DimensionName>The is the lowercase AWS service name, is the original CloudWatch metric name (case-preserved), and is the CloudWatch dimension used for splitting.
<service><MetricName><DimensionName>EC2 examples:
| CloudWatch metric | Dynatrace metric key |
|---|---|
| |
| |
| |
| |
Other service examples:
| CloudWatch metric | Dynatrace metric key |
|---|---|
RDS | |
Lambda | |
SQS | |
ELB | |
To query a metric:
dql
timeseries cpu = avg(cloud.aws.ec2.CPUUtilization.By.InstanceId),
by: {dt.smartscape_source.id},
from: now()-1h
| limit 10Important: Never refer to these as "CloudWatch alerts" or "CloudWatch metrics" in output. Dynatrace monitors AWS resources natively through its AWS integration — these are Dynatrace metrics ingested from AWS.
Query Patterns
All AWS queries build on four core patterns. Master these and adapt them to any entity type.
Pattern 1: Resource Discovery
List resources by type, filter by account/region/VPC/tags, summarize counts:
dql
smartscapeNodes "AWS_*"
| filter aws.account.id == "<AWS_ACCOUNT_ID>" and aws.region == "<AWS_REGION>"
| summarize count = count(), by: {type}
| sort count descTo list a specific type, replace with the entity type (e.g., ). Add to select specific columns. Use for tag-based filtering.
"AWS_*""AWS_EC2_INSTANCE"| fields name, aws.account.id, aws.region, ...tags[TagName]Pattern 2: Configuration Parsing
Parse JSON for detailed configuration fields:
aws.objectdql
smartscapeNodes "AWS_RDS_DBINSTANCE"
| parse aws.object, "JSON:awsjson"
| fieldsAdd engine = awsjson[configuration][engine]
| summarize db_count = count(), by: {engine, aws.region}Common configuration fields by service:
- EC2: ,
instanceType,state[name]networkInterfaces[0][association][publicIp] - RDS: ,
engine,multiAZ,publiclyAccessible,storageEncrypted,dbInstanceClassstorageType - EBS: ,
volumeType,sizestate - Lambda: ,
runtimememorySize - LB: ,
schemednsName - KMS: ,
keyStatekeyUsage - ASG: ,
minSize,maxSizedesiredCapacity - Subnet: ,
availableIpAddressCountcidrBlock - S3:
versioningConfiguration[status] - SG: (array, use
securityGroupsto count)arraySize()
Pattern 3: Relationship Traversal
Follow relationships between resources:
dql
smartscapeNodes "AWS_ELASTICLOADBALANCINGV2_LOADBALANCER"
| parse aws.object, "JSON:awsjson"
| fieldsAdd dnsName = awsjson[configuration][dnsName], scheme = awsjson[configuration][scheme]
| traverse "balanced_by", "AWS_ELASTICLOADBALANCINGV2_TARGETGROUP", direction:backward, fieldsKeep:{dnsName, id}
| fieldsAdd targetGroupName = aws.resource.name
| traverse "balances", "AWS_EC2_INSTANCE", fieldsKeep: {targetGroupName, id}
| fieldsAdd loadBalancerDnsName = dt.traverse.history[-2][dnsName],
loadBalancerId = dt.traverse.history[-2][id],
targetGroupId = dt.traverse.history[-1][id]Key traversal pairs:
- LB → Target Groups:
traverse "balanced_by", "AWS_ELASTICLOADBALANCINGV2_TARGETGROUP", direction:backward - Target Group → Instances:
traverse "balances", "AWS_EC2_INSTANCE" - Target Group → Lambda Function:
traverse "balances", "AWS_LAMBDA_FUNCTION" - ECS Service → Cluster:
traverse "belongs_to", "AWS_ECS_CLUSTER" - ECS Service → Task Def:
traverse "uses", "AWS_ECS_TASKDEFINITION" - RDS Instance → Cluster:
traverse "is_part_of", "AWS_RDS_DBCLUSTER" - RDS Cluster → KMS Key:
traverse "uses", "AWS_KMS_KEY" - Instance → SG:
traverse "uses", "AWS_EC2_SECURITYGROUP" - Instance → Availability Zone:
traverse "runs_on", "AWS_AVAILABILITY_ZONE" - Instance → Subnet:
traverse "is_attached_to", "AWS_EC2_SUBNET" - Instance → VPC:
traverse "is_attached_to", "AWS_EC2_VPC" - Instance → Volume:
traverse "is_attached_to", "AWS_EC2_VOLUME", direction: backward - Lambda Function → IAM Role:
traverse "uses", "AWS_IAM_ROLE" - Lambda Function → Api Gateway V2:
traverse "uses", "AWS_APIGATEWAYV2_INTEGRATION", direction: backward - Instance → HOST:
traverse "runs_on", "HOST", direction: backward - SG blast radius: query instances, traverse to SGs,
summarize count(), by: {sg.name} - Use to carry fields through traversals,
fieldsKeepto access ancestor fieldsdt.traverse.history[-N]
Pattern 4: Tag-Based Ownership
Group resources by any tag for ownership/chargeback:
dql
smartscapeNodes "AWS_*"
| filter isNotNull(tags[<TAG_NAME>])
| summarize resource_count = count(), by: {tags[<TAG_NAME>], type}
| sort resource_count descReplace with any tag: , , , , , , . Replace with a specific type to scope to one service.
CostCenterOwnerTeamProjectEnvironmentApplicationDepartmentBusinessUnit"AWS_*"Find untagged resources:
| filter arraySize(tags) == 0Reference Guide
Load reference files for detailed queries when the core patterns above need service-specific adaptation.
| Reference | When to load | Key content |
|---|---|---|
| vpc-networking-security.md | VPC topology, security groups, subnets, NAT, VPN, peering | VPC resource mapping, SG blast radius, public IP detection |
| database-monitoring.md | RDS, DynamoDB, ElastiCache, Redshift | Multi-AZ checks, engine distribution, subnet groups, dependencies |
| serverless-containers.md | Lambda, ECS, EKS, App Runner | VPC-attached functions, service-to-cluster mapping, container networking |
| load-balancing-api.md | ALB/NLB topology, API Gateway, CloudFront | LB→TG→Instance traversal, listener config, API stage management |
| messaging-event-streaming.md | SQS, SNS, EventBridge, Kinesis, MSK | Queue/topic inventory, streaming analysis, name pattern matching |
| resource-management.md | Resource audits, tag compliance, lifecycle | Unattached resources, deleted resources, tag coverage analysis |
| cost-optimization.md | Cost savings, unused resources, sizing | EBS costs, instance types, runtime distribution, snapshot analysis |
| capacity-planning.md | Capacity analysis, scaling, IP utilization | ASG headroom, subnet IP counts, ECS desired vs running |
| security-compliance.md | Security audits, encryption, public access | SG rule analysis (0.0.0.0/0, open ports), S3 public access block, EBS encryption, SG blast radius, public DB/LB detection, IAM roles |
| resource-ownership.md | Chargeback, ownership, cost allocation | Tag-based grouping, multi-account summaries |
| events.md | Load to check Auto Scaling, Health, and CloudFormation events | CloudFormation, Auto Scaling, AWS Health events |
| workload-detection.md | Load to determine orchestration context and resolution path | LB, ASG, ECS, EKS, Batch detection for blast radius analysis |
| metrics-performance.md | Load to query metric timeseries for a specific resource | DQL timeseries patterns for EC2, Lambda, RDS, SQS, ELB, ECS, DynamoDB |
Best Practices
Query Optimization
- Filter early by account and region
- Use specific entity types (avoid wildcards when possible)
"AWS_*" - Limit results with for exploration
| limit N - Use checks before accessing nested fields
isNotNull()
Configuration Parsing
- Always parse with JSON parser:
aws.objectparse aws.object, "JSON:awsjson" - Use consistent field naming:
fieldsAdd configField = awsjson[configuration][field] - Check for null values after parsing
- Use for complex nested objects
toString()
Security Fields
- Security group IDs are arrays - use or
contains()expand - Parse for detailed security context
aws.object - Check ,
publiclyAccessible, and similar flagsstorageEncrypted
Tagging Strategy
- Use for filtering
tags[TagName] - Check for untagged resources
arraySize(tags) - Track tag coverage with summarize operations
Limitations and Notes
Smartscape Limitations
- AWS object configuration requires parsing with
parse aws.object, "JSON:awsjson" - AWS metrics are available as Dynatrace metrics using the naming convention (see AWS Metric Naming Convention)
cloud.aws.* - Resource discovery depends on AWS integration configuration
- Tag synchronization may have slight delays
Relationship Traversal
- Use for reverse relationships (e.g., target group → load balancer)
direction:backward - Use to maintain important fields through traversal
fieldsKeep - Access traversal history with
dt.traverse.history[-N] - Complex topologies may require multiple traverse operations
General Tips
- Use for human-readable resource names
getNodeName() - Handle null values gracefully with and
isNotNull()isNull() - Combine region and account filters for large environments
- Use for unique resource counts
countDistinct()