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 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 Slide

  3. The classic approach
    to logging

    View Slide

  4. View Slide

  5. Problems

    View Slide

  6. What does it take to
    start debugging?

    View Slide

  7. 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 Slide

  8. Simple... right?

    View Slide

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

    View Slide

  10. ...

    View Slide

  11. There is a better way…

    View Slide

  12. Introduction to
    Structured Logging

    View Slide

  13. View Slide

  14. Structured logs == logs with schema

    View Slide

  15. How does that help?

    View Slide

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

    View Slide

  17. Introduction to the
    ELK Stack

    View Slide

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

    View Slide

  19. View Slide

  20. How is it better you ask?

    View Slide

  21. 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 Slide

  22. DEMO

    View Slide

  23. So what is ELK anyways?

    View Slide

  24. 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 Slide

  25. Enough theory...
    Learn it yourself

    View Slide

  26. It’s your turn
    4 x EXERCISE

    View Slide

  27. Conclusion

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  31. Q&A Time

    View Slide