ServiceLens troubleshooting
The following sections can help if you're having issues with CloudWatch ServiceLens.
I don't see all my logs
How to configure logs to appear in ServiceLens depends on the service.
-
API Gateway logs appear if logging is turned on in API Gateway.
-
Amazon ECS and Amazon EKS logs appear if you are using the latest versions of the X-Ray SDK and the CloudWatch agent. For more information, see Deploying ServiceLens.
-
Lambda logs appear if the request ID is in the log entry. This happens automatically for the situations listed in the following table. For other cases, where the runtime does not automatically include the trace ID, you can manually include the trace ID.
Runtime | Method | Request ID automatically in log entry? |
---|---|---|
Java |
context.getLogger.log aws-lambda-java-log4j2 |
Yes |
Java |
System.out.println |
No |
Python |
context.log logging.info/error/log/etc... |
Yes |
Python |
|
No |
Node.js |
context.log console.log/info/error/etc... |
Yes |
dotnet |
context.Logger.log Console.WriteLine() |
No |
Go |
fmt.Printf log.Print |
No |
Ruby |
puts |
No |
Not all service map nodes support viewing associated logs. View logs for any of the following node types:
Lambda Context
Lambda Function
API Gateway Stage
ECS Cluster
ECS Instance
ECS Service
ECS Task
EKS Cluster
EKS Namespace
EKS Node
EKS Pod
EKS Service
I don't see all my alarms on the service map
ServiceLens shows only the alert icon for a node if any alarms associated with that node are in the ALARM state.
ServiceLens associates alarms with nodes using the following logic:
-
If the node represents an Amazon service, then all alarms with the namespace associated with that service are associated with the node. For example, a node of type
AWS::Kinesis
is linked with all alarms that are based on metrics in the CloudWatch namespaceAWS/Kinesis
. -
If the node represents an Amazon resource, then the alarms on that specific resource are linked. For example, a node of type
AWS::DynamoDB::Table
with the name “MyTable” is linked to all alarms that are based on a metric with the namespaceAWS/DynamoDB
and have theTableName
dimension set toMyTable
. -
If the node is of unknown type, which is identified by a dashed border around the name, then no alarms are associated with that node.
I don't see some Amazon resources on the service map
For Amazon resources to be traced on the service map, the Amazon SDK must be captured using the X-Ray SDK. For more information about X-Ray, see What Is Amazon X-Ray.
Not every Amazon resource is represented by a dedicated node. Some Amazon services are represented by a single node for all requests to the service. The following resource types are displayed with a node per resource:
-
AWS::DynamoDB::Table
-
AWS::Lambda::Function
Lambda functions are represented by two nodes— one for the Lambda Container, and one for the function. This helps to identify cold start problems with Lambda functions. Lambda container nodes are associated with alarms and dashboards in the same way as Lambda function nodes.
-
AWS::ApiGateway::Stage
-
AWS::SQS::Queue
-
AWS::SNS::Topic
There are too many nodes on my service map
Use X-Ray groups to break your map into multiple maps. For more information, see Using Filter Expressions with Groups.