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

Charm logging #306

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Charm logging #306

wants to merge 2 commits into from

Conversation

PietroPasotti
Copy link
Contributor

@PietroPasotti PietroPasotti commented Sep 20, 2023

charm instrumentation library using loki push api to forward charm logs (same logs that go to the juju debug-log) to a loki instance.

Similar to what tempo's charm_tracing does, the library assumes the presence of a loki_push_api integration (that the charm might be using already to push workload logs).

image

This library exposes a decorator the user will put in front of a charm class.
The user will pass to the decorator the name of a charm method that returns a list of loki endpoint urls to which the charm logs should be forwarded. Presumably, the user will get those endpoints from LokiPushApiConsumer (but in practice we don't care how the url is obtained).

@sed-i
Copy link
Contributor

sed-i commented Sep 20, 2023

Would you mind updating the PR description with the mechanism? Just guessing:

  • User needs to pass a logging.getLogger instance so this lib could tag a long
  • The lib relies on the loki_push_api relation schema to obtain loki server url
  • User adds a class level decorator to the charm, utilizing some ops stuff

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.

3 participants