Christopher Judd: Monitor All Your Stuff with OpenTelemetry and AWS

awschicago 92 views 55 slides Jun 24, 2024
Slide 1
Slide 1 of 55
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55

About This Presentation

AWS Community Day Midwest 2024
Christopher M. Judd
Monitor All Your Stuff with OpenTelemetry and AWS


Slide Content

Monitor All Your Stuff with
OpenTelemetry and AWS
Christopher M. Juddhttps://bit.ly/adot-awsusmidwest-2024

Who thinks architecting, building,
testing, deploying, and monitoring
applications has gotten easier in the
past 10 years?
Cloud
Microservices

Christopher M. Judd
CTO and Partner
https://manifestcorp.com/

Incontrol theory,observability(o11y) is a measure of how well internal states of
asystemcan be inferred from knowledge of its external outputs.
A system is said to beobservableif, for any possible evolution ofstate and
control vectors, the current state can be estimated using only the information
from outputs (physically, this generally corresponds to information obtained
bysensors)
Observability

Observability Pillars
MetricsDistributed TracesLogs

Telemetryis thein situcollection of measurementsor other data at remote points
and their automatictransmissionto receiving equipment (telecommunication) for
monitoring.[1]The word is derived from theGreekrootstele, "remote", andmetron,
"measure".
Telemetry

javajudd
Software Telemetry Gathers
•Processing Time/Performance
•Application Crashes/Exceptions/Errors
•General Usage Statistics
•Feature Usage
•User Behavior
•Hardware Statistics
•Thread Detection/Investigation

Observability
MetricsDistributed TracesLogs

Observability
MetricsDistributed TracesLogs

Enable X-Ray

X-Ray Trace Map

X-Ray Traces

X-Ray Timeline & Logs

CloudWatch - Metrics

Blind Spots

On Premise
AWS CloudCorporate
data center

Containers

Instrument application for X-Ray, metrics, & logs
https://docs.aws.amazon.com/xray/latest/devguide/xray-instrumenting-your-app.html

https://opentelemetry.io/

OpenTelemetry (OTel) provides open source APIs, libraries,
and agents to collect distributed telemetry data (traces,
metrics and logs) for application monitoring

Captures
MetricsDistributed TracesLogs

Status
MetricsDistributed TracesLogs
Tracing
•API: stable, feature-freeze
•SDK: stable
•Protocol: stable
Metrics
•API: stable
•SDK: mixed
•Protocol: stable
Logging
•API: stable
•SDK: mixed
•Event API: experimental
•Protocol: stable
As of Release v1.34.1

Spec Compliance Matrix
https://github.com/open-telemetry/opentelemetry-specification/blob/main/spec-compliance-matrix.md

OpenTelemetry Support

OpenTelemetry Architecture

OTLP

OTLP

OTLP

OTLP

agent/
collector
otlp
zipkin
prometheus
aws
otlp
otlp
OpenTelemetry Collectors (Agent & Collectors)
OTLP
otlp
otlp
otlp

agent/
collector
agent/
collector
agent/
collector
gateway/
collector
otlp
zipkin
prometheus
aws
otlp
otlp
OpenTelemetry Collectors (Agent & Collectors)
OTLP

agent/
collector
agent/
collector
agent/
collector
gateway/
collector
otlp
zipkin
prometheus
aws
otlp
otlp
OpenTelemetry Collectors (Agent & Collectors)
OTLP
AWS Distro for OpenTelemetry (ADOT)

Demos
https://github.com/spring-petclinic/spring-petclinic-rest
https://github.com/spring-petclinic/spring-petclinic-angular
AngularSpring Boot RESTHQLDB

Instrumentation for Java

https://github.com/open-telemetry/opentelemetry-java-instrumentation

Collectors

https://opentelemetry.io/docs/collector/
Collectors

AWS Distro for OpenTelemetry
https://aws-otel.github.io/

otel-collector-config.yaml
extensions:
health_check:
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
cors:
allowed_origins:
-http://*
awsxray:
endpoint: 0.0.0.0:2000
transport: udp
processors:
batch/traces:
timeout: 1s
send_batch_size: 50
batch/metrics:
timeout: 60s
exporters:
awsxray:
awsemf:
awscloudwatchlogs:
log_group_name: "spring-petclinic-rest-logs"
log_stream_name: "spring-petclinic-rest-stream"
service:
pipelines:
traces:
receivers: [otlp,awsxray]
processors: [batch/traces]
exporters: [awsxray]
metrics:
receivers: [otlp]
processors: [batch/metrics]
exporters: [awsemf]
extensions: [health_check]

extensions:
health_check:
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
cors:
allowed_origins:
-http://*
awsxray:
endpoint: 0.0.0.0:2000
transport: udp
processors:
batch/traces:
timeout: 1s
send_batch_size: 50
batch/metrics:
timeout: 60s
exporters:
awsxray:
awsemf:
awscloudwatchlogs:
log_group_name: "spring-petclinic-rest-logs"
log_stream_name: "spring-petclinic-rest-stream"
service:
pipelines:
traces:
receivers: [otlp,awsxray]
processors: [batch/traces]
exporters: [awsxray]
metrics:
receivers: [otlp]
processors: [batch/metrics]
exporters: [awsemf]
extensions: [health_check]
Receiver 1
Receiver 2
Receiver N
Processor 1Processor 2Processor N
Exporter 1
Exporter 2
Exporter N
Pipelines
pipeline

extensions:
health_check:
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
cors:
allowed_origins:
-http://*
awsxray:
endpoint: 0.0.0.0:2000
transport: udp
processors:
batch/traces:
timeout: 1s
send_batch_size: 50
batch/metrics:
timeout: 60s
exporters:
awsxray:
awsemf:
awscloudwatchlogs:
log_group_name: "spring-petclinic-rest-logs"
log_stream_name: "spring-petclinic-rest-stream"
service:
pipelines:
traces:
receivers: [otlp,awsxray]
processors: [batch/traces]
exporters: [awsxray]
metrics:
receivers: [otlp]
processors: [batch/metrics]
exporters: [awsemf]
extensions: [health_check]
Receiver 1
Receiver 2
Receiver N
Processor 1Processor 2Processor N
Exporter 1
Exporter 2
Exporter N
pipeline
Receivers

extensions:
health_check:
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
cors:
allowed_origins:
-http://*
awsxray:
endpoint: 0.0.0.0:2000
transport: udp
processors:
batch/traces:
timeout: 1s
send_batch_size: 50
batch/metrics:
timeout: 60s
exporters:
awsxray:
awsemf:
awscloudwatchlogs:
log_group_name: "spring-petclinic-rest-logs"
log_stream_name: "spring-petclinic-rest-stream"
service:
pipelines:
traces:
receivers: [otlp,awsxray]
processors: [batch/traces]
exporters: [awsxray]
metrics:
receivers: [otlp]
processors: [batch/metrics]
exporters: [awsemf]
extensions: [health_check]
Receiver 1
Receiver 2
Receiver N
Processor 1Processor 2Processor N
Exporter 1
Exporter 2
Exporter N
pipeline
Processors

extensions:
health_check:
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318
cors:
allowed_origins:
-http://*
awsxray:
endpoint: 0.0.0.0:2000
transport: udp
processors:
batch/traces:
timeout: 1s
send_batch_size: 50
batch/metrics:
timeout: 60s
exporters:
awsxray:
awsemf:
awscloudwatchlogs:
log_group_name: "spring-petclinic-rest-logs"
log_stream_name: "spring-petclinic-rest-stream"
service:
pipelines:
traces:
receivers: [otlp,awsxray]
processors: [batch/traces]
exporters: [awsxray]
metrics:
receivers: [otlp]
processors: [batch/metrics]
exporters: [awsemf]
extensions: [health_check]
Receiver 2
Receiver N
Processor 2Processor N
Exporter 1
Exporter 2
Exporter N
pipeline
Exporters
Receiver 1
Processor 1

ADOT
otlp
CloudWatch
X-Ray
Docker Compose
docker-compose up -d
https://github.com/cjudd/spring-petclinic-aws-collector
version: "2"
services:
# ADOT Collector
otel-collector:
image: amazon/aws-otel-collector:latest
command: [ "--config=/etc/otel-agent-config.yaml" ]
environment:
-AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
-AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
-AWS_REGION=${AWS_REGION}
volumes:
-./otel-collector-config.yaml:/etc/otel-agent-config.yaml
-~/.aws:/home/aoc/.aws
ports:
-"1777:1777" # pprofextension
-"55679:55679" # zpagesextension
-"4317:4317" # OTLP receiver
-"4318:4318" # HTTP receiver
-"13133" # health_check

java -javaagent:opentelemetry-javaagent.jar
-Dotel.traces.exporter=otlp
-Dotel.metrics.exporter=otlp
-Dotel.logs.exporter=otlp
-Dotel.exporter.otlp.endpoint=http://localhost:4318
-Dotel.service.name=spring-petclinic-rest
-jar target/spring-petclinic-rest-x.x.x.jar
ADOT
otlp
CloudWatch
X-Ray
Run Instrumented Java App

java -javaagent:opentelemetry-javaagent.jar
-Dotel.service.name=spring-petclinic-rest
-jar target/spring-petclinic-rest-x.x.x.jar
Run Instrumented Java App
ADOT
otlp
CloudWatch
X-Ray

Application Traces

Application Metrics

Resources

https://opentelemetry.io/docs/

https://github.com/magsther/awesome-opentelemetry

email: [email protected]
website: https://juddsolutions.com/
twitter: javajudd
phone: 614-378-4119
email: [email protected]
Christopher M. Judd
linked-in: https://www.linkedin.com/in/christophermjudd/
https://bit.ly/adot-awsusmidwest-2024