SlideShare a Scribd company logo
1 of 35
Download to read offline
1 © 2023 ServiceNow, Inc. All Rights Reserved.
© 2023 ServiceNow, Inc. All Rights Reserved.
© 2023 ServiceNow, Inc. All Rights Reserved. Confidential. 2
Agenda
• What is OpenTelemetry?
• Distributed Tracing Overview
• Why you should use Distributed Traces?
• How can you enable it?
• instrumentation
• collector
from
3 Pillars of Observability
New Open Source Revolution
Open Source Project used to
collect & manage
traces, metrics, and logs
in vendor-agnostic way
5 © 2023 ServiceNow, Inc. All Rights Reserved.
OpenTelemetry Mission & Values
OpenTelemetry's Mission is to enable effective
observability by making high-quality, portable
telemetry ubiquitous and vendor-agnostic.
You want more? See Otel vision in https://github.com/open-telemetry/community/blob/main/mission-vision-values.md#otel-mission-vision-and-values
The solution is built following the values below:
• Compatibility
• Stability
• Resilience
• Performance
Prometheus
Lightstep
Jaeger
Otel Deployment Strategies – why is it vendor agnostic?
7 © 2023 ServiceNow, Inc. All Rights Reserved.
A brief history
2015
Lightstep is founded by
Ben Sigelman, Daniel
Spoonhower, and Ben
Cronin
2016
Lightstep helps to found
OpenTracing, the first
common, portable API
for distributed tracing
2017
Jaeger, an open-source
tracing tool developed by
Yuri Shkuro, is open-
sourced by Uber
2018
Google releases a new
portable instrumentation
project called
OpenCensus
2019
The OpenTracing and
OpenCensus projects
announce a merger,
forming OpenTelemetry
to be a part of CNCF
2020
OpenTelemetry is
released in beta
8 © 2023 ServiceNow, Inc. All Rights Reserved.
History vs legacy providers
2014
Kubernetes was first
announced by Google
2014
Lambda, first serverless
functions, announced by
Amazon at AWS reinvent
2015
Lightstep founded
2016
OpenTracing, first
common API for
distributed tracing,
founded with the help of
Lightstep
2019
The OpenTracing and
OpenCensus projects
announce a merger,
forming OpenTelemetry
to be a part of CNCF
2020
OpenTelemetry is
released in beta
2005
Dynatrace founded
2008
AppDynamics founded
2008
New Relic founded
2010
Datadog founded
2012
Promotheus initial
release
2013
Docker debuted to the
public at PyCon
All legacy vendors exists even before Docker was invented!
9 © 2023 ServiceNow, Inc. All Rights Reserved.
2nd most active project in CNCF
High-quality, ubiquitous, and portable telemetry to enable effective observability
• Second largest CNCF Project and
third largest Linux Foundation Project
• Provides vendor-neutral open-
source Observability framework for
instrumenting, generating, collecting
and exporting telemetry data such
as metrics, traces and logs
• Supported by all major Clouds (AWS,
Azure, GCP) and Observability
vendors
• Lightstep is a cofounder and top
contributor of OpenTelemetry
Source: CNCF
“OpenTelemetry continues to grow its contributor
base and has become the second highest velocity
project in the CNCF ecosystem.”
10 © 2023 ServiceNow, Inc. All Rights Reserved.
Lightstep Founded
Standards Languages
Tracers
Service Meshes / Proxies
Containers, Platforms
and Clouds
Deployment Automation (CI/CD) Alerting and Tools
Data Streaming and Storage
Integrations – More than 600 integrations available!
Go to OpenTelemetry registry to get up-to-date list of supported technologies and projects: https://opentelemetry.io/registry/
11 © 2023 ServiceNow, Inc. All Rights Reserved.
© 2023 ServiceNow, Inc. All Rights Reserved.
12 © 2023 ServiceNow, Inc. All Rights Reserved.
Trace
Span
Span
Time
client transaction from start to end
load balancer transaction from start to end
auth billing resource allocation and provisioning
container start-up
storage allocation
start-up scripts
Distributed traces overview
13 © 2023 ServiceNow, Inc. All Rights Reserved.
Visualizing a trace
14 © 2023 ServiceNow, Inc. All Rights Reserved.
Each span also has span context
Span context is composed of attributes
(key/value pairs) and events (log messages).
These are added during instrumentation.
Attributes (Tags) allow you to search and
segment your data within LightStep
Events (Logs) add information that is
useful during root cause and debugging
Visualizing a trace
15 © 2023 ServiceNow, Inc. All Rights Reserved.
Lab 3.1: Example of trace span
JSON formatted info, output when span.end() was called.
"SpanContext": {
"TraceID": "9850b11fa09d4b5fa4dd48dd37f3683b",
"SpanID": "1113d149cfffa942",
"TraceFlags": 1
},
"ParentSpanID": "e1e1624830d2378e",
"SpanKind": "internal",
"Name": "dbHandler/database",
"StartTime": "2019-11-03T10:52:56.903919262Z",
"EndTime": "2019-11-03T10:52:56.903923338Z",
"Attributes": [],
"MessageEvents": null,
"Links": null,
"Status": 0,
"HasRemoteParent": false,
"DroppedAttributeCount": 0,
"DroppedMessageEventCount": 0,
"DroppedLinkCount": 0,
"ChildSpanCount": 0
16 © 2023 ServiceNow, Inc. All Rights Reserved.
Lab 3.2: Example of trace attributes and log events
"Attributes": [
{
"Key": "http.host",
"Value": {
"Type": "STRING",
"Value": "opentelemetry-instructor.glitch.me"
}
},
{
"Key": "http.status_code",
"Value": {
"Type": "INT64",
"Value": 200
}
}
],
"MessageEvents": [
{
"Message": "annotation within span",
"Attributes": null,
"Time": "2019-11-03T10:52:56.903914029Z"
}
],
17 © 2023 ServiceNow, Inc. All Rights Reserved.
© 2023 ServiceNow, Inc. All Rights Reserved.
18 © 2023 ServiceNow, Inc. All Rights Reserved.
Distributed Traces, first place to go
to do Root Cause Analysis
19 © 2023 ServiceNow, Inc. All Rights Reserved.
Distributed Traces, first place to go
to do Root Cause Analysis
20 © 2023 ServiceNow, Inc. All Rights Reserved.
© 2023 ServiceNow, Inc. All Rights Reserved.
21 © 2023 ServiceNow, Inc. All Rights Reserved.
Implementation Tips
• Use auto-instrumentation
• ex: « JAVA_OPTS=-
javaagent:/path/to/opentelemetry-javaagent.jar »
• First, target your
critical services
• Instrument vertically
• vertically ⬄ a full chain (ex: frontend to backend)
• horizontally ⬄ a layer (ex: all my frontends services)
22 © 2023 ServiceNow, Inc. All Rights Reserved.
Implementation Tips (2/2)
• Add custom attributes
• to query/group by
• for RCA analytics and correlation
• to create specific dashboards or reports
• don’t reinvent the wheel, use Otel semantics
• ex: business attributes (customer.id, article.category,
shop.id)
• Add log events
• to remove need to go to the logs
• to reduce amount of log
• no more application/transaction logs in files, attach
logs to spans
• recommended: initial payload, all exceptions message
• Create your own wrapper
• to standardize usage among all teams
23 © 2023 ServiceNow, Inc. All Rights Reserved.
OpenTelemetry support of dev languages
You want to know more?
See https://opentelemetry.io/docs/instrumentation/
LANGUAGE TRACE* METRICS*
INSTRUMENTATION
MANUAL/AUTO**
C++ stable stable manual
C# / .NET stable stable manual & auto
Erlang / Elixir stable
experiment
al
manual
Go stable beta manual
Java stable stable manual & auto
Javascript /
Node
stable stable manual & auto
Javascript /
Browser
stable stable manual & auto
LANGUAGE TRACE* METRICS*
INSTRUMENTATION
MANUAL/AUTO**
PHP beta beta manual
Python stable stable manual & auto
Ruby stable not yet manual & auto
Rust beta alpha manual
Swift stable
experiment
al
manual
(*) Status as of June 2023
(**) Automatic instrumentation means quick wins as no need to update
existing code
Supported languages versions:
• .NET & .NET Framework all supported versions except .NET Fwk v3.5 as
https://github.com/open-telemetry/opentelemetry-dotnet
• Java >= v1.8
• NodeJS >=v10 as https://github.com/open-telemetry/opentelemetry-js
• Python, only latest versions as of https://github.com/open-
telemetry/opentelemetry-python
24 © 2023 ServiceNow, Inc. All Rights Reserved.
OpenTelemetry instrumentation step by step
• Declare dependencies
• Declare destination options
• Declare plugins
• Get context
• Start Span
• Decorate Span
• Create child Span
• End Span
• Rely on automatic context
propagation
• Do manual propagation
• Use W3C Trace Context
standard
CONFIGURE TRACER CREATE SPANS CONTEXT PROPAGATION
We will detail each of these steps in further slides
25 © 2023 ServiceNow, Inc. All Rights Reserved.
Configure Tracer
const opentelemetry = require('@opentelemetry/api');
const { NodeTracerProvider } = require('@opentelemetry/node');
const { SimpleSpanProcessor } = require('@opentelemetry/tracing');
const { CollectorTraceExporter } = require('@opentelemetry/exporter-collector');
const collectorOptions = {
serviceName: '<Service Name>', // Provide a service name
url: 'https://<Collector Host>:<Collector Port>', // URL and port to OTel Collector
};
// Create an exporter for sending span data
const exporter = new CollectorTraceExporter(collectorOptions);
// Create a provider for activating and tracking spans
const tracerProvider = new NodeTracerProvider({
plugins: {
http: {
enabled: true,
// You may use a package name or absolute path to the file.
path: '@opentelemetry/plugin-http',
// Enable HTTP Plugin to automatically inject/extract context into HTTP headers
}
}
});
// Configure a span processor for the tracer
tracerProvider.addSpanProcessor(new SimpleSpanProcessor(exporter));
// Register the tracer
tracerProvider.register();
Declare
Dependencies
Declare Destination
Options
Declare Plugins
TRACER SPAN CONTEXT
26 © 2023 ServiceNow, Inc. All Rights Reserved.
Use Existing Spans
const api = require('@opentelemetry/api');
let activeContext = api.context.active()
let activeSpan = api.trace.getSpan(activeContext);
activeSpan.setAttribute('platform', 'osx');
activeSpan.setAttribute('version', '1.2.3');
activeSpan.addEvent('event in foo');
Get Active
Context
Decorate
Span
TRACER SPAN CONTEXT
Get Active
Span
27 © 2023 ServiceNow, Inc. All Rights Reserved.
Create Spans
const tracer = opentelemetry.trace.getTracer();
const span = tracer.startSpan('foo');
span.setAttribute('platform', 'osx');
span.setAttribute('version', '1.2.3');
span.addEvent('event in foo');
const childSpan = tracer.startSpan('bar', {
parent: span,
});
childSpan.end();
span.end();
Start Span
Decorate
Span
Create Child
Span
End Span
TRACER SPAN CONTEXT
28 © 2023 ServiceNow, Inc. All Rights Reserved.
● tracer.startSpan(name, {parent: <span>, …})
○ This method returns a child of the specified span
● api.context.with(api.setSpan(api.context.active(), name))
○ Starts a new span, sets it to be active. Optionally, can get a reference to the span
● api.trace.getSpan(api.context.active())
○ Used to access & add information to the current span
● span.addEvent(msg)
○ Adds structured annotations (e.g. "logs") about what is currently happening
● span.setAttributes(core.Key(key).String(value)...)
○ Adds a structured, typed attribute to the current span. This may include a user id, a build id, a user-
agent, etc.
● span.end()
○ Often used with defer, fires when the unit of work is complete and the span can be sent
Tracer Span Methods
TRACER SPAN CONTEXT
Prometheus
Lightstep
Jaeger
Otel Deployment Strategies – use Otel Collector!
30 © 2023 ServiceNow, Inc. All Rights Reserved.
The OTel Collector is an independent binary
process, written in Go, that acts as a
‘universal agent’ for the OpenTelemetry
ecosystem.
At a high level, the goals of the collector
are…
- Collect, process, and export telemetry
data in a highly performant and stable
manner
- Support multiple types of telemetry
- Highly extensible and customizable, but
with an easy OOB experience
What is the OpenTelemetry Collector?
The collector provides separation of concerns between Dev and Ops/SRE teams
31 © 2023 ServiceNow, Inc. All Rights Reserved.
Telemetry data flows through the
collector, from receiver to exporter.
Multiple pipelines in a single collector
are configurable, but each must
operate on a single telemetry type -
either traces, or metrics.
All data received by a pipeline will be
processed by all processors and
exported to all exporters.
Pipelines
RECEIVE PROCESS EXPORT
32 © 2023 ServiceNow, Inc. All Rights Reserved.
What kind of processors exists?
• Optimize volume or performance
– batch: optimize nb of connections and network consumption
– tail or probalistic sampling: reduce volume of telemetry data exported
– queued retry: retry mechanism to resend data in case of failure
• Create data
– resource detection: get metrics from your system and/or cloud provider
– metrics generation: create new metrics from other ones
• Filter data
– filter, redaction: remove PII and telemetry data that is sensitive or useless
– routing: allow dynamic routing of data
• transform data
– attributes or resource: rename, delete, add information to your data
– delta, cumulative, groupby: do agregation or calculation on your metrics
– logs transform: use regex to manipulate log files
RECEIVE PROCESS EXPORT
33 © 2023 ServiceNow, Inc. All Rights Reserved.
receivers:
otlp:
protocols:
grpc:
endpoint: "0.0.0.0:55680"
http:
endpoint: "0.0.0.0:55681"
processors:
batch:
queued_retry:
extensions:
health_check: {}
exporters:
otlp:
endpoint: "ingest.lightstep.com:443"
headers:
"lightstep-access-token": "{{ .Values.lightstepKey }}"
service:
extensions: [health_check, zpages]
pipelines:
traces:
receivers: [otlp]
processors: [batch, queued_retry]
exporters: [otlp]
This can be any receiver, not just
OTLP. Remember, receivers can be
part of multiple pipelines!
Batch and Retry processors are
recommended to reduce
connections and decrease size of
outgoing reports.
Other export options include
compression (gzip), etc. If
satellites are in Single Project
mode, no headers needed, just
endpoint!
All configuration in single YAML file
Use Kubernetes Operator to deploy it:
https://github.com/open-telemetry/opentelemetry-operator
34 © 2023 ServiceNow, Inc. All Rights Reserved.
OpenTelemetry
Workshop & Labs
https://workshops.lightstep.com/workshop
s/nodejs-microservices-instrumentation/
35 © 2023 ServiceNow, Inc. All Rights Reserved.
Further readings
• OpenTelemetry documentation https://opentelemetry.io/docs/ and
https://opentelemetry.lightstep.com/
• OpenTelemetry registry to get up-to-date list of supported technologies and
projects: https://opentelemetry.io/registry/
• How to choose your Observability solution:
https://medium.com/dzerolabs/unpacking-observability-how-to-choose-an-
observability-vendor-aa0e6d80b71d
• Most collector components are well-documented, and you can find individual
READMEs in each sub-directory of the https://github.com/open-
telemetry/opentelemetry-collector repository
• Third-party extensions, processors, receivers, and exporters are available in the
https://github.com/open-telemetry/opentelemetry-collector-contrib repository

