SlideShare une entreprise Scribd logo
1  sur  40
Télécharger pour lire hors ligne
^
KEEP
CALM
AND
SERILOG
ELASTICSEARCH
KIBANA
ON .NET CORE
Maciej Szymczyk
• Big Data Engineer / Software Developer
• Professional Soldier / National Cyber Security Centre
• Teacher at Military University of Technology
• Blogger – Wiadro Danych – https://wiadrodanych.pl
• Amateur Cyclist & Triathlete ( ½ Ironman Finisher)
My first webapp
• MVC – All logic in Controllers
• Zero logging
• Zero metrics
• Asking customers what to do to reproduce bugs
Complex apps
• Microservices
• Many instances
• Polyglot persistence
• Web servers Apache/Nginx/IIS
• Many types of clients (Android / iOS / Web)
• Docker/Docker Swarm/Kubernetes
• External dependencies (GCM / APNS)
What can we log?
Usage
Audit
Statistics
Performance Errors Debug
When/What can we log?
• Messages
• Requests
• Body
• Query String Values
• Headers
• Methods
• Parameters
• User Id/IP
• Client type/version
• Service/Machine Name
• Correlation/Trace Id (Guid)
How much should I log?
What should not be logged?
Where should I put my logs?
• Console
• Log Files
• Relational Database (MSSQL)
• Elasticsearch / Splunk / Loki
• HDFS / S3 / ADLS
LET’S USE RDB
OK, YOU WILL
BUILD
DASHBOARDS
Let’s use RDB and build graphs and dashboards!
When your only tool is a hammer,
everything looks like a nail
Elasticsearch
• Full text search engine based on Apache Lucene
• REST API
• Open Source
• Scalable
• Multiple ways of injestion
• REST
• Beats (Filebeat, Metricbeat, Heartbeat, etc)
• Logstash
Elastic Stack usecase
• Logs/metrics aggregation
• Search engine
• Realtime Business Analytics
• SIEM – Security Information and Event Management
RBD Elasticsearch
Database Index
Table Type* / Index
Row Document
Column Field
Schema Mapping
* Deprecated since 7.x
Elastic Stack Architecture
Beats
Logstash
Elasticsearch
Kibana
HTTP
Kibana
• Visualisation
• Dashboards
• Analytics
• Uptime
• Infrastructure
• SIEM
Logstash
Beats
• Filebeat – logs
• Metricbeat – metrics
• Packetbeat – netflow
• Winlogbeat – Windows events/logs
• Auditbeat – security (auditd, files integrity, logins,
proceses)
• Heartbeat – uptime
• Functionbeat – cloud data collector (FaaS)
Easy way
HTTP
A little bit more complex
HTTP
Data Temperature + Retention Policy
APP HOT
Logs
WARM
COLD
Metrics
Scalability
• Master nodes
• Data nodes
• Coordinator nodes
• Ingest nodes
• ML nodes
Minimal recommended cluster
C C
MM
D D
M
Shard
• Part of Elasticsearch index
• Shards are distributed across cluster
• You can’t change numer of shards after creating index
• Each shard can has 0 - n replicas
Index
SHARD 1
SHARD N
REPLICA N
REPLICA 1
...
...
Indices, shards, replicas
26
Posts
SHARD 1
Node 2Node 1 Node 3 Node 4
SHARD 2
REPLICA 2
REPLICA 1SHARD 3
REPLICA 3
Indices, shards, replicas
27
Posts
SHARD 1
Node 2Node 1 Node 3 Node 4
SHARD 2
REPLICA 2
REPLICA 1SHARD 3
REPLICA 3
Indices, shards, replicas
28
Posts
SHARD 1
Node 2Node 1 Node 3 Node 4
SHARD 2 REPLICA 2
REPLICA 1SHARD 3
REPLICA 3
Elasticsearch licence
How to try Elasticsearch?
Visit
https://wiadrodanych.pl/docker/docker-na-pomoc/
for Elasticsearch + Kibana Docker Compose YAML
Demo 1
Why Serilog?
• Structured logging
• Easy to use
• Multiple sinks
• Integration with .NET Core
Demo 2
Too lazy to…
• Implement wrapper…
• …and config for it…
• …and convince other to use it.
• Replace existing ILogger<> usages
• Try catch every piece of code for errors
• Use Stopwatch all the time
• Look for username in logs from controller
.NET Core Middlewares
TraceId
https://devblogs.microsoft.com/aspnet/improvements-in-net-core-3-0-for-troubleshooting-and-monitoring-distributed-apps/
Demo 3
Application Performance Monitor (APM)
• Distributed tracing
• APM agent streams
application
performance metrics
to APM server
• Detect anomalous
response Times
• Java, .NET, Node.js,
Django, Flask, Rails,
Rack, RUM – JS, Go
Elasticsearch takeaways
• Do not exceed 64 GB of RAM per data node (31 GB JVM)
• SSD > HDD
• avoid NAS/SAN
• Use ECS (Elastic Common Schema)
• Use ILM (Index Lifecycle Management)
• Hot/Warm/Cold Architecture
• define rules over when to perform certain actions
Thx!
https://wiadrodanych.pl/4dev <= code
https://wiadrodanych.pl/elastic <= course

Contenu connexe

Tendances

Tendances (20)

Apache Iceberg - A Table Format for Hige Analytic Datasets
Apache Iceberg - A Table Format for Hige Analytic DatasetsApache Iceberg - A Table Format for Hige Analytic Datasets
Apache Iceberg - A Table Format for Hige Analytic Datasets
 
KrakenD API Gateway
KrakenD API GatewayKrakenD API Gateway
KrakenD API Gateway
 
How Scylla Make Adding and Removing Nodes Faster and Safer
How Scylla Make Adding and Removing Nodes Faster and SaferHow Scylla Make Adding and Removing Nodes Faster and Safer
How Scylla Make Adding and Removing Nodes Faster and Safer
 
Hive Bucketing in Apache Spark with Tejas Patil
Hive Bucketing in Apache Spark with Tejas PatilHive Bucketing in Apache Spark with Tejas Patil
Hive Bucketing in Apache Spark with Tejas Patil
 
OpenStack Backup, Restore, DR (Freezer)
OpenStack Backup, Restore, DR (Freezer)OpenStack Backup, Restore, DR (Freezer)
OpenStack Backup, Restore, DR (Freezer)
 
Serverless
ServerlessServerless
Serverless
 
Building a Multi-tenanted SaaS with Node.js
Building a Multi-tenanted SaaS with Node.jsBuilding a Multi-tenanted SaaS with Node.js
Building a Multi-tenanted SaaS with Node.js
 
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017
Best Practices for Running PostgreSQL on AWS - DAT314 - re:Invent 2017
 
[236] 카카오의데이터파이프라인 윤도영
[236] 카카오의데이터파이프라인 윤도영[236] 카카오의데이터파이프라인 윤도영
[236] 카카오의데이터파이프라인 윤도영
 
Introduction to Azure Functions
Introduction to Azure FunctionsIntroduction to Azure Functions
Introduction to Azure Functions
 
Serverless and Design Patterns In GCP
Serverless and Design Patterns In GCPServerless and Design Patterns In GCP
Serverless and Design Patterns In GCP
 
Microservices in the Apache Kafka Ecosystem
Microservices in the Apache Kafka EcosystemMicroservices in the Apache Kafka Ecosystem
Microservices in the Apache Kafka Ecosystem
 
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
Introduction and Overview of Apache Kafka, TriHUG July 23, 2013
 
E2E Data Pipeline - Apache Spark/Airflow/Livy
E2E Data Pipeline - Apache Spark/Airflow/LivyE2E Data Pipeline - Apache Spark/Airflow/Livy
E2E Data Pipeline - Apache Spark/Airflow/Livy
 
Stability Patterns for Microservices
Stability Patterns for MicroservicesStability Patterns for Microservices
Stability Patterns for Microservices
 
Kafka At Scale in the Cloud
Kafka At Scale in the CloudKafka At Scale in the Cloud
Kafka At Scale in the Cloud
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
 
Scylla Summit 2022: Making Schema Changes Safe with Raft
Scylla Summit 2022: Making Schema Changes Safe with RaftScylla Summit 2022: Making Schema Changes Safe with Raft
Scylla Summit 2022: Making Schema Changes Safe with Raft
 
Microsoft AZ-900 Dumps Questions
Microsoft AZ-900 Dumps QuestionsMicrosoft AZ-900 Dumps Questions
Microsoft AZ-900 Dumps Questions
 
What we've learned from running a PostgreSQL managed service on Kubernetes
What we've learned from running a PostgreSQL managed service on KubernetesWhat we've learned from running a PostgreSQL managed service on Kubernetes
What we've learned from running a PostgreSQL managed service on Kubernetes
 

Similaire à Keep Calm And Serilog Elasticsearch Kibana on .NET Core

SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1
sqlserver.co.il
 

Similaire à Keep Calm And Serilog Elasticsearch Kibana on .NET Core (20)

Keep Calm And Serilog Elasticsearch Kibana on .NET Core - 132. Spotkanie WG.N...
Keep Calm And Serilog Elasticsearch Kibana on .NET Core - 132. Spotkanie WG.N...Keep Calm And Serilog Elasticsearch Kibana on .NET Core - 132. Spotkanie WG.N...
Keep Calm And Serilog Elasticsearch Kibana on .NET Core - 132. Spotkanie WG.N...
 
OSDC 2015: Tudor Golubenco | Application Performance Management with Packetbe...
OSDC 2015: Tudor Golubenco | Application Performance Management with Packetbe...OSDC 2015: Tudor Golubenco | Application Performance Management with Packetbe...
OSDC 2015: Tudor Golubenco | Application Performance Management with Packetbe...
 
Apache Geode Meetup, Cork, Ireland at CIT
Apache Geode Meetup, Cork, Ireland at CITApache Geode Meetup, Cork, Ireland at CIT
Apache Geode Meetup, Cork, Ireland at CIT
 
Introduction to Apache Geode (Cork, Ireland)
Introduction to Apache Geode (Cork, Ireland)Introduction to Apache Geode (Cork, Ireland)
Introduction to Apache Geode (Cork, Ireland)
 
When Networks Meet Apps, Samuel Bercovici & Nati Shalom
When Networks Meet Apps, Samuel Bercovici & Nati ShalomWhen Networks Meet Apps, Samuel Bercovici & Nati Shalom
When Networks Meet Apps, Samuel Bercovici & Nati Shalom
 
When networks meets apps (open stack atlanta)
When networks meets apps (open stack atlanta)When networks meets apps (open stack atlanta)
When networks meets apps (open stack atlanta)
 
IBM IoT Architecture and Capabilities at the Edge and Cloud
IBM IoT Architecture and Capabilities at the Edge and Cloud IBM IoT Architecture and Capabilities at the Edge and Cloud
IBM IoT Architecture and Capabilities at the Edge and Cloud
 
Aerospike Hybrid Memory Architecture
Aerospike Hybrid Memory ArchitectureAerospike Hybrid Memory Architecture
Aerospike Hybrid Memory Architecture
 
Sap basis-transaction-codes
Sap basis-transaction-codesSap basis-transaction-codes
Sap basis-transaction-codes
 
AWS re:Invent 2016: JustGiving: Serverless Data Pipelines, Event-Driven ETL, ...
AWS re:Invent 2016: JustGiving: Serverless Data Pipelines, Event-Driven ETL, ...AWS re:Invent 2016: JustGiving: Serverless Data Pipelines, Event-Driven ETL, ...
AWS re:Invent 2016: JustGiving: Serverless Data Pipelines, Event-Driven ETL, ...
 
Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
 Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
Monitoring and Scaling Redis at DataDog - Ilan Rabinovitch, DataDog
 
IBM Internet-of-Things architecture and capabilities
IBM Internet-of-Things architecture and capabilitiesIBM Internet-of-Things architecture and capabilities
IBM Internet-of-Things architecture and capabilities
 
Summer 2017 undergraduate research powerpoint
Summer 2017 undergraduate research powerpointSummer 2017 undergraduate research powerpoint
Summer 2017 undergraduate research powerpoint
 
Global Big Data Conference Sept 2014 AWS Kinesis Spark Streaming Approximatio...
Global Big Data Conference Sept 2014 AWS Kinesis Spark Streaming Approximatio...Global Big Data Conference Sept 2014 AWS Kinesis Spark Streaming Approximatio...
Global Big Data Conference Sept 2014 AWS Kinesis Spark Streaming Approximatio...
 
Ibm_IoT_Architecture_and_Capabilities
Ibm_IoT_Architecture_and_CapabilitiesIbm_IoT_Architecture_and_Capabilities
Ibm_IoT_Architecture_and_Capabilities
 
Dev nexus 2017
Dev nexus 2017Dev nexus 2017
Dev nexus 2017
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1
 
How to create custom dashboards in Elastic Search / Kibana with Performance V...
How to create custom dashboards in Elastic Search / Kibana with Performance V...How to create custom dashboards in Elastic Search / Kibana with Performance V...
How to create custom dashboards in Elastic Search / Kibana with Performance V...
 
Devnexus 2018
Devnexus 2018Devnexus 2018
Devnexus 2018
 
Apache Geode Meetup, London
Apache Geode Meetup, LondonApache Geode Meetup, London
Apache Geode Meetup, London
 

Dernier

%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Dernier (20)

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 

Keep Calm And Serilog Elasticsearch Kibana on .NET Core