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

Increased observability by having metrics, logs and traces in one place #12

Open
wants to merge 4 commits into
base: development
Choose a base branch
from

Conversation

senthilcool
Copy link

@senthilcool senthilcool commented Jul 11, 2020

Adds integration with Prometheus, Loki and Grafana to be able to look at metrics, logs and traces in one place.

  • Uses Loki Docker Logging Driver to collect the logs from all containers
  • Uses Loki to aggregate the logs
  • Enables micrometer in the application services
  • Uses Prometheus to collect/aggregate the metrics
  • Uses Grafana to bring all the above data in one place

@senthilcool senthilcool changed the title Increase observability by looking at metrics, logs and traces in one place Increased observability by having at metrics, logs and traces in one place Jul 11, 2020
@senthilcool senthilcool changed the title Increased observability by having at metrics, logs and traces in one place Increased observability by having metrics, logs and traces in one place Jul 11, 2020
docker-compose.yml Outdated Show resolved Hide resolved
@@ -84,11 +97,13 @@ services:
- MYSQL_PASSWORD=mysqlpw

redis:
logging: *loki-logging
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See other comments - the use of loki-logging needs to be optional.
is there an alternative to hardwiring logging: *loki-logging, e.g.

  • Configure using environment variable
  • Use promtail?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Promtail uses Kubernetes service discovery to associate the log files with the services. In the docker/docker-compose world this is done by the loki logging driver plugin (https://grafana.com/docs/loki/latest/clients/docker-driver/).
Moved the logging driver configuration from the docker-compose file to the docker daemon (/etc/docker/daemon.json) as explained in https://grafana.com/docs/loki/latest/clients/docker-driver/configuration/. This will be a manual step in addition to the installation of the grafana/loki-docker-driver plugin.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having to configure the Docker daemon sounds problematic!

Why not just use logging: ${EVENTUATE_EXAMPLE_LOGGING_DRIVER:-json-file}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@senthilcool What about this?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will try this out.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cer The loki logging driver configuration includes the loki-url as part of the options. As this option is not applicable for json-file, it needs to be included conditionally.

    driver: loki
    options:
      loki-url: "http://localhost:3100/loki/api/v1/push"

Haven't figured out a way to do this. Let me know if you have any suggestions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two options come to mind:

  1. What happens if you configure json-file with loki-url - does it fail?
  2. copy/paste the service definitions into docker-compose-observability.yml

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cer

  1. Yes, json-file with loki-url failed and so was not an option.
  2. Copy/pasted the service definitions into docker-compose-observable.yml.

…docker-compose file and moved logging driver configuration to the docker daemon
docker-compose.yml Show resolved Hide resolved
docker-compose-observable.yml Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants