Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Integrating your Go Service with the ELK Stack

Integrating your Go Service with the ELK Stack

This is a slide deck, which supplements a workshop I did for Golab Conf 2020 - https://golab.io

Workshop abstract follow...
In this workshop, we will start from a sample Go web application & integrate it, step by step, with the ELK stack. This will enable you to create shiny dashboards, tracking your service's logs & monitoring any issues your users might encounter. It will be VERY hands-on, so be prepared.

The workshop consists of a small lecture (up to 40 mins) & a lot of hands-on exercises, the participants go through. These cover integrating a Go web application from scratch \w the ELK stack - Elasticsearch, Logstash, Kibana. That is the most popular & widely used system for monitoring web application logs. Participants will learn all the basic configuration they'll need to bootstrap their own ELK instances, how to emit structured logs, optimised for analysing your service's domain-specific production issues & also how to actually use their new shiny dashboards to find some "sample bugs" in our web application.

Preslav Mihaylov

October 21, 2020
Tweet

More Decks by Preslav Mihaylov

Other Decks in Programming

Transcript

  1. Monitoring Go Services -
    Logging
    Preslav Mihaylov, Software Engineer @ Uber,
    Technical Trainer & Consultant

    View full-size slide

  2. Agenda
    1. The classic approach to logging
    2. Introduction to Structured Logging
    3. Introduction to the ELK Stack
    4. Analysing production traffic with Kibana

    View full-size slide

  3. The classic approach
    to logging

    View full-size slide

  4. What does it take to
    start debugging?

    View full-size slide

  5. Debugging via Logs - Runbook
    1. ssh to prod
    2. download the log locally
    3. filter out the lines you don’t need (grep to the rescue)
    4. open the IDE
    5. prepare a sheet of paper to trace what’s going on
    6. That’s it!

    View full-size slide

  6. Simple... right?

    View full-size slide

  7. And what if an outage happens
    while you’re ...

    View full-size slide

  8. There is a better way…

    View full-size slide

  9. Introduction to
    Structured Logging

    View full-size slide

  10. Structured logs == logs with schema

    View full-size slide

  11. How does that help?

    View full-size slide

  12. Structured logs can be parsed
    by software
    Or at least make grepping easier...

    View full-size slide

  13. Introduction to the
    ELK Stack

    View full-size slide

  14. The ELK stack is a set of tools
    which gives you this...

    View full-size slide

  15. How is it better you ask?

    View full-size slide

  16. With a single glance you can...
    1. Evaluate the success to error ratio
    2. Which endpoints have the most errors
    3. What kinds of errors is your application throwing
    4. Which input parameters cause the highest % of errors
    5. And much more...

    View full-size slide

  17. So what is ELK anyways?

    View full-size slide

  18. E == Elasticsearch
    This stores your logs...
    L == Logstash
    This filters & enriches your logs...
    B == Beats (surprise!)
    Various applications which collect your logs...
    K == Kibana
    This visualizes your logs

    View full-size slide

  19. Enough theory...
    Learn it yourself

    View full-size slide

  20. It’s your turn
    4 x EXERCISE

    View full-size slide

  21. Classical logs can work well for analysing issues on
    your server, but are often clumsy to use...

    View full-size slide

  22. Structured logging can give you
    “the best bang for your buck” from your logs

    View full-size slide

  23. The ELK Stack enables you to capitalize on your
    structured logs and effectively monitor
    production traffic

    View full-size slide