Skip to content

Commit a68fa8d

Browse files
committed
Add container logs page
1 parent e05a6cc commit a68fa8d

File tree

5 files changed

+145
-2
lines changed

5 files changed

+145
-2
lines changed

src/content/BlogPosts/blogPosts.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ path: /blog
88
blogs:
99
- title: "AWS Distro for OpenTelemetry EKS Add-on v0.88.0-eksbuild.1 is now available"
1010
author: "Huy Vo"
11-
date: "15-November-2023"
11+
date: "17-November-2023"
1212
body:
1313
"AWS Distro for OpenTelemetry EKS Add-on v0.88.0-eksbuild.1 is now available."
1414
link: "/docs/ReleaseBlogs/aws-distro-for-opentelemetry-eks-add-on-v0.88.0"

src/docs/getting-started/adot-eks-add-on/add-on-configuration-collector-deployment.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ custom resources together in one advanced configuration using the EKS add-on.
1515
The supported preconfigured custom resources are listed below:
1616
## [Prometheus Metrics](/docs/getting-started/adot-eks-add-on/config-prometheus-metrics)
1717
## [OTLP Ingest](/docs/getting-started/adot-eks-add-on/config-otlp-ingest)
18+
## [Container Logs](/docs/getting-started/adot-eks-add-on/config-container-logs)
1819

