dwyl / dwyl/learn-phoenix

Logging/Debugging Phoenix Apps |> What are the options? |> Can we use ElasticSearch + Kibana?

Open
#64 5 comments 0 reactions 0 assignees View on GitHub
discuss enhancement help wanted question technical
Dominant language
No language data
Stars
664
Forks
41
PR merge metrics
No merged PRs in 30d

Description

Logging is an _incredibly_ important activity for any web application, 🔥
but sadly, one of the things _most_ people only think about when things "_go wrong_"... 😿

![no logs](https://cloud.githubusercontent.com/assets/194400/23974992/4e538fa6-09d6-11e7-9766-e7427d706a70.png)

Our goal is to be able to:
+ [ ] Read the logs in a _human friendly_ format without scrolling through mountains of plaintext
+ [ ] _Search_/_Filter_ logs
+ [ ] _Correlate_/Trace all logs for a given request together (_this isn't an issue if the app has only a handful of users/requests per minute but is **essential** when we have multiple request per second and we need to "trace" a given request through the stack to understand where/when it's failing...!_)

I was _considering_ pushing the log to ElasticSearch _asynchronously_ (_not interrupting the flow of execution_) which could then be viewed in Kibana (_in the browser_).

> We used "ELK" @ TC and it worked well for tracing logs through our stack using a "correlation ID" for a given request. see: https://www.elastic.co/videos/kibana-logstash

@jruts / @tonydaly / @katbow / @SimonLab / @shouston3 / @jackcarlisle / @des-des / @Jbarget
have you come across a good logging tool/solution for Elixir/Phoenix ?

We are going to need logging in _all_ our apps so this discussion is relevant to _everyone_ building apps with "PETE". Also having logging/tracing as a skill will _seriously_ help you "level up". 🥇

I just came across this while trying to debug something for "dwylbot" and noted that
2e are not _currently_ logging the Webhook payloads in [/web/controllers/webhooks_controller.ex](https://github.com/dwyl/dwylbot/blob/d28c1790f820c48b62360a450c3c2d953aa71cc5/web/controllers/webhooks_controller.ex) so this is an _immediate_ pain I have ...
but it's also a _requirement_ for all our client/internal projects ASAP! 💸

Contributor guide

Open the contributing guide

Research direction

Start with the linked web/controllers/webhooks_controller.ex file in dwylbot and review how webhook payloads are currently handled. Research the logging, search, filtering, and request-correlation requirements described here, including the proposed Elasticsearch and Kibana approach. Done means the project has a decided logging solution and a defined path for applying it across the apps.

Written by the indexing model from the issue text.

Assessment

Tech stack
elasticsearch, elixir
Domain
backend, observability-sre
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.