Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-286 : Implement ELK logging infrastructure #353

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

patrickmac3
Copy link
Contributor

@patrickmac3 patrickmac3 commented Feb 23, 2025

Description

For the issue #286 , I integrated the ELK stack for the backend logging infrastructure.

ELK is the following technologies:

  • ElasticSearch: stores the logs
  • Logstash: ingests, transforms and loads logs into ElasticSearch
  • Kibana: Visualization tool that works with ElasticSearch to create interactive dashboard and reports.

Changes

In microservices directory

  • added docker-compose.yml file to run the stack locally
  • create a logstash directory containing the following:
  • config/logstash.yml for defining how Logstash processes the incoming data.
  • pipeline/logstash.conf used for specifying various settings related to Logstashes behavior.

In each microservice

  • added logging package with the following filter classes:
  • EndpointFilter is used to add an endpoint field to the logs processed and visualized using ELK.
  • RequestIdFilter is used to add a request_id field to logs to help with tracability within ELK.
  • within the resources directories i added logback-spring.xml to configure logging in the console and Logstash

Manual Testing

  1. Run the docker containers from the microservices directory using docker-compose up -d. (it could take a few minutes before everything is completely running)
  2. Choose any microservice(s) and run it/them (do not forget to build beforehand)
  3. Open kibana at http://localhost:5601
  4. Inside of kibana, create an Index Pattern by going following these links in the side menu:
  • Stack Management > Index Patterns > create index
  1. name the index pattern sportahub-logs* and thee existing one should appear (select it)
  2. Go to Discovery from the home menu
  3. Visualize the logs

@patrickmac3 patrickmac3 changed the title Feature/task 286/create logging infrastructure GH-286 : Implement ELK logging infrastructure Feb 23, 2025
@patrickmac3 patrickmac3 force-pushed the feature/task-286/create-logging-infrastructure branch from da3812a to deee404 Compare February 24, 2025 20:03
@patrickmac3 patrickmac3 added backend Backend related, server side Task Simple task setup related to setting up something labels Feb 25, 2025
@patrickmac3 patrickmac3 added this to the Iteration 11 milestone Feb 25, 2025
@patrickmac3 patrickmac3 linked an issue Feb 25, 2025 that may be closed by this pull request
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Backend related, server side setup related to setting up something Task Simple task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TASK] Implement logging infrastructure
1 participant