stackconf 2023 | Practical introduction to OpenTelemetry tracing by Nicolas Fränkel.pdf

NETWAYS
NETWAYSNETWAYS
@nicolas_frankel
A practical introduction to Open
Telemetry
@nicolas_frankel
n Monitoring
n Lots of people looking at
screens
n Alerting
In the good old days…
@nicolas_frankel
Then systems became more distributed
@nicolas_frankel
“In distributed systems, observability is
the ability to collect data about
program execution, internal states of
modules, and communication between
components. To improve observability,
software engineers use a wide range of
logging and tracing techniques and
tools.”
-- https://en.wikipedia.org/wiki/Event_monitoring
Observability
@nicolas_frankel
1. Metrics
2. Logging
3. Tracing
The 3 pillars of Observability
@nicolas_frankel
n System metrics
• CPU, memory, etc.
n Higher-level metrics
• Requests per second, HTTP
status code, etc.
Metrics
@nicolas_frankel
n What to log
• Auto vs. manual
• Sensitive data
n Logging format
• Human readable vs. JSON
n Where to log
• Console vs. log files
n Logs aggregation FTW
Logging
@nicolas_frankel
n Get the log
• Scrape vs. Send
n Parse the log
• Structured vs. unstructured
n Store the log
n Search the log
n Display the log
Centralized logging systems
@nicolas_frankel
Some centralized logging systems
@nicolas_frankel
“In software engineering,
tracing involves a specialized
use of logging to record
information about a program's
execution. […] Tracing is a
cross-cutting concern.”
-- https://en.wikipedia.org/wiki/Tracing_(software)
Tracing
@nicolas_frankel
“Set of techniques and tools
that help follow a business
request through multiple
components across the
network”
-- Me
(inspired by lots of others I don’t
remember the name of)
Tracing
@nicolas_frankel
Tracing pioneers
@nicolas_frankel
“This specification defines standard HTTP
headers and a value format to propagate
context information that enables distributed
tracing scenarios. The specification
standardizes how context information is sent
and modified between services. Context
information uniquely identifies individual
requests in a distributed system and also
defines a means to add and propagate
provider-specific context information.”
— https://www.w3.org/TR/trace-context/
The W3C Trace Context specification
@nicolas_frankel
n Trace: follows the path of a
request that spans multiple
components
n Span: bound to a single
component and linked to
another span by a child-
parent relationship
Base concepts
@nicolas_frankel
@nicolas_frankel
“OpenTelemetry is a collection of
tools, APIs, and SDKs. Use it to
instrument, generate, collect, and
export telemetry data (metrics,
logs, and traces) to help you
analyze your software’s
performance and behavior.”
-- https://opentelemetry.io/
OpenTelemetry
@nicolas_frankel
n Implements W3C Trace Context
n Merge of OpenTracing and
OpenCensus
n CNCF project
n Apache v2 license
n 1.3k followers on GitHub
OpenTelemetry
@nicolas_frankel
OpenTelemetry architecture
@nicolas_frankel
n OTEL provides a collector
n Jaeger and Zipkin provide
compatible collectors
• Continue using your existing
tracing provider!
Life after the OTEL collector
@nicolas_frankel
n Auto-instrumentation
• Via the runtime
n Manual instrumentation
• Library dependency + API
Auto-instrumentation vs. manual instrumentation
@nicolas_frankel
n Low-hanging fruit
n No coupling
Benefits of auto-instrumentation
@nicolas_frankel
@nicolas_frankel
n The most important part as it
generates the first ID
• Reverse proxy/API Gateway
The entrypoint
@nicolas_frankel
Apache APISIX, an API Gateway the Apache way
@nicolas_frankel
plugins:
- opentelemetry
plugin_attr:
opentelemetry:
resource:
service.name: APISIX
collector:
address: jaeger:4318
General configuration
@nicolas_frankel
plugins:
opentelemetry:
sampler:
name: always_on
additional_attributes:
- route_id
- request_method
- http_x-ot-key
Per-route (or global rule) configuration
@nicolas_frankel
n Via a Java agent:
•-javaagent:otel.jar
n Regardless of:
• The language
• The framework
JVM auto-instrumentation implementation
@nicolas_frankel
n Requires the OTEL dependency
n Usage:
• Annotations
• API call
JVM explicit instrumentation
@nicolas_frankel
Annotations
@WithSpan("ProductHandler.fetch")
private suspend fun fetchProductDetails(
@SpanAttribute("id") id: Long,
product: Product) {
// ...
}
@nicolas_frankel
n Add the OTEL dependency
n Run with the instrumentation:
>opentelemetry-instrument flask run
Python auto-instrumentation
@nicolas_frankel
Explicit API
from opentelemetry import trace
tracer = trace.get_tracer(__name__)
with tracer.start_as_current_span(
"SELECT * FROM PRICE WHERE ID=:id",
attributes={":id": 1}):
#do under the span
@nicolas_frankel
n Rust compiles to native:
• No runtime
• Needs explicit calls
Rust
@nicolas_frankel
Finding the relevant Cargo dependency
• It’s not trivial!
axum-tracing-opentelemetry = { version =
"0.7", features = ["otlp"] }
@nicolas_frankel
n Initialize the library
n Configure axum
n Clean stop
Usage
@nicolas_frankel
Configure axum
let app = axum::Router::new()
.route("/stocks/:id", get(get_by_id))
.layer(response_with_trace_layer())
.layer(opentelemetry_tracing_layer());
@nicolas_frankel
Thanks for your attention!
n @nicolas_frankel
n @nico@frankel.ch
n https://bit.ly/otel-demo
n https://apisix.apache.org/
1 von 36

Recomendados

BigData conference - Introduction to stream processing von
BigData conference - Introduction to stream processingBigData conference - Introduction to stream processing
BigData conference - Introduction to stream processingNicolas Frankel
164 views47 Folien
Devclub.lv - Introduction to stream processing von
Devclub.lv - Introduction to stream processingDevclub.lv - Introduction to stream processing
Devclub.lv - Introduction to stream processingNicolas Frankel
249 views48 Folien
Deep Learning Jeff-Shomaker_1-20-17_Final_ von
Deep Learning Jeff-Shomaker_1-20-17_Final_Deep Learning Jeff-Shomaker_1-20-17_Final_
Deep Learning Jeff-Shomaker_1-20-17_Final_Jeffrey Shomaker
909 views22 Folien
Zero-downtime deployment on Kubernetes with Hazelcast von
Zero-downtime deployment on Kubernetes with HazelcastZero-downtime deployment on Kubernetes with Hazelcast
Zero-downtime deployment on Kubernetes with HazelcastNicolas Frankel
125 views34 Folien
Getting Started with Splunk Breakout Session von
Getting Started with Splunk Breakout SessionGetting Started with Splunk Breakout Session
Getting Started with Splunk Breakout SessionSplunk
628 views39 Folien
AGS 2014 i5k_workspace von
AGS 2014 i5k_workspaceAGS 2014 i5k_workspace
AGS 2014 i5k_workspaceMonica Poelchau
429 views18 Folien

Más contenido relacionado

Similar a stackconf 2023 | Practical introduction to OpenTelemetry tracing by Nicolas Fränkel.pdf

tranSMART Community Meeting 5-7 Nov 13 - Session 1: Chilly-Mazarin Meeting Ob... von
tranSMART Community Meeting 5-7 Nov 13 - Session 1: Chilly-Mazarin Meeting Ob...tranSMART Community Meeting 5-7 Nov 13 - Session 1: Chilly-Mazarin Meeting Ob...
tranSMART Community Meeting 5-7 Nov 13 - Session 1: Chilly-Mazarin Meeting Ob...David Peyruc
644 views44 Folien
PB.docx von
PB.docxPB.docx
PB.docxKalyaniDarapaneni
75 views23 Folien
JavaDay Istanbul - 3 improvements in your microservices architecture von
JavaDay Istanbul - 3 improvements in your microservices architectureJavaDay Istanbul - 3 improvements in your microservices architecture
JavaDay Istanbul - 3 improvements in your microservices architecture Nicolas Frankel
225 views31 Folien
Customer Presentation von
Customer PresentationCustomer Presentation
Customer PresentationSplunk
474 views24 Folien
Digital forensics von
Digital forensicsDigital forensics
Digital forensicsyash sawarkar
6.2K views17 Folien
Zero-downtime Deployment on Kubernetes von
Zero-downtime Deployment on KubernetesZero-downtime Deployment on Kubernetes
Zero-downtime Deployment on KubernetesAll Things Open
163 views32 Folien

Similar a stackconf 2023 | Practical introduction to OpenTelemetry tracing by Nicolas Fränkel.pdf(20)

tranSMART Community Meeting 5-7 Nov 13 - Session 1: Chilly-Mazarin Meeting Ob... von David Peyruc
tranSMART Community Meeting 5-7 Nov 13 - Session 1: Chilly-Mazarin Meeting Ob...tranSMART Community Meeting 5-7 Nov 13 - Session 1: Chilly-Mazarin Meeting Ob...
tranSMART Community Meeting 5-7 Nov 13 - Session 1: Chilly-Mazarin Meeting Ob...
David Peyruc644 views
JavaDay Istanbul - 3 improvements in your microservices architecture von Nicolas Frankel
JavaDay Istanbul - 3 improvements in your microservices architectureJavaDay Istanbul - 3 improvements in your microservices architecture
JavaDay Istanbul - 3 improvements in your microservices architecture
Nicolas Frankel225 views
Customer Presentation von Splunk
Customer PresentationCustomer Presentation
Customer Presentation
Splunk474 views
Zero-downtime Deployment on Kubernetes von All Things Open
Zero-downtime Deployment on KubernetesZero-downtime Deployment on Kubernetes
Zero-downtime Deployment on Kubernetes
All Things Open163 views
White Paper - One Window - Non-US Version von Stuart Clarke
White Paper - One Window - Non-US VersionWhite Paper - One Window - Non-US Version
White Paper - One Window - Non-US Version
Stuart Clarke164 views
Cyber&digital forensics report von yash sawarkar
Cyber&digital forensics reportCyber&digital forensics report
Cyber&digital forensics report
yash sawarkar1.3K views
Kubernetes Online Meetup - Battle of the Circuit Breakers von Nicolas Frankel
Kubernetes Online Meetup - Battle of the Circuit BreakersKubernetes Online Meetup - Battle of the Circuit Breakers
Kubernetes Online Meetup - Battle of the Circuit Breakers
Nicolas Frankel69 views
JFuture - Battle of the circuit breakers von Nicolas Frankel
JFuture - Battle of the circuit breakersJFuture - Battle of the circuit breakers
JFuture - Battle of the circuit breakers
Nicolas Frankel879 views
OSAD - Battle of the Circuit Breakers von Nicolas Frankel
OSAD - Battle of the Circuit BreakersOSAD - Battle of the Circuit Breakers
OSAD - Battle of the Circuit Breakers
Nicolas Frankel273 views
Big Data Analytics Tokyo von Adam Gibson
Big Data Analytics TokyoBig Data Analytics Tokyo
Big Data Analytics Tokyo
Adam Gibson1K views
GOTO Berlin - Battle of the Circuit Breakers: Resilience4J vs Istio von Nicolas Frankel
GOTO Berlin - Battle of the Circuit Breakers: Resilience4J vs IstioGOTO Berlin - Battle of the Circuit Breakers: Resilience4J vs Istio
GOTO Berlin - Battle of the Circuit Breakers: Resilience4J vs Istio
Nicolas Frankel1.3K views
ThroughTheLookingGlass_EffectiveObservability.pptx von Grace Jansen
ThroughTheLookingGlass_EffectiveObservability.pptxThroughTheLookingGlass_EffectiveObservability.pptx
ThroughTheLookingGlass_EffectiveObservability.pptx
Grace Jansen56 views
Tech talks - 3 performance improvements von Nicolas Frankel
Tech talks - 3 performance improvementsTech talks - 3 performance improvements
Tech talks - 3 performance improvements
Nicolas Frankel302 views
CarolinaCon Presentation on Streaming Analytics von John Eberhardt
CarolinaCon Presentation on Streaming AnalyticsCarolinaCon Presentation on Streaming Analytics
CarolinaCon Presentation on Streaming Analytics
John Eberhardt459 views
Big Data Technologies.pdf von RAHULRAHU8
Big Data Technologies.pdfBig Data Technologies.pdf
Big Data Technologies.pdf
RAHULRAHU829 views
SnowCamp - Adding search to a legacy application von Nicolas Frankel
SnowCamp - Adding search to a legacy applicationSnowCamp - Adding search to a legacy application
SnowCamp - Adding search to a legacy application
Nicolas Frankel104 views
Session 2.1 ontological representation of the telecom domain for advanced a... von semanticsconference
Session 2.1   ontological representation of the telecom domain for advanced a...Session 2.1   ontological representation of the telecom domain for advanced a...
Session 2.1 ontological representation of the telecom domain for advanced a...

Último

CIS1- Final-Project- COPY-Presentation-JinHuan Chen, Tammy Ling, JingCheng Zh... von
CIS1- Final-Project- COPY-Presentation-JinHuan Chen, Tammy Ling, JingCheng Zh...CIS1- Final-Project- COPY-Presentation-JinHuan Chen, Tammy Ling, JingCheng Zh...
CIS1- Final-Project- COPY-Presentation-JinHuan Chen, Tammy Ling, JingCheng Zh...tmmling
13 views16 Folien
Out-of-Market Efficiencies in Competition Enforcement – ROSENBOOM – December ... von
Out-of-Market Efficiencies in Competition Enforcement – ROSENBOOM – December ...Out-of-Market Efficiencies in Competition Enforcement – ROSENBOOM – December ...
Out-of-Market Efficiencies in Competition Enforcement – ROSENBOOM – December ...OECD Directorate for Financial and Enterprise Affairs
62 views10 Folien
Competition and Professional Sports –MENDES – December 2023 OECD discussion von
Competition and Professional Sports –MENDES – December 2023 OECD discussionCompetition and Professional Sports –MENDES – December 2023 OECD discussion
Competition and Professional Sports –MENDES – December 2023 OECD discussionOECD Directorate for Financial and Enterprise Affairs
286 views4 Folien
PPS.pptx von
PPS.pptxPPS.pptx
PPS.pptxmdabzayub
6 views51 Folien
UNIT XIII Cognitive Process.pptx von
UNIT XIII Cognitive Process.pptxUNIT XIII Cognitive Process.pptx
UNIT XIII Cognitive Process.pptxProf. (Dr.) Rahul Sharma
92 views62 Folien
Out-of-Market Efficiencies in Competition Enforcement – ROSE – December 2023 ... von
Out-of-Market Efficiencies in Competition Enforcement – ROSE – December 2023 ...Out-of-Market Efficiencies in Competition Enforcement – ROSE – December 2023 ...
Out-of-Market Efficiencies in Competition Enforcement – ROSE – December 2023 ...OECD Directorate for Financial and Enterprise Affairs
59 views6 Folien

Último(20)

CIS1- Final-Project- COPY-Presentation-JinHuan Chen, Tammy Ling, JingCheng Zh... von tmmling
CIS1- Final-Project- COPY-Presentation-JinHuan Chen, Tammy Ling, JingCheng Zh...CIS1- Final-Project- COPY-Presentation-JinHuan Chen, Tammy Ling, JingCheng Zh...
CIS1- Final-Project- COPY-Presentation-JinHuan Chen, Tammy Ling, JingCheng Zh...
tmmling13 views
a timeline of the history of linguistics- BAUTISTA- BELGERA.pdf von FordBryantSadio
a timeline of the history of linguistics- BAUTISTA- BELGERA.pdfa timeline of the history of linguistics- BAUTISTA- BELGERA.pdf
a timeline of the history of linguistics- BAUTISTA- BELGERA.pdf
FordBryantSadio8 views
Maximiliano Roa - eRetail Week Blended [Professional] Experience 2023 von eCommerce Institute
Maximiliano Roa - eRetail Week Blended [Professional] Experience 2023Maximiliano Roa - eRetail Week Blended [Professional] Experience 2023
Maximiliano Roa - eRetail Week Blended [Professional] Experience 2023
RTC2023_Boost-App-Integration-with-AI_Kim.pdf von hossenkamal2
RTC2023_Boost-App-Integration-with-AI_Kim.pdfRTC2023_Boost-App-Integration-with-AI_Kim.pdf
RTC2023_Boost-App-Integration-with-AI_Kim.pdf
hossenkamal28 views
What I learnt in Antarctica about leadership, well-being and climate change von kristinashields1
What I learnt in Antarctica about leadership, well-being and climate changeWhat I learnt in Antarctica about leadership, well-being and climate change
What I learnt in Antarctica about leadership, well-being and climate change
kristinashields124 views

stackconf 2023 | Practical introduction to OpenTelemetry tracing by Nicolas Fränkel.pdf