-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #141 from arunvthangaraj/main
feat: ADOT Container logs collection
- Loading branch information
Showing
9 changed files
with
242 additions
and
9 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 84 additions & 0 deletions
84
...vability-accelerators/single-new-eks-container-logs-opensource-observability.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# Single Cluster Open Source Observability - Container Logs Collection | ||
|
||
## Objective | ||
|
||
Following the [announcement](https://aws.amazon.com/about-aws/whats-new/2023/11/logs-support-aws-distro-opentelemetry/) of logs support in AWS Distro for OpenTelemetry, this pattern demonstrates how to use the _New EKS Cluster Open Source Observability Accelerator_ to forward container logs to cloud watch using ADOT containers log collector. | ||
|
||
## Prerequisites | ||
|
||
Ensure that you have installed the following tools on your machine. | ||
|
||
1. [aws cli](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) | ||
2. [kubectl](https://Kubernetes.io/docs/tasks/tools/) | ||
3. [cdk](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html#getting_started_install) | ||
4. [npm](https://docs.npmjs.com/cli/v8/commands/npm-install) | ||
|
||
## Deploying | ||
|
||
Please follow the _Deploying_ instructions of the [New EKS Cluster Open Source Observability Accelerator](./single-new-eks-opensource-observability.md) pattern, except for step 7, where you need to replace "context" in `~/.cdk.json` with the following: | ||
|
||
```typescript | ||
"context": { | ||
"fluxRepository": { | ||
"name": "grafana-dashboards", | ||
"namespace": "grafana-operator", | ||
"repository": { | ||
"repoUrl": "https://github.com/aws-observability/aws-observability-accelerator", | ||
"name": "grafana-dashboards", | ||
"targetRevision": "main", | ||
"path": "./artifacts/grafana-operator-manifests/eks/infrastructure" | ||
}, | ||
"values": { | ||
"GRAFANA_CLUSTER_DASH_URL" : "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/main/artifacts/grafana-dashboards/eks/infrastructure/cluster.json", | ||
"GRAFANA_KUBELET_DASH_URL" : "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/main/artifacts/grafana-dashboards/eks/infrastructure/kubelet.json", | ||
"GRAFANA_NSWRKLDS_DASH_URL" : "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/main/artifacts/grafana-dashboards/eks/infrastructure/namespace-workloads.json", | ||
"GRAFANA_NODEEXP_DASH_URL" : "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/main/artifacts/grafana-dashboards/eks/infrastructure/nodeexporter-nodes.json", | ||
"GRAFANA_NODES_DASH_URL" : "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/main/artifacts/grafana-dashboards/eks/infrastructure/nodes.json", | ||
"GRAFANA_WORKLOADS_DASH_URL" : "https://raw.githubusercontent.com/aws-observability/aws-observability-accelerator/main/artifacts/grafana-dashboards/eks/infrastructure/workloads.json" | ||
}, | ||
"kustomizations": [ | ||
{ | ||
"kustomizationPath": "./artifacts/grafana-operator-manifests/eks/infrastructure" | ||
} | ||
] | ||
}, | ||
"adotcontainerlogs.pattern.enabled": true | ||
} | ||
``` | ||
|
||
!! warning This scenario might need larger worker node for the pod. | ||
|
||
|
||
Once completed the rest of the _Deploying_ steps, you can move on with the deployment of the Nginx workload. | ||
|
||
## Viewing Logs in CloudWatch Log Groups and Logs Insights | ||
|
||
Navigate to CloudWatch, then go to "Log groups" | ||
|
||
Search for log group with the name "/aws/eks/single-new-eks-mixed-observability-accelerator" and open it | ||
|
||
You will see log streams created using the node name | ||
|
||
![ADOT_container_logs_group](../images/ADOT_container_logs_group.png) | ||
|
||
Open the log stream and you view the logs forwarded by the container logs collector to CloudWatch | ||
|
||
![ADOT_container_logs](../images/ADOT_container_logs.png) | ||
|
||
Navigate to CloudWatch, then go to "Logs Insights" | ||
|
||
In the dropdown, select log group with name "/aws/eks/single-new-eks-mixed-observability-accelerator" and run a query. | ||
|
||
![ADOT_container_logs_insights](../images/ADOT_container_logs_insights.png) | ||
|
||
Then you can view the results of your query: | ||
|
||
![ADOT_container_logs_insights](../images/ADOT_container_logs_insights_results.png) | ||
|
||
## Teardown | ||
|
||
You can teardown the whole CDK stack with the following command: | ||
|
||
```bash | ||
make pattern single-new-eks-opensource-observability destroy | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters