SlideShare una empresa de Scribd logo
1 de 32
Debugging Microservices
Key challenges and techniques
• Staff engineer at Lohika
• More than 17 years in IT
• Primary focus on JVM based languages, Big data and Microservices
About me
• Debugging microservices key challenges
• Observability
– Logging
– Monitoring
– Tracing
• Debugging tools for Kubernetes
– Telepresence v1 and v2
Agenda
The challenge
Monolithic application
• Single process
• Holystic view
• Simple infrastructure
• Can be deployed/debugged
locally
Microservice application
• Multiple processes
• Fractional view
• Complex infrastructure
• Local deployment/debug
can be an issue
The challenge (most optimistic figures)
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.370.9611&rep=rep1&type=pdf
The challenge
Monolithic application
• Single process
• Holystic view
• Simple infrastructure
• Can be deployed/debugged
locally
Microservice application
• Multiple processes
• Fractional view
• Complex infrastructure
• Local deployment/debug
can be an issue
Observability
Monitoring
• Provides high level view of the
system health and performance
(Grafana, Prometheus,
VictoriaMetrics)
Logging
• Keep record of input data,
processing and results in the
application (Elasticsearch, Fluent
bit, Kibana)
Tracing
• Insights about specific operation
(Open tracing, Jaeger)
Monitoring
• A way to get bird eye view on
the infrastructure and services
health
• A way to get information about
system and individual
components performance
• A way to be alerted on
SLA/SLO
• Infrastructure health and
resource utilization
• Application and individual
services health and resource
utilization
• Application and individual
services performance
• Application and individual
services errors
Why What
Monitoring- How?
• Define naming conventions for the metrics
• Structure dashboards
• Build dashboards to be used with predefined techniques e.g., Layer
peeling, Exemplars
• Dashboards for infrastructure and applications i.e., follow the methodology
(USE, RED)
• Dashboards for specific services e.g., Java and Spring
• Avoid having a lot of custom dashboards and too much data
• Avoid high data cardinality when using tags
• Avoid having false positive alerts
• Look for predefined dashboards e.g., Spring
USE and RED
• Utilization: the
proportion of the
resource that is used,
so 100% utilization
means no more work
can be accepted;
• Saturation: the degree
to which the resource
has extra work which it
can’t service, often
queued;
• Errors: the count of
error events;
RED
• Rate: the number of
requests our service
is serving;
• Error: the number of
failed requests;
• Duration: the amount
of time it takes to
process a request;
USE
Logging
• Monitoring and troubleshooting
application for engineers
• Helping operations
• Security, compliance
• A way to be alerted on
SLA/SLO
• Application events:
• Availability events
(startup/shutdown)
• Resources (connectivity issues)
• Threats
• Errors
• Processing events
• Highly depends on security/audit
and compliance requirements:
• Login/Logout
• Attempting accessing unauthorized
data
• User actions
Why What
Logging – How?
• Centralized logging
• Align on the log format and levels
• Use structured logs
• Ability to correlate request inter services
• Log messages same as code would be read by other engineers think of them
and help them
• Do not trust clocks
• Do not log sensitive information
Tracing with Jaeger
• A way to get details about
individual request/event
• A way to get insights into
performance
• A way to get cross service
dependencies
• Statistics on time spent
• Compare traces
• Share traces
• Timings and logs for:
• Database calls
• Calls to other services
• Messages queues
• Heavy processing
Why What
Tracing – How?
• Pick either open tracing or open telemetry
• Open telemetry is a merge of open tracing and open census
• Open telemetry is newer and provides metrics API as well
• Key concepts:
• Spans:
• Named, timed operation representing a piece of the workflow.
• Contains: operation name, start and finish timestamps, tags, logs and context
• May contain other spans
• Tracers
• The Tracer interface creates Spans and understands how to Inject (serialize)
and Extract (deserialize) their metadata across process boundaries
• A new trace is started whenever a new Span is created without references to a
parent Span.
Tracing – How?
• Add open tracing support to your application e.g., opentracing-spring-jaeger-cloud-
starter
• Add additional libraries e.g., gRPC(opentracing-grpc)
• In case application contains few languages align on span tags, names and implement
decorators
• Ensure trace id and span id are used as correlation id in logs
• If you have service mesh then interservice communication can be received for
free and integrated with Jaeger or you may look at tools like Kiali
• If your application uses Zipkin it still can be easily switched to Jaeger
Tracing – How?
• Install and configure Jaeger
• Client - libraries that implement open tracing API and send data further
• Agent – network daemon that listens to UDP and sends data to collector
• Collector – Stores data in the storage
• Storage – Storage with the span (Cassandra, Elasticsearch, Kafka)
• Query – provides API to read trace data from storage
• Ingester – reads data from Kafka and stores it in the storage
Tracing – How?
• Configure sampling
• Constant
• Probabilistic
• Rate limiting
• Remote
• Configure autoscaling for collectors
• Provide enough resources to the storage
Recap
• So:
• Complex infrastructure is monitored and there is visibility in
• Attempt to provide holistic view is provided by the Jaeger
• Centralized logging and open tracing allow to trace request through multiple processes
• How to troubleshoot then:
• Identify what version is deployed
• Punish people which use latest instead of specific deployment version
• Use metrics to check service and infrastructure health, resource consumption
• Find error(s) in the logs and by filtering by trace id find root operation
• Find corresponding operations in Jaeger and analyze the calls and compare with logs
• Build the hypothesis and test it or debug it
How can we debug services in Kubernetes?
• Port forward and remote debugging
• Tools like Telepresence and Squash
• Use cases:
• Issues reproduced only on the cluster
• Services accessible only on the cluster
• No ability to run service(s) locally
• Cloud native technologies
What telepresence tries to solve?
How does it solve it?
• Telepresence v1
• Provides ability to export env vars and swap deployment in the container with the
proxy
• Forwards ports that service exposes
• Routes all traffic through the proxy
• To achieve that:
• Run telepresence --swap-deployment {serviceName} --namespace
{namespaceName} --env-json ~/telepresence-legacy.json
• In other words:
• Service will run locally but would have access to all the resources in the cluster
and no debugging information will be passed via network and no time is spent
for container build/upload and deploy
Telepresence v1
• Telepresence v1 is cool and reliable tool which does not require
any cluster configuration
• Telepresence v1 is great but has a lot of limitations:
• Only one service at a time can be debugged
• Service is fully replaced and thus all traffic goes to your machine
• Thus, telepresence v2 was implemented
Telepresence v2
• Access all resources in cluster like your machine is deployed there
• telepresence connect
• Debug multiple services at a time
• Execute multiple intercept commands and point them to different local ports
• Intercept specific ports
• telepresence list
• kubectl get service example-service –output.yaml
• telepresence intercept example-service --port 8080:http --env-file ~/example-service-intercept.env
• Intercept specific requests
• telepresence intercept example-service --port 8080:http --env-file ~/example-service-intercept.env –preview-url=true
• Share dev environments
Telepresence v2
• Requires cluster level configuration
• Is not that stable as v1
Telepresence v2
Telepresence v2 cons
• Brew by default updates you to the latest which may require cluster
configuration
• It cannot intercept more than one port on the service
• It does not substitute the pod and thus if you consume messages
your breakpoint may not work
• It does not work with certain service meshes
So, what should I use?
• Use both 
• V1 suits for the cases when:
• there is more than one port to intercept
• you need to consume messages from the queues or Kafka
• It is ok to swap the deployment
• V2 suits for the cases:
• Connect to cluster resources without extra port forwards
• Intercept specific port
• Intercept specific requests
So, how would I do that?
• Install v2
• To install specific version (2.3.5), please use that command line:
• sudo curl -fL
https://app.getambassador.io/download/tel2/darwin/amd64/2.3.5/telepresence -
o /usr/local/bin/telepresence
• sudo chmod a+x /usr/local/bin/telepresence
• Install V1:
• brew install --cask macfuse
• brew install datawire/blackbird/telepresence-legacy
• ln -s /usr/local/Cellar/telepresence-legacy/0.109/bin/telepresence
/usr/local/bin/tel
Thank You!
Tracing – Trace timeline
Tracing – Dependency graph

Más contenido relacionado

La actualidad más candente

The Java Microservice Library
The Java Microservice LibraryThe Java Microservice Library
The Java Microservice Library
Rick Hightower
 

La actualidad más candente (20)

NATS: A Cloud Native Messaging System
NATS: A Cloud Native Messaging SystemNATS: A Cloud Native Messaging System
NATS: A Cloud Native Messaging System
 
Application Rollout - Istio
Application Rollout - Istio Application Rollout - Istio
Application Rollout - Istio
 
Atlanta Microservices Day: Istio Service Mesh
Atlanta Microservices Day: Istio Service MeshAtlanta Microservices Day: Istio Service Mesh
Atlanta Microservices Day: Istio Service Mesh
 
Come for the traffic management, stay for the security
Come for the traffic management, stay for the securityCome for the traffic management, stay for the security
Come for the traffic management, stay for the security
 
Microservices with Node and Docker
Microservices with Node and DockerMicroservices with Node and Docker
Microservices with Node and Docker
 
Microservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problemsMicroservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problems
 
«Real Time» Web Applications with SignalR in ASP.NET
«Real Time» Web Applications with SignalR in ASP.NET«Real Time» Web Applications with SignalR in ASP.NET
«Real Time» Web Applications with SignalR in ASP.NET
 
APIs: Intelligent Routing, Security, & Management
APIs: Intelligent Routing, Security, & ManagementAPIs: Intelligent Routing, Security, & Management
APIs: Intelligent Routing, Security, & Management
 
Connecting All Abstractions with Istio
Connecting All Abstractions with IstioConnecting All Abstractions with Istio
Connecting All Abstractions with Istio
 
API Microservices with Node.js and Docker
API Microservices with Node.js and DockerAPI Microservices with Node.js and Docker
API Microservices with Node.js and Docker
 
SignalR
SignalRSignalR
SignalR
 
An eventful tour from enterprise integration to serverless and functions
An eventful tour from enterprise integration to serverless and functionsAn eventful tour from enterprise integration to serverless and functions
An eventful tour from enterprise integration to serverless and functions
 
Using an API Gateway for Microservices (APAC Webinar)
Using an API Gateway for Microservices (APAC Webinar)Using an API Gateway for Microservices (APAC Webinar)
Using an API Gateway for Microservices (APAC Webinar)
 
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
IPaaS 2.0: Fuse Integration Services (Robert Davies & Keith Babo)
 
The Java Microservice Library
The Java Microservice LibraryThe Java Microservice Library
The Java Microservice Library
 
Microservice 4.0 Journey - From Spring NetFlix OSS to Istio Service Mesh and ...
Microservice 4.0 Journey - From Spring NetFlix OSS to Istio Service Mesh and ...Microservice 4.0 Journey - From Spring NetFlix OSS to Istio Service Mesh and ...
Microservice 4.0 Journey - From Spring NetFlix OSS to Istio Service Mesh and ...
 
Microservices with Node.js and Apache Cassandra
Microservices with Node.js and Apache CassandraMicroservices with Node.js and Apache Cassandra
Microservices with Node.js and Apache Cassandra
 
The Hardest Part of Microservices: Calling Your Services
The Hardest Part of Microservices: Calling Your ServicesThe Hardest Part of Microservices: Calling Your Services
The Hardest Part of Microservices: Calling Your Services
 
The 6 Rules for Modernizing Your Legacy Java Monolith with Microservices
The 6 Rules for Modernizing Your Legacy Java Monolith with MicroservicesThe 6 Rules for Modernizing Your Legacy Java Monolith with Microservices
The 6 Rules for Modernizing Your Legacy Java Monolith with Microservices
 
Data stores: beyond relational databases
Data stores: beyond relational databasesData stores: beyond relational databases
Data stores: beyond relational databases
 

Similar a Debugging Microservices - key challenges and techniques - Microservices Odesa #TechTalk, Andrey Kolodnitskiy | 10/08/2021

Netflix0SS Services on Docker
Netflix0SS Services on DockerNetflix0SS Services on Docker
Netflix0SS Services on Docker
Docker, Inc.
 
Ibm cloud nativenetflixossfinal
Ibm cloud nativenetflixossfinalIbm cloud nativenetflixossfinal
Ibm cloud nativenetflixossfinal
aspyker
 

Similar a Debugging Microservices - key challenges and techniques - Microservices Odesa #TechTalk, Andrey Kolodnitskiy | 10/08/2021 (20)

.NET microservices with Azure Service Fabric
.NET microservices with Azure Service Fabric.NET microservices with Azure Service Fabric
.NET microservices with Azure Service Fabric
 
Spring Cloud: Why? How? What?
Spring Cloud: Why? How? What?Spring Cloud: Why? How? What?
Spring Cloud: Why? How? What?
 
Cloud Services Powered by IBM SoftLayer and NetflixOSS
Cloud Services Powered by IBM SoftLayer and NetflixOSSCloud Services Powered by IBM SoftLayer and NetflixOSS
Cloud Services Powered by IBM SoftLayer and NetflixOSS
 
Redundant devops
Redundant devopsRedundant devops
Redundant devops
 
Kubernetes Infra 2.0
Kubernetes Infra 2.0Kubernetes Infra 2.0
Kubernetes Infra 2.0
 
JakartaOne Livestream CN4J: Eclipse MicroProfile - Your Cloud-Native Companion
JakartaOne Livestream CN4J: Eclipse MicroProfile - Your Cloud-Native CompanionJakartaOne Livestream CN4J: Eclipse MicroProfile - Your Cloud-Native Companion
JakartaOne Livestream CN4J: Eclipse MicroProfile - Your Cloud-Native Companion
 
Stay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolithStay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolith
 
Microservices for java architects it-symposium-2015-09-15
Microservices for java architects it-symposium-2015-09-15Microservices for java architects it-symposium-2015-09-15
Microservices for java architects it-symposium-2015-09-15
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
ADDO Open Source Observability Tools
ADDO Open Source Observability Tools ADDO Open Source Observability Tools
ADDO Open Source Observability Tools
 
Evolving for Kubernetes
Evolving for KubernetesEvolving for Kubernetes
Evolving for Kubernetes
 
Patterns and Pains of Migrating Legacy Applications to Kubernetes
Patterns and Pains of Migrating Legacy Applications to KubernetesPatterns and Pains of Migrating Legacy Applications to Kubernetes
Patterns and Pains of Migrating Legacy Applications to Kubernetes
 
Patterns and Pains of Migrating Legacy Applications to Kubernetes
Patterns and Pains of Migrating Legacy Applications to KubernetesPatterns and Pains of Migrating Legacy Applications to Kubernetes
Patterns and Pains of Migrating Legacy Applications to Kubernetes
 
Building Modern Digital Services on Scalable Private Government Infrastructur...
Building Modern Digital Services on Scalable Private Government Infrastructur...Building Modern Digital Services on Scalable Private Government Infrastructur...
Building Modern Digital Services on Scalable Private Government Infrastructur...
 
Netflix0SS Services on Docker
Netflix0SS Services on DockerNetflix0SS Services on Docker
Netflix0SS Services on Docker
 
Ibm cloud nativenetflixossfinal
Ibm cloud nativenetflixossfinalIbm cloud nativenetflixossfinal
Ibm cloud nativenetflixossfinal
 