More Related Content

Similar to 2307 - DevBCN - Otel 101_compressed.pdf

Meetup OpenTelemetry Intro
Meetup OpenTelemetry IntroMeetup OpenTelemetry Intro
Meetup OpenTelemetry IntroDimitrisFinas1
 
Monitoring in Big Data Platform - Albert Lewandowski, GetInData
Monitoring in Big Data Platform - Albert Lewandowski, GetInDataMonitoring in Big Data Platform - Albert Lewandowski, GetInData
Monitoring in Big Data Platform - Albert Lewandowski, GetInDataGetInData
 
Cloud Native Summit 2019 Summary
Cloud Native Summit 2019 SummaryCloud Native Summit 2019 Summary
Cloud Native Summit 2019 SummaryEverett Toews
 
Dynatrace - Red Hat workshop : Monolith to Microservices
Dynatrace - Red Hat workshop : Monolith to MicroservicesDynatrace - Red Hat workshop : Monolith to Microservices
Dynatrace - Red Hat workshop : Monolith to MicroservicesSteve Caron
 
ThroughTheLookingGlass_EffectiveObservability.pptx
ThroughTheLookingGlass_EffectiveObservability.pptxThroughTheLookingGlass_EffectiveObservability.pptx
ThroughTheLookingGlass_EffectiveObservability.pptxGrace Jansen
 
