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

feat: promtail loki grafana setup #264

Merged

Conversation

tarnas14
Copy link

@tarnas14 tarnas14 commented Jun 13, 2022

Description

run with docker-compose -f docker-compose.grafana.yml up -d
(you might need to change volume in docker-compose if running on macOS)

  • add info about default password? (admin:admin)
  • add promtail/loki/grafana containers to the list of containers so the application can listen for events and show performance etc
  • persist whatever data promtail/loki need

Motivation and Context

#11

How Has This Been Tested?

image

@tarnas14 tarnas14 force-pushed the launchpad/feature/11/promtail_loki_grafana branch from 0c9cb20 to 3426d49 Compare June 13, 2022 20:56

grafana:
image: grafana/grafana
user: "${UID:-root}:${GID:-root}"
Copy link
Author

Choose a reason for hiding this comment

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

when starting the docker, we would provide UID and GID env vars

- ./grafana/sources_provision.yml:/etc/grafana/provisioning/datasources/all.yml # for some reason does not work if volumed into /usr/share/grafana/conf/provisioning/datasources
- ./grafana/data:/var/lib/grafana
ports:
- "3001:3000"
Copy link
Author

Choose a reason for hiding this comment

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

it's necessary to expose port 3000 from grafana to embed it in tauri

@tarnas14
Copy link
Author

ok, so - this is a working docker-compose with promtail/loki/grafana with provisioned loki
I assume we need to run a similar environment to this docker-compose at the start of the application?
this could also be on demand, because as long as the log files are there, promtail will go through them on startup

networks:
loki:

services:
Copy link
Author

Choose a reason for hiding this comment

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

possibly loki and promtail will also need persistent volumes for whatever data/db/indexes they create

Copy link
Collaborator

Choose a reason for hiding this comment

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

This will be hooked into the launchpad container setup. We could create volumes for these, sure.

promtail:
image: grafana/promtail
volumes:
- ~/.cache/tari/tmp/:/var/log
Copy link
Author

Choose a reason for hiding this comment

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

this volume definition needs to change depending on OS - promtail config file assumes logs in /var/log, but different host directories will have to be mounted per OS

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah. Again, the docker-compose file will be superceded by launchpad, which can dynamically configure these things

cookie_samesite = lax

# set to true if you want to allow browsers to render Grafana in a <frame>, <iframe>, <embed> or <object>. default is false.
allow_embedding = true
Copy link
Author

@tarnas14 tarnas14 Jun 13, 2022

Choose a reason for hiding this comment

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

this is the most important change in comparison to a default defaults.ini
(and the only one)

Copy link
Collaborator

@CjS77 CjS77 left a comment

Choose a reason for hiding this comment

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

LGTM
Next step is to bring this into the launchpad setup

networks:
loki:

services:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will be hooked into the launchpad container setup. We could create volumes for these, sure.

promtail:
image: grafana/promtail
volumes:
- ~/.cache/tari/tmp/:/var/log
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah. Again, the docker-compose file will be superceded by launchpad, which can dynamically configure these things

@tarnas14
Copy link
Author

@CjS77 do you think we should merge this into the launchpad_such_wow branch and create a separate issue for launchpad backend thing?
are you going to take care of this with @alex1307 or do you want us to put it together?

@CjS77
Copy link
Collaborator

CjS77 commented Jun 14, 2022

Yes, exactly.
We'll take care of the backend orchestration

@tarnas14 tarnas14 marked this pull request as ready for review June 14, 2022 12:42
@tarnas14 tarnas14 merged commit edf0ec5 into launchpad_such_wow Jun 14, 2022
@tarnas14 tarnas14 deleted the launchpad/feature/11/promtail_loki_grafana branch June 14, 2022 13:01
@tarnas14 tarnas14 mentioned this pull request Jun 14, 2022
3 tasks
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