Documentation Index
Fetch the complete documentation index at: https://private-7c7dfe99-page-updates.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Monitoring AWS CloudWatch Logs with ClickStack
TL;DRForward AWS CloudWatch logs to ClickStack using the OpenTelemetry Collector’s CloudWatch receiver. Supports named log groups and autodiscovery. Includes a demo dataset and pre-built dashboard.
Overview
AWS CloudWatch is a monitoring service for AWS resources and applications. While CloudWatch provides log aggregation, forwarding logs to ClickStack allows you to:- Analyze logs alongside metrics and traces in a unified platform
- Query logs using ClickHouse’s SQL interface
- Reduce costs by archiving or reducing CloudWatch retention
Integration with existing CloudWatch log groups
This section covers configuring the OpenTelemetry Collector to pull logs from your existing CloudWatch log groups and forward them to ClickStack. If you would like to test the integration before configuring your production setup, you can test with our demo dataset in the demo dataset section.Prerequisites
- ClickStack instance running
- AWS account with CloudWatch log groups
- AWS credentials with appropriate IAM permissions
Unlike file-based log integrations (nginx, Redis), CloudWatch requires running a separate OpenTelemetry Collector that polls the CloudWatch API. This collector can’t run inside ClickStack’s all-in-one image as it needs AWS credentials and API access.
Get ClickStack API key
The OpenTelemetry Collector sends data to ClickStack’s OTLP endpoint, which requires authentication.- Open HyperDX at your ClickStack URL (e.g., http://localhost:8080)
- Create an account or log in if needed
- Navigate to Team Settings → API Keys
- Copy your Ingestion API Key
Configure AWS credentials
Export your AWS credentials as environment variables. The method depends on your authentication type:For AWS SSO users (recommended for most organizations):YOUR_PROFILE_NAME with your AWS SSO profile name (e.g., AccountAdministrators-123456789).For IAM users with long-term credentials:YOUR_ACCOUNT_ID with your AWS account ID.Configure the CloudWatch receiver
Create anotel-collector-config.yaml file with the CloudWatch receiver configuration.Example 1: Named log groups (recommended)This configuration collects logs from specific named log groups:/aws/lambda:region: AWS region where your log groups are locatedpoll_interval: How often to check for new logs (e.g.,1m,5m)max_events_per_request: Maximum number of log events to fetch per requestgroups.autodiscover.limit: Maximum number of log groups to discovergroups.autodiscover.prefix: Filter log groups by prefixgroups.named: Explicitly list log group names to collect
${CLICKSTACK_API_KEY}→ Uses the environment variable you set earlierhttp://localhost:4318→ Your ClickStack endpoint (use your ClickStack host if running remotely)us-east-1→ Your AWS region- Log group names/prefixes → Your actual CloudWatch log groups
The CloudWatch receiver only fetches logs from recent time windows (based on
poll_interval). When first started, it begins from the current time. Historical logs aren’t retrieved by default.Verify logs in HyperDX
Once the collector is running:- Open HyperDX at http://localhost:8080 (or your ClickStack URL)
- Navigate to the Logs view
- Wait 1-2 minutes for logs to appear (based on your poll interval)
- Search for logs from your CloudWatch log groups
ResourceAttributes['aws.region']: Your AWS region (e.g., “us-east-1”)ResourceAttributes['cloudwatch.log.group.name']: The CloudWatch log group nameResourceAttributes['cloudwatch.log.stream']: The log stream nameBody: The actual log message content
Demo dataset
For users who want to test the CloudWatch logs integration before configuring their production AWS environment, we provide a sample dataset with pre-generated logs showing realistic patterns from multiple AWS services.Download the sample dataset
- Lambda functions: Payment processing, order management, authentication
- ECS services: API gateway with rate limiting and timeouts
- Background jobs: Batch processing with retry patterns
Start ClickStack
If you don’t already have ClickStack running:Verify the demo data
Once imported:- Open HyperDX at http://localhost:8080 and log in (create an account if needed)
- Navigate to the Logs view
- Set the time range to 2025-12-07 00:00:00 - 2025-12-08 00:00:00 (UTC)
- Search for
cloudwatch-demoor filter byLogAttributes['source'] = 'cloudwatch-demo'
Timezone DisplayHyperDX displays timestamps in your browser’s local timezone. The demo data spans 2025-12-07 00:00:00 - 2025-12-08 00:00:00 (UTC). Set your time range to 2025-12-06 00:00:00 - 2025-12-09 00:00:00 to ensure you see the demo logs regardless of your location. Once you see the logs, you can narrow the range to a 24-hour period for clearer visualizations.
Dashboards and visualization
To help you monitor CloudWatch logs with ClickStack, we provide a pre-built dashboard with essential visualizations.the dashboard configuration
Import the dashboard
- Open HyperDX and navigate to the Dashboards section
- Click Import Dashboard in the upper right corner under the ellipses
- Upload the
cloudwatch-logs-dashboard.jsonfile and click Finish Import
View the dashboard
The dashboard will be created with all visualizations pre-configured:For the demo dataset, set the time range to 2025-12-07 00:00:00 - 2025-12-08 00:00:00 (UTC) (adjust based on your local timezone). The imported dashboard won’t have a time range specified by default.
Troubleshooting
No logs appearing in HyperDX
Verify AWS credentials are configured:logs:DescribeLogGroups and logs:FilterLogEvents permissions.
Check collector logs for errors:
The security token included in the request is invalid: Credentials are invalid or expired. For temporary credentials (SSO), ensureAWS_SESSION_TOKENis set.operation error CloudWatch Logs: FilterLogEvents, AccessDeniedException: IAM permissions are insufficientfailed to refresh cached credentials, no EC2 IMDS role found: AWS credentials environment variables aren’t setconnection refused: ClickStack endpoint is unreachable
Only seeing old logs or missing recent logs
The CloudWatch receiver starts from “now” by default: When the collector first starts, it creates a checkpoint at the current time and only fetches logs after that point. Historical logs aren’t retrieved. To collect recent historical logs: Stop and remove the collector’s checkpoint, then restart:Invalid security token / credentials expired
If using temporary credentials (AWS SSO, assumed role), they expire after a period of time. Re-export fresh credentials:High latency or missing recent logs
Reduce poll interval: The defaultpoll_interval is 1 minute. For near-real-time logs, reduce it:
Collector using too much memory
Reduce batch size or increase timeout:Next steps
- Set up alerts for critical events (connection failures, error spikes)
- Reduce CloudWatch costs by adjusting retention periods or archiving to S3, now that you have logs in ClickStack
- Filter noisy log groups by removing them from the collector configuration to reduce ingestion volume