Istio Triangle Kubernetes Meetup Aug 2019
Istio Triangle Kubernetes Meetup Aug 2019Istio Triangle Kubernetes Meetup Aug 2019
Istio Triangle Kubernetes Meetup Aug 2019Ram Vennam
 
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...Ambassador Labs
 
Implementing Observability for Kubernetes.pdf
Implementing Observability for Kubernetes.pdfImplementing Observability for Kubernetes.pdf
Implementing Observability for Kubernetes.pdfJose Manuel Ortega Candel
 
“Building Accelerated GStreamer Applications for Video and Audio AI,” a Prese...
“Building Accelerated GStreamer Applications for Video and Audio AI,” a Prese...“Building Accelerated GStreamer Applications for Video and Audio AI,” a Prese...
“Building Accelerated GStreamer Applications for Video and Audio AI,” a Prese...Edge AI and Vision Alliance
 
Dev Day Tokyo Hands-On Materials
Dev Day Tokyo Hands-On MaterialsDev Day Tokyo Hands-On Materials
Dev Day Tokyo Hands-On MaterialsUBiqube
 
“The OpenVX Standard API: Computer Vision for the Masses,” a Presentation fro...
“The OpenVX Standard API: Computer Vision for the Masses,” a Presentation fro...“The OpenVX Standard API: Computer Vision for the Masses,” a Presentation fro...
“The OpenVX Standard API: Computer Vision for the Masses,” a Presentation fro...Edge AI and Vision Alliance
 
Intro to GitOps with Weave GitOps, Flagger and Linkerd
Intro to GitOps with Weave GitOps, Flagger and LinkerdIntro to GitOps with Weave GitOps, Flagger and Linkerd
Intro to GitOps with Weave GitOps, Flagger and LinkerdWeaveworks
 
OpenStack Sydney summit - OpenStack HA and Testing
OpenStack Sydney summit - OpenStack HA and TestingOpenStack Sydney summit - OpenStack HA and Testing
OpenStack Sydney summit - OpenStack HA and TestingSampath Priyankara
 
Enabling .NET Apps with Monitoring and Management Using Steeltoe
Enabling .NET Apps with Monitoring and Management Using SteeltoeEnabling .NET Apps with Monitoring and Management Using Steeltoe
Enabling .NET Apps with Monitoring and Management Using SteeltoeVMware Tanzu
 
Slide DevSecOps Microservices
Slide DevSecOps Microservices Slide DevSecOps Microservices
Slide DevSecOps Microservices Hendri Karisma
 
Monitoring federation open stack infrastructure
Monitoring federation open stack infrastructureMonitoring federation open stack infrastructure
Monitoring federation open stack infrastructureFernando Lopez Aguilar
 
vRO Training Document
vRO Training DocumentvRO Training Document
vRO Training DocumentMayank Goyal
 
Security & Resiliency of Cloud Native Apps with Weave GitOps & Tetrate Servic...
Security & Resiliency of Cloud Native Apps with Weave GitOps & Tetrate Servic...Security & Resiliency of Cloud Native Apps with Weave GitOps & Tetrate Servic...
Security & Resiliency of Cloud Native Apps with Weave GitOps & Tetrate Servic...Weaveworks
 

Similar to 2307 - DevBCN - Otel 101_compressed.pdf (20)

Meetup OpenTelemetry Intro
Meetup OpenTelemetry IntroMeetup OpenTelemetry Intro
Meetup OpenTelemetry Intro
 
Monitoring in Big Data Platform - Albert Lewandowski, GetInData
Monitoring in Big Data Platform - Albert Lewandowski, GetInDataMonitoring in Big Data Platform - Albert Lewandowski, GetInData
Monitoring in Big Data Platform - Albert Lewandowski, GetInData
 
Cloud Native Summit 2019 Summary
Cloud Native Summit 2019 SummaryCloud Native Summit 2019 Summary
Cloud Native Summit 2019 Summary
 
Dynatrace - Red Hat workshop : Monolith to Microservices
Dynatrace - Red Hat workshop : Monolith to MicroservicesDynatrace - Red Hat workshop : Monolith to Microservices
Dynatrace - Red Hat workshop : Monolith to Microservices
 
ThroughTheLookingGlass_EffectiveObservability.pptx
ThroughTheLookingGlass_EffectiveObservability.pptxThroughTheLookingGlass_EffectiveObservability.pptx
ThroughTheLookingGlass_EffectiveObservability.pptx
 
Istio Triangle Kubernetes Meetup Aug 2019
Istio Triangle Kubernetes Meetup Aug 2019Istio Triangle Kubernetes Meetup Aug 2019
Istio Triangle Kubernetes Meetup Aug 2019
 
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
Montreal Kubernetes Meetup: Developer-first workflows (for microservices) on ...
 
Implementing Observability for Kubernetes.pdf
Implementing Observability for Kubernetes.pdfImplementing Observability for Kubernetes.pdf
Implementing Observability for Kubernetes.pdf
 
“Building Accelerated GStreamer Applications for Video and Audio AI,” a Prese...
“Building Accelerated GStreamer Applications for Video and Audio AI,” a Prese...“Building Accelerated GStreamer Applications for Video and Audio AI,” a Prese...
“Building Accelerated GStreamer Applications for Video and Audio AI,” a Prese...
 
Dev Day Tokyo Hands-On Materials
Dev Day Tokyo Hands-On MaterialsDev Day Tokyo Hands-On Materials
Dev Day Tokyo Hands-On Materials
 
“The OpenVX Standard API: Computer Vision for the Masses,” a Presentation fro...
“The OpenVX Standard API: Computer Vision for the Masses,” a Presentation fro...“The OpenVX Standard API: Computer Vision for the Masses,” a Presentation fro...
“The OpenVX Standard API: Computer Vision for the Masses,” a Presentation fro...
 
Opensource tools for OpenStack IAAS
Opensource tools for OpenStack IAASOpensource tools for OpenStack IAAS
Opensource tools for OpenStack IAAS
 
Intro to GitOps with Weave GitOps, Flagger and Linkerd
Intro to GitOps with Weave GitOps, Flagger and LinkerdIntro to GitOps with Weave GitOps, Flagger and Linkerd
Intro to GitOps with Weave GitOps, Flagger and Linkerd
 
OpenStack Sydney summit - OpenStack HA and Testing
OpenStack Sydney summit - OpenStack HA and TestingOpenStack Sydney summit - OpenStack HA and Testing
OpenStack Sydney summit - OpenStack HA and Testing
 
Enabling .NET Apps with Monitoring and Management Using Steeltoe
Enabling .NET Apps with Monitoring and Management Using SteeltoeEnabling .NET Apps with Monitoring and Management Using Steeltoe
Enabling .NET Apps with Monitoring and Management Using Steeltoe
 
citus™ iot ecosystem
citus™ iot ecosystemcitus™ iot ecosystem
citus™ iot ecosystem
 
Slide DevSecOps Microservices
Slide DevSecOps Microservices Slide DevSecOps Microservices
Slide DevSecOps Microservices
 
Monitoring federation open stack infrastructure
Monitoring federation open stack infrastructureMonitoring federation open stack infrastructure
Monitoring federation open stack infrastructure
 
vRO Training Document
vRO Training DocumentvRO Training Document
vRO Training Document
 
Security & Resiliency of Cloud Native Apps with Weave GitOps & Tetrate Servic...
Security & Resiliency of Cloud Native Apps with Weave GitOps & Tetrate Servic...Security & Resiliency of Cloud Native Apps with Weave GitOps & Tetrate Servic...
Security & Resiliency of Cloud Native Apps with Weave GitOps & Tetrate Servic...
 

Recently uploaded

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 

Recently uploaded (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 

2307 - DevBCN - Otel 101_compressed.pdf

  • 1. 1 © 2023 ServiceNow, Inc. All Rights Reserved. © 2023 ServiceNow, Inc. All Rights Reserved.
  • 2. © 2023 ServiceNow, Inc. All Rights Reserved. Confidential. 2 Agenda • What is OpenTelemetry? • Distributed Tracing Overview • Why you should use Distributed Traces? • How can you enable it? • instrumentation • collector from
  • 3. 3 Pillars of Observability
  • 4. New Open Source Revolution Open Source Project used to collect & manage traces, metrics, and logs in vendor-agnostic way
  • 5. 5 © 2023 ServiceNow, Inc. All Rights Reserved. OpenTelemetry Mission & Values OpenTelemetry's Mission is to enable effective observability by making high-quality, portable telemetry ubiquitous and vendor-agnostic. You want more? See Otel vision in https://github.com/open-telemetry/community/blob/main/mission-vision-values.md#otel-mission-vision-and-values The solution is built following the values below: • Compatibility • Stability • Resilience • Performance
  • 7. 7 © 2023 ServiceNow, Inc. All Rights Reserved. A brief history 2015 Lightstep is founded by Ben Sigelman, Daniel Spoonhower, and Ben Cronin 2016 Lightstep helps to found OpenTracing, the first common, portable API for distributed tracing 2017 Jaeger, an open-source tracing tool developed by Yuri Shkuro, is open- sourced by Uber 2018 Google releases a new portable instrumentation project called OpenCensus 2019 The OpenTracing and OpenCensus projects announce a merger, forming OpenTelemetry to be a part of CNCF 2020 OpenTelemetry is released in beta
  • 8. 8 © 2023 ServiceNow, Inc. All Rights Reserved. History vs legacy providers 2014 Kubernetes was first announced by Google 2014 Lambda, first serverless functions, announced by Amazon at AWS reinvent 2015 Lightstep founded 2016 OpenTracing, first common API for distributed tracing, founded with the help of Lightstep 2019 The OpenTracing and OpenCensus projects announce a merger, forming OpenTelemetry to be a part of CNCF 2020 OpenTelemetry is released in beta 2005 Dynatrace founded 2008 AppDynamics founded 2008 New Relic founded 2010 Datadog founded 2012 Promotheus initial release 2013 Docker debuted to the public at PyCon All legacy vendors exists even before Docker was invented!
  • 9. 9 © 2023 ServiceNow, Inc. All Rights Reserved. 2nd most active project in CNCF High-quality, ubiquitous, and portable telemetry to enable effective observability • Second largest CNCF Project and third largest Linux Foundation Project • Provides vendor-neutral open- source Observability framework for instrumenting, generating, collecting and exporting telemetry data such as metrics, traces and logs • Supported by all major Clouds (AWS, Azure, GCP) and Observability vendors • Lightstep is a cofounder and top contributor of OpenTelemetry Source: CNCF “OpenTelemetry continues to grow its contributor base and has become the second highest velocity project in the CNCF ecosystem.”
  • 10. 10 © 2023 ServiceNow, Inc. All Rights Reserved. Lightstep Founded Standards Languages Tracers Service Meshes / Proxies Containers, Platforms and Clouds Deployment Automation (CI/CD) Alerting and Tools Data Streaming and Storage Integrations – More than 600 integrations available! Go to OpenTelemetry registry to get up-to-date list of supported technologies and projects: https://opentelemetry.io/registry/
  • 11. 11 © 2023 ServiceNow, Inc. All Rights Reserved. © 2023 ServiceNow, Inc. All Rights Reserved.
  • 12. 12 © 2023 ServiceNow, Inc. All Rights Reserved. Trace Span Span Time client transaction from start to end load balancer transaction from start to end auth billing resource allocation and provisioning container start-up storage allocation start-up scripts Distributed traces overview
  • 13. 13 © 2023 ServiceNow, Inc. All Rights Reserved. Visualizing a trace
  • 14. 14 © 2023 ServiceNow, Inc. All Rights Reserved. Each span also has span context Span context is composed of attributes (key/value pairs) and events (log messages). These are added during instrumentation. Attributes (Tags) allow you to search and segment your data within LightStep Events (Logs) add information that is useful during root cause and debugging Visualizing a trace
  • 15. 15 © 2023 ServiceNow, Inc. All Rights Reserved. Lab 3.1: Example of trace span JSON formatted info, output when span.end() was called. "SpanContext": { "TraceID": "9850b11fa09d4b5fa4dd48dd37f3683b", "SpanID": "1113d149cfffa942", "TraceFlags": 1 }, "ParentSpanID": "e1e1624830d2378e", "SpanKind": "internal", "Name": "dbHandler/database", "StartTime": "2019-11-03T10:52:56.903919262Z", "EndTime": "2019-11-03T10:52:56.903923338Z", "Attributes": [], "MessageEvents": null, "Links": null, "Status": 0, "HasRemoteParent": false, "DroppedAttributeCount": 0, "DroppedMessageEventCount": 0, "DroppedLinkCount": 0, "ChildSpanCount": 0
  • 16. 16 © 2023 ServiceNow, Inc. All Rights Reserved. Lab 3.2: Example of trace attributes and log events "Attributes": [ { "Key": "http.host", "Value": { "Type": "STRING", "Value": "opentelemetry-instructor.glitch.me" } }, { "Key": "http.status_code", "Value": { "Type": "INT64", "Value": 200 } } ], "MessageEvents": [ { "Message": "annotation within span", "Attributes": null, "Time": "2019-11-03T10:52:56.903914029Z" } ],
  • 17. 17 © 2023 ServiceNow, Inc. All Rights Reserved. © 2023 ServiceNow, Inc. All Rights Reserved.
  • 18. 18 © 2023 ServiceNow, Inc. All Rights Reserved. Distributed Traces, first place to go to do Root Cause Analysis
  • 19. 19 © 2023 ServiceNow, Inc. All Rights Reserved. Distributed Traces, first place to go to do Root Cause Analysis
  • 20. 20 © 2023 ServiceNow, Inc. All Rights Reserved. © 2023 ServiceNow, Inc. All Rights Reserved.
  • 21. 21 © 2023 ServiceNow, Inc. All Rights Reserved. Implementation Tips • Use auto-instrumentation • ex: « JAVA_OPTS=- javaagent:/path/to/opentelemetry-javaagent.jar » • First, target your critical services • Instrument vertically • vertically ⬄ a full chain (ex: frontend to backend) • horizontally ⬄ a layer (ex: all my frontends services)
  • 22. 22 © 2023 ServiceNow, Inc. All Rights Reserved. Implementation Tips (2/2) • Add custom attributes • to query/group by • for RCA analytics and correlation • to create specific dashboards or reports • don’t reinvent the wheel, use Otel semantics • ex: business attributes (customer.id, article.category, shop.id) • Add log events • to remove need to go to the logs • to reduce amount of log • no more application/transaction logs in files, attach logs to spans • recommended: initial payload, all exceptions message • Create your own wrapper • to standardize usage among all teams
  • 23. 23 © 2023 ServiceNow, Inc. All Rights Reserved. OpenTelemetry support of dev languages You want to know more? See https://opentelemetry.io/docs/instrumentation/ LANGUAGE TRACE* METRICS* INSTRUMENTATION MANUAL/AUTO** C++ stable stable manual C# / .NET stable stable manual & auto Erlang / Elixir stable experiment al manual Go stable beta manual Java stable stable manual & auto Javascript / Node stable stable manual & auto Javascript / Browser stable stable manual & auto LANGUAGE TRACE* METRICS* INSTRUMENTATION MANUAL/AUTO** PHP beta beta manual Python stable stable manual & auto Ruby stable not yet manual & auto Rust beta alpha manual Swift stable experiment al manual (*) Status as of June 2023 (**) Automatic instrumentation means quick wins as no need to update existing code Supported languages versions: • .NET & .NET Framework all supported versions except .NET Fwk v3.5 as https://github.com/open-telemetry/opentelemetry-dotnet • Java >= v1.8 • NodeJS >=v10 as https://github.com/open-telemetry/opentelemetry-js • Python, only latest versions as of https://github.com/open- telemetry/opentelemetry-python
  • 24. 24 © 2023 ServiceNow, Inc. All Rights Reserved. OpenTelemetry instrumentation step by step • Declare dependencies • Declare destination options • Declare plugins • Get context • Start Span • Decorate Span • Create child Span • End Span • Rely on automatic context propagation • Do manual propagation • Use W3C Trace Context standard CONFIGURE TRACER CREATE SPANS CONTEXT PROPAGATION We will detail each of these steps in further slides
  • 25. 25 © 2023 ServiceNow, Inc. All Rights Reserved. Configure Tracer const opentelemetry = require('@opentelemetry/api'); const { NodeTracerProvider } = require('@opentelemetry/node'); const { SimpleSpanProcessor } = require('@opentelemetry/tracing'); const { CollectorTraceExporter } = require('@opentelemetry/exporter-collector'); const collectorOptions = { serviceName: '<Service Name>', // Provide a service name url: 'https://<Collector Host>:<Collector Port>', // URL and port to OTel Collector }; // Create an exporter for sending span data const exporter = new CollectorTraceExporter(collectorOptions); // Create a provider for activating and tracking spans const tracerProvider = new NodeTracerProvider({ plugins: { http: { enabled: true, // You may use a package name or absolute path to the file. path: '@opentelemetry/plugin-http', // Enable HTTP Plugin to automatically inject/extract context into HTTP headers } } }); // Configure a span processor for the tracer tracerProvider.addSpanProcessor(new SimpleSpanProcessor(exporter)); // Register the tracer tracerProvider.register(); Declare Dependencies Declare Destination Options Declare Plugins TRACER SPAN CONTEXT
  • 26. 26 © 2023 ServiceNow, Inc. All Rights Reserved. Use Existing Spans const api = require('@opentelemetry/api'); let activeContext = api.context.active() let activeSpan = api.trace.getSpan(activeContext); activeSpan.setAttribute('platform', 'osx'); activeSpan.setAttribute('version', '1.2.3'); activeSpan.addEvent('event in foo'); Get Active Context Decorate Span TRACER SPAN CONTEXT Get Active Span
  • 27. 27 © 2023 ServiceNow, Inc. All Rights Reserved. Create Spans const tracer = opentelemetry.trace.getTracer(); const span = tracer.startSpan('foo'); span.setAttribute('platform', 'osx'); span.setAttribute('version', '1.2.3'); span.addEvent('event in foo'); const childSpan = tracer.startSpan('bar', { parent: span, }); childSpan.end(); span.end(); Start Span Decorate Span Create Child Span End Span TRACER SPAN CONTEXT
  • 28. 28 © 2023 ServiceNow, Inc. All Rights Reserved. ● tracer.startSpan(name, {parent: <span>, …}) ○ This method returns a child of the specified span ● api.context.with(api.setSpan(api.context.active(), name)) ○ Starts a new span, sets it to be active. Optionally, can get a reference to the span ● api.trace.getSpan(api.context.active()) ○ Used to access & add information to the current span ● span.addEvent(msg) ○ Adds structured annotations (e.g. "logs") about what is currently happening ● span.setAttributes(core.Key(key).String(value)...) ○ Adds a structured, typed attribute to the current span. This may include a user id, a build id, a user- agent, etc. ● span.end() ○ Often used with defer, fires when the unit of work is complete and the span can be sent Tracer Span Methods TRACER SPAN CONTEXT
  • 30. 30 © 2023 ServiceNow, Inc. All Rights Reserved. The OTel Collector is an independent binary process, written in Go, that acts as a ‘universal agent’ for the OpenTelemetry ecosystem. At a high level, the goals of the collector are… - Collect, process, and export telemetry data in a highly performant and stable manner - Support multiple types of telemetry - Highly extensible and customizable, but with an easy OOB experience What is the OpenTelemetry Collector? The collector provides separation of concerns between Dev and Ops/SRE teams
  • 31. 31 © 2023 ServiceNow, Inc. All Rights Reserved. Telemetry data flows through the collector, from receiver to exporter. Multiple pipelines in a single collector are configurable, but each must operate on a single telemetry type - either traces, or metrics. All data received by a pipeline will be processed by all processors and exported to all exporters. Pipelines RECEIVE PROCESS EXPORT
  • 32. 32 © 2023 ServiceNow, Inc. All Rights Reserved. What kind of processors exists? • Optimize volume or performance – batch: optimize nb of connections and network consumption – tail or probalistic sampling: reduce volume of telemetry data exported – queued retry: retry mechanism to resend data in case of failure • Create data – resource detection: get metrics from your system and/or cloud provider – metrics generation: create new metrics from other ones • Filter data – filter, redaction: remove PII and telemetry data that is sensitive or useless – routing: allow dynamic routing of data • transform data – attributes or resource: rename, delete, add information to your data – delta, cumulative, groupby: do agregation or calculation on your metrics – logs transform: use regex to manipulate log files RECEIVE PROCESS EXPORT
  • 33. 33 © 2023 ServiceNow, Inc. All Rights Reserved. receivers: otlp: protocols: grpc: endpoint: "0.0.0.0:55680" http: endpoint: "0.0.0.0:55681" processors: batch: queued_retry: extensions: health_check: {} exporters: otlp: endpoint: "ingest.lightstep.com:443" headers: "lightstep-access-token": "{{ .Values.lightstepKey }}" service: extensions: [health_check, zpages] pipelines: traces: receivers: [otlp] processors: [batch, queued_retry] exporters: [otlp] This can be any receiver, not just OTLP. Remember, receivers can be part of multiple pipelines! Batch and Retry processors are recommended to reduce connections and decrease size of outgoing reports. Other export options include compression (gzip), etc. If satellites are in Single Project mode, no headers needed, just endpoint! All configuration in single YAML file Use Kubernetes Operator to deploy it: https://github.com/open-telemetry/opentelemetry-operator
  • 34. 34 © 2023 ServiceNow, Inc. All Rights Reserved. OpenTelemetry Workshop & Labs https://workshops.lightstep.com/workshop s/nodejs-microservices-instrumentation/
  • 35. 35 © 2023 ServiceNow, Inc. All Rights Reserved. Further readings • OpenTelemetry documentation https://opentelemetry.io/docs/ and https://opentelemetry.lightstep.com/ • OpenTelemetry registry to get up-to-date list of supported technologies and projects: https://opentelemetry.io/registry/ • How to choose your Observability solution: https://medium.com/dzerolabs/unpacking-observability-how-to-choose-an- observability-vendor-aa0e6d80b71d • Most collector components are well-documented, and you can find individual READMEs in each sub-directory of the https://github.com/open- telemetry/opentelemetry-collector repository • Third-party extensions, processors, receivers, and exporters are available in the https://github.com/open-telemetry/opentelemetry-collector-contrib repository