Skip to content

Conversation

@aaSharma14
Copy link
Member

Fixes: https://tracker.ceph.com/issues/50491
Signed-off-by: Aashish Sharma aasharma@redhat.com

@aaSharma14
Copy link
Member Author

This is a WIP PR to implement centralized logging in a ceph-dev cluster. Future enhancements include implementing this on a kcli cluster.

To test this PR out -

  1. Start a ceph-dev cluster with these changes
  2. Open Grafana on port 3000 and login
  3. Add a Loki datasource to grafana
  4. Specify the url in the datasource - http://localhost:3100 (In some machines localhost doesnt work as expected so please replace it with your machine's IP address wherever localhost is mentioned)
  5. Go to Explore in Grafana and run queries

scale: -1

loki:
image: grafana/loki:2.4.0
Copy link
Member

Choose a reason for hiding this comment

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

Please add to the .env.example the appropriate entry for this variable:

Suggested change
image: grafana/loki:2.4.0
image: ${LOKI_IMAGE:-grafana/loki:2.4.0}

command: '--config.file=/etc/loki/loki-config.yaml'

promtail:
image: grafana/promtail:2.4.0
Copy link
Member

Choose a reason for hiding this comment

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

Please add to the .env.example the appropriate entry for this variable:

Suggested change
image: grafana/promtail:2.4.0
image: ${PROMTAIL_IMAGE:-grafana/promtail:2.4.0}

promtail:
image: grafana/promtail:2.4.0
volumes:
- /var/log:/var/log
Copy link
Member

Choose a reason for hiding this comment

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

Do we really need to share the host whole log folder or can we share a more specific folder?

- /var/log:/var/log
- ./docker/promtail:/etc/promtail
- ${CEPH_REPO_DIR}/build.ceph/out:/etc/logs
command: '--config.file=/etc/promtail/promtail-config.yaml'
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if our version of docker-compose supports it, but what about using depends-on: to make promtail run when loki is launched (or the other way around)?

Copy link
Member

Choose a reason for hiding this comment

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

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.

4 participants