Skip to main content

Telemetry

Integration with AWS Cloudwatch

We can configure the OTel collector to send logs to AWS Cloudwatch. To do so:

1
Update the Collector Configuration:
apiVersion: v1
data:
collector-config.yaml: |
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
exporters:
debug:
verbosity: detailed
awscloudwatchlogs:
log_group_name: "oblv-deploy-logs"
log_stream_name: "oblv-deploy-stream"
raw_log: true
region: "us-east-1"
endpoint: "logs.us-east-1.amazonaws.com"
log_retention: 365

service:
pipelines:
traces:
receivers: [otlp]
exporters: [debug]
metrics:
receivers: [otlp]
exporters: [debug]
logs:
receivers: [otlp]
exporters: [debug, awscloudwatchlogs]
kind: ConfigMap
2
Deploy the Collector:

Apply a Deployment that mounts this config and runs the collector:

apiVersion: apps/v1
kind: Deployment
metadata:
name: otel-collector
namespace: monitoring
spec:
replicas: 1
selector:
matchLabels:
app: otel-collector
template:
metadata:
labels:
app: otel-collector
spec:
containers:
- name: otel-collector
image: otel/opentelemetry-collector:0.94.0
resources:
limits:
memory: "256Mi"
cpu: "0.5"
requests:
memory: "128Mi"
cpu: "0.25"
ports:
- containerPort: 4317
name: otlp-grpc
- containerPort: 4318
name: otlp-http
- containerPort: 8889
name: prom-exp-http
command:
- "/otelcol"
- "--config=/etc/otel/collector-config.yaml"
volumeMounts:
- name: otel-collector-config-vol
mountPath: /etc/otel
volumes:
- name: otel-collector-config-vol
configMap:
name: otel-collector-config
items:
- key: collector-config.yaml
path: collector-config.yaml