1920
Use the links above to learn about the available configuration options.
2021

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
---
2+
title: 'Container Logs Collector Configuration'
3+
description:
4+
This page introduces Collector configuration for Container Logs for the ADOT Collector.
5+
path: '/docs/getting-started/adot-eks-add-on/config-container-logs'
6+
---
7+
The Container Logs collector configuration launches a preconfigured OpenTelemetryCollector custom resource
8+
to tail all Kubernetes pod logs with the `filelog` receiver. By opting into the
9+
[available pipeline](/docs/getting-started/adot-eks-add-on/config-container-logs/#container-logs-pipelines)
10+
you can control where the collected logs are sent. In this preconfigured custom resource,
11+
the collector will run as a daemonset in order to capture all logs on each node.
12+
13+
## Prerequisites
14+
15+
### Setup an IAM role to associate with the service account
16+
17+
An IAM Role with the following policies must be created for the following Kubernetes
18+
service account and namespace.
19+
20+
| Service Account Name | Namespace | IAM Policies |
21+
| -------------------------- | --------- | ------------ |
22+
| <nobr>adot-col-container-logs</nobr> | <nobr>opentelemetry-operator-system</nobr> | CloudWatchAgentServerPolicy |
23+
**Note:** Only attach the minimum set of policies necessary for your advanced configuration.
24+
25+
The [IAM Roles for Service Accounts documentation (IRSA)](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.htmlhttps://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html) contains instructions for creating the IAM
26+
role. The following examples will use [eksctl](https://eksctl.io/usage/iamserviceaccounts/https://eksctl.io/usage/iamserviceaccounts/) to achieve this.
27+
28+
To create this IAM role, run the following command:
29+
30+
```console
31+
eksctl create iamserviceaccount \
32+
--name adot-col-container-logs \
33+
--namespace opentelemetry-operator-system \
34+
--cluster <your_cluster_name> \
35+
--attach-policy-arn arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy \
36+
--approve \
37+
--role-only
38+
```
39+
40+
This IAM role generated by the above command needs to be inserted into the annotations
41+
field of the advanced configuration as seen below:
42+
```yaml
43+
collector:
44+
containerLogs:
45+
serviceAccount:
46+
annotations:
47+
eks.amazonaws.com/role-arn: <iam_role_arn>
48+
```
49+
50+
## Container Logs pipelines
51+
The following pipelines are available for the Container Logs preconfigured custom resource.
52+
Pipelines can be enabled by setting their `enabled` field to `true`.
53+
54+
### Logs
55+
56+
- #### cloudwatchLogs
57+
Logs collected by a filelog receiver are sent to AWS Cloudwatch Logs.
58+
59+
### Container Logs Advanced Configuration pipeline
60+
```yaml
61+
collector:
62+
containerLogs:
63+
serviceAccount:
64+
annotations:
65+
eks.amazonaws.com/role-arn: <iam_role_arn>
66+
pipelines:
67+
logs:
68+
cloudwatchLogs:
69+
enabled: true
70+
```
71+
72+
## Container Logs exporters
73+
The following exporters can be configured for the Container Logs preconfigured custom resource.
74+
75+
### awscloudwatchlogs
76+
77+
- #### log_group_name
78+
The name for the AWS Cloudwatch log group. Must follow pattern: `[\\.\\-_/#A-Za-z0-9]+`
79+
80+
- #### log_stream_name
81+
The name for the AWS Cloudwatch log stream. Must follow pattern: `[^:*]*`
82+
83+
### Container Logs Advanced Configuration exporters
84+
```yaml
85+
collector:
86+
containerLogs:
87+
serviceAccount:
88+
annotations:
89+
eks.amazonaws.com/role-arn: <iam_role_arn>
90+
pipelines:
91+
logs:
92+
cloudwatchLogs:
93+
enabled: true
94+
exporters:
95+
awscloudwatchlogs:
96+
log_group_name: <log_group_name>
97+
log_stream_name: <log_stream_name>
98+
```
99+
100+
## Container Logs configurable values
101+
102+
Shown below is the complete list of configurable fields, along with their default values, for the containerLogs resource.
103+
`$CLUSTER_NAME` refers to the name of the EKS cluster and `$NODE_NAME` refers to the name of the Kubernetes node in the daemonset.
104+
105+
```yaml
106+
collector:
107+
containerLogs:
108+
resources:
109+
limits:
110+
cpu: 1000m
111+
memory: 750Mi
112+
requests:
113+
cpu: 300m
114+
memory: 512Mi
115+
serviceAccount:
116+
annotations:
117+
pipelines:
118+
logs:
119+
cloudwatchLogs:
120+
enabled: false
121+
exporters:
122+
awscloudwatchlogs:
123+
log_group_name: $CLUSTER_NAME/container/logs
124+
log_stream_name: $NODE_NAME
125+
126+
```
127+
*Note that in Fargate, resource requests and limits must be equal, see
128+
this [troubleshooting guide](https://docs.aws.amazon.com/eks/latest/userguide/troubleshooting-adot.html) for more information.
129+
130+
## [Previous Topic: Add-on Advanced Configuration: Collector Deployment](/docs/getting-started/adot-eks-add-on/add-on-configuration-collector-deployment)
131+
132+
## Related Topics:
133+
134+
### [Collector Configuration for Prometheus Metrics](/docs/getting-started/adot-eks-add-on/config-prometheus-metrics)
135+
136+
### [Collector Configuration for OTLP Ingest](/docs/getting-started/adot-eks-add-on/config-otlp-ingest)
137+
138+
## [Next Topic: Updating and Cleanup](/docs/getting-started/adot-eks-add-on/update-and-cleanup)

src/docs/getting-started/adot-eks-add-on/config-otlp-ingest.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ path: '/docs/getting-started/adot-eks-add-on/config-otlp-ingest'
66
---
77
The [OpenTelemetry Protocol (OTLP)](https://opentelemetry.io/docs/specs/otlp/) Ingest collector configuration launches a preconfigured OpenTelemetryCollector custom resource
88
to ingest trace export calls with the `otlp` receiver. By opting into the
9-
[available pipeline](/docs/getting-started/adot-eks-add-on/config-otlp-ingest/#otlp-ingest-pipeline)
9+
[available pipeline](/docs/getting-started/adot-eks-add-on/config-otlp-ingest/#otlp-ingest-pipelines)
1010
you can control where the collected traces are sent.
1111

1212
## Prerequisites
@@ -100,4 +100,6 @@ this [troubleshooting guide](https://docs.aws.amazon.com/eks/latest/userguide/tr
100100

101101
### [Collector Configuration for Prometheus Metrics](/docs/getting-started/adot-eks-add-on/config-prometheus-metrics)
102102

103+
### [Collector Configuration for Container Logs](/docs/getting-started/adot-eks-add-on/config-container-logs)
104+
103105
## [Next Topic: Updating and Cleanup](/docs/getting-started/adot-eks-add-on/update-and-cleanup)

src/docs/getting-started/adot-eks-add-on/config-prometheus-metrics.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,6 @@ this [troubleshooting guide](https://docs.aws.amazon.com/eks/latest/userguide/tr
141141

142142
### [Collector Configuration for OTLP Ingest](/docs/getting-started/adot-eks-add-on/config-otlp-ingest)
143143

144+
### [Collector Configuration for Container Logs](/docs/getting-started/adot-eks-add-on/config-container-logs)
145+
144146
## [Next Topic: Updating and Cleanup](/docs/getting-started/adot-eks-add-on/update-and-cleanup)

0 commit comments

Comments
 (0)