Event Bus as Backbone for Decoupled Microservice Choreography (Oracle Code, A...
Event Bus as Backbone for Decoupled Microservice Choreography (Oracle Code, A...Event Bus as Backbone for Decoupled Microservice Choreography (Oracle Code, A...
Event Bus as Backbone for Decoupled Microservice Choreography (Oracle Code, A...
 
Exploring Twitter's Finagle technology stack for microservices
Exploring Twitter's Finagle technology stack for microservicesExploring Twitter's Finagle technology stack for microservices
Exploring Twitter's Finagle technology stack for microservices
 
Resilience Planning & How the Empire Strikes Back
Resilience Planning & How the Empire Strikes BackResilience Planning & How the Empire Strikes Back
Resilience Planning & How the Empire Strikes Back
 
Building data intensive applications
Building data intensive applicationsBuilding data intensive applications
Building data intensive applications
 

Más de Lohika_Odessa_TechTalks

Design and Evolution of APIs in Microservice Architecture
Design and Evolution of APIs in Microservice ArchitectureDesign and Evolution of APIs in Microservice Architecture
Design and Evolution of APIs in Microservice Architecture
Lohika_Odessa_TechTalks
 
Micro-frontends – is it a new normal?
Micro-frontends – is it a new normal?Micro-frontends – is it a new normal?
Micro-frontends – is it a new normal?
Lohika_Odessa_TechTalks
 
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalks
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalksSelenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalks
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalks
Lohika_Odessa_TechTalks
 

Más de Lohika_Odessa_TechTalks (20)

OAuth2 Authorization Server Under the Hood
OAuth2 Authorization Server Under the HoodOAuth2 Authorization Server Under the Hood
OAuth2 Authorization Server Under the Hood
 
Design and Evolution of APIs in Microservice Architecture
Design and Evolution of APIs in Microservice ArchitectureDesign and Evolution of APIs in Microservice Architecture
Design and Evolution of APIs in Microservice Architecture
 
Micro-frontends – is it a new normal?
Micro-frontends – is it a new normal?Micro-frontends – is it a new normal?
Micro-frontends – is it a new normal?
 
Multithreading in go
Multithreading in goMultithreading in go
Multithreading in go
 
Druid - Interactive Analytics At Scale
Druid - Interactive Analytics At ScaleDruid - Interactive Analytics At Scale
Druid - Interactive Analytics At Scale
 
DevOps Odessa #TechTalks 21.01.2020
DevOps Odessa #TechTalks 21.01.2020DevOps Odessa #TechTalks 21.01.2020
DevOps Odessa #TechTalks 21.01.2020
 
Jenkins' shared libraries in action
Jenkins' shared libraries in actionJenkins' shared libraries in action
Jenkins' shared libraries in action
 
Prometheus: infrastructure and application monitoring in kubernetes cluster
Prometheus: infrastructure and application monitoring in kubernetes clusterPrometheus: infrastructure and application monitoring in kubernetes cluster
Prometheus: infrastructure and application monitoring in kubernetes cluster
 
Architectural peripherals of react by Vadym Zhiltsov
Architectural peripherals of react by Vadym ZhiltsovArchitectural peripherals of react by Vadym Zhiltsov
Architectural peripherals of react by Vadym Zhiltsov
 
React native by example by Vadim Ruban
React native by example by Vadim RubanReact native by example by Vadim Ruban
React native by example by Vadim Ruban
 
Aws lambda by Leonid Amigud
Aws lambda by Leonid AmigudAws lambda by Leonid Amigud
Aws lambda by Leonid Amigud
 
Congratulations, you have been promoted to a manager role. You`ve got new pro...
Congratulations, you have been promoted to a manager role. You`ve got new pro...Congratulations, you have been promoted to a manager role. You`ve got new pro...
Congratulations, you have been promoted to a manager role. You`ve got new pro...
 
"Don't touch me and give me my money" or how motivate people who can but don...
"Don't touch me and give me my money" or  how motivate people who can but don..."Don't touch me and give me my money" or  how motivate people who can but don...
"Don't touch me and give me my money" or how motivate people who can but don...
 
Docker based Architecture by Denys Serdiuk
Docker based Architecture by Denys SerdiukDocker based Architecture by Denys Serdiuk
Docker based Architecture by Denys Serdiuk
 
SparkSpark in the Big Data dark by Sergey Levandovskiy
SparkSpark in the Big Data dark by Sergey Levandovskiy  SparkSpark in the Big Data dark by Sergey Levandovskiy
SparkSpark in the Big Data dark by Sergey Levandovskiy
 
Burnout and how to avoid it in your team. Responsible person's issue by Andre...
Burnout and how to avoid it in your team. Responsible person's issue by Andre...Burnout and how to avoid it in your team. Responsible person's issue by Andre...
Burnout and how to avoid it in your team. Responsible person's issue by Andre...
 
Performance evaluation process as a way to empower your employees and help th...
Performance evaluation process as a way to empower your employees and help th...Performance evaluation process as a way to empower your employees and help th...
Performance evaluation process as a way to empower your employees and help th...
 
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalks
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalksSelenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalks
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalks
 
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f..." Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
" Performance testing for Automation QA - why and how " by Andrey Kovalenko f...
 
"WEB applications security testing" by Kirill Semenov for Lohika Odessa QA Te...
"WEB applications security testing" by Kirill Semenov for Lohika Odessa QA Te..."WEB applications security testing" by Kirill Semenov for Lohika Odessa QA Te...
"WEB applications security testing" by Kirill Semenov for Lohika Odessa QA Te...
 

Último

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 

Debugging Microservices - key challenges and techniques - Microservices Odesa #TechTalk, Andrey Kolodnitskiy | 10/08/2021

  • 2. • Staff engineer at Lohika • More than 17 years in IT • Primary focus on JVM based languages, Big data and Microservices About me
  • 3. • Debugging microservices key challenges • Observability – Logging – Monitoring – Tracing • Debugging tools for Kubernetes – Telepresence v1 and v2 Agenda
  • 4. The challenge Monolithic application • Single process • Holystic view • Simple infrastructure • Can be deployed/debugged locally Microservice application • Multiple processes • Fractional view • Complex infrastructure • Local deployment/debug can be an issue
  • 5. The challenge (most optimistic figures) http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.370.9611&rep=rep1&type=pdf
  • 6. The challenge Monolithic application • Single process • Holystic view • Simple infrastructure • Can be deployed/debugged locally Microservice application • Multiple processes • Fractional view • Complex infrastructure • Local deployment/debug can be an issue
  • 7. Observability Monitoring • Provides high level view of the system health and performance (Grafana, Prometheus, VictoriaMetrics) Logging • Keep record of input data, processing and results in the application (Elasticsearch, Fluent bit, Kibana) Tracing • Insights about specific operation (Open tracing, Jaeger)
  • 8. Monitoring • A way to get bird eye view on the infrastructure and services health • A way to get information about system and individual components performance • A way to be alerted on SLA/SLO • Infrastructure health and resource utilization • Application and individual services health and resource utilization • Application and individual services performance • Application and individual services errors Why What
  • 9. Monitoring- How? • Define naming conventions for the metrics • Structure dashboards • Build dashboards to be used with predefined techniques e.g., Layer peeling, Exemplars • Dashboards for infrastructure and applications i.e., follow the methodology (USE, RED) • Dashboards for specific services e.g., Java and Spring • Avoid having a lot of custom dashboards and too much data • Avoid high data cardinality when using tags • Avoid having false positive alerts • Look for predefined dashboards e.g., Spring
  • 10. USE and RED • Utilization: the proportion of the resource that is used, so 100% utilization means no more work can be accepted; • Saturation: the degree to which the resource has extra work which it can’t service, often queued; • Errors: the count of error events; RED • Rate: the number of requests our service is serving; • Error: the number of failed requests; • Duration: the amount of time it takes to process a request; USE
  • 11. Logging • Monitoring and troubleshooting application for engineers • Helping operations • Security, compliance • A way to be alerted on SLA/SLO • Application events: • Availability events (startup/shutdown) • Resources (connectivity issues) • Threats • Errors • Processing events • Highly depends on security/audit and compliance requirements: • Login/Logout • Attempting accessing unauthorized data • User actions Why What
  • 12. Logging – How? • Centralized logging • Align on the log format and levels • Use structured logs • Ability to correlate request inter services • Log messages same as code would be read by other engineers think of them and help them • Do not trust clocks • Do not log sensitive information
  • 13. Tracing with Jaeger • A way to get details about individual request/event • A way to get insights into performance • A way to get cross service dependencies • Statistics on time spent • Compare traces • Share traces • Timings and logs for: • Database calls • Calls to other services • Messages queues • Heavy processing Why What
  • 14. Tracing – How? • Pick either open tracing or open telemetry • Open telemetry is a merge of open tracing and open census • Open telemetry is newer and provides metrics API as well • Key concepts: • Spans: • Named, timed operation representing a piece of the workflow. • Contains: operation name, start and finish timestamps, tags, logs and context • May contain other spans • Tracers • The Tracer interface creates Spans and understands how to Inject (serialize) and Extract (deserialize) their metadata across process boundaries • A new trace is started whenever a new Span is created without references to a parent Span.
  • 15. Tracing – How? • Add open tracing support to your application e.g., opentracing-spring-jaeger-cloud- starter • Add additional libraries e.g., gRPC(opentracing-grpc) • In case application contains few languages align on span tags, names and implement decorators • Ensure trace id and span id are used as correlation id in logs • If you have service mesh then interservice communication can be received for free and integrated with Jaeger or you may look at tools like Kiali • If your application uses Zipkin it still can be easily switched to Jaeger
  • 16. Tracing – How? • Install and configure Jaeger • Client - libraries that implement open tracing API and send data further • Agent – network daemon that listens to UDP and sends data to collector • Collector – Stores data in the storage • Storage – Storage with the span (Cassandra, Elasticsearch, Kafka) • Query – provides API to read trace data from storage • Ingester – reads data from Kafka and stores it in the storage
  • 17.
  • 18. Tracing – How? • Configure sampling • Constant • Probabilistic • Rate limiting • Remote • Configure autoscaling for collectors • Provide enough resources to the storage
  • 19. Recap • So: • Complex infrastructure is monitored and there is visibility in • Attempt to provide holistic view is provided by the Jaeger • Centralized logging and open tracing allow to trace request through multiple processes • How to troubleshoot then: • Identify what version is deployed • Punish people which use latest instead of specific deployment version • Use metrics to check service and infrastructure health, resource consumption • Find error(s) in the logs and by filtering by trace id find root operation • Find corresponding operations in Jaeger and analyze the calls and compare with logs • Build the hypothesis and test it or debug it
  • 20. How can we debug services in Kubernetes? • Port forward and remote debugging • Tools like Telepresence and Squash • Use cases: • Issues reproduced only on the cluster • Services accessible only on the cluster • No ability to run service(s) locally • Cloud native technologies
  • 22. How does it solve it? • Telepresence v1 • Provides ability to export env vars and swap deployment in the container with the proxy • Forwards ports that service exposes • Routes all traffic through the proxy • To achieve that: • Run telepresence --swap-deployment {serviceName} --namespace {namespaceName} --env-json ~/telepresence-legacy.json • In other words: • Service will run locally but would have access to all the resources in the cluster and no debugging information will be passed via network and no time is spent for container build/upload and deploy
  • 23. Telepresence v1 • Telepresence v1 is cool and reliable tool which does not require any cluster configuration • Telepresence v1 is great but has a lot of limitations: • Only one service at a time can be debugged • Service is fully replaced and thus all traffic goes to your machine • Thus, telepresence v2 was implemented
  • 24. Telepresence v2 • Access all resources in cluster like your machine is deployed there • telepresence connect • Debug multiple services at a time • Execute multiple intercept commands and point them to different local ports • Intercept specific ports • telepresence list • kubectl get service example-service –output.yaml • telepresence intercept example-service --port 8080:http --env-file ~/example-service-intercept.env • Intercept specific requests • telepresence intercept example-service --port 8080:http --env-file ~/example-service-intercept.env –preview-url=true • Share dev environments
  • 25. Telepresence v2 • Requires cluster level configuration • Is not that stable as v1
  • 27. Telepresence v2 cons • Brew by default updates you to the latest which may require cluster configuration • It cannot intercept more than one port on the service • It does not substitute the pod and thus if you consume messages your breakpoint may not work • It does not work with certain service meshes
  • 28. So, what should I use? • Use both  • V1 suits for the cases when: • there is more than one port to intercept • you need to consume messages from the queues or Kafka • It is ok to swap the deployment • V2 suits for the cases: • Connect to cluster resources without extra port forwards • Intercept specific port • Intercept specific requests
  • 29. So, how would I do that? • Install v2 • To install specific version (2.3.5), please use that command line: • sudo curl -fL https://app.getambassador.io/download/tel2/darwin/amd64/2.3.5/telepresence - o /usr/local/bin/telepresence • sudo chmod a+x /usr/local/bin/telepresence • Install V1: • brew install --cask macfuse • brew install datawire/blackbird/telepresence-legacy • ln -s /usr/local/Cellar/telepresence-legacy/0.109/bin/telepresence /usr/local/bin/tel
  • 31. Tracing – Trace timeline