-
Notifications
You must be signed in to change notification settings - Fork 16
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
Merge libs #67
Merge libs #67
Conversation
Co-authored-by: Leon <82407168+sed-i@users.noreply.github.com>
Co-authored-by: Leon <82407168+sed-i@users.noreply.github.com>
Co-authored-by: Leon <82407168+sed-i@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll look at this again when the alert rules support is in :(
When I use the library like this:
I get:
I really do not believe these arguments should be required. The documentation says that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LogProxyConsumer has a remarkably different API than LogPushApiConsumer, in that is does not emit events, and I really do not like this. I feel very strongly that the charm author experience should be virtually the same.
LogProxyConsumer works this way since its first implementation in November. Let's follow this change in #70 |
Fixed |
Easier for me to just commit a bunch of doc updates than comment on them one by one. In general, though, the I'm also a little concerned about the usage of Similarly, the dict keys could be better: (interface)"loki_push_api" -> relation.data[app]["loki_push_api"]["url"] May be too many "loki_push_api", especially when that's also the name of a It is very concerning that the library, by default, tries to fetch Promtail from the internet, and that the documented suggestion "rebuild the charm". For end-users in airgapped environments, this is serious thing, and rebuilding the charm may not be practical (to say nothing of any hashing guarantees we may eventually give on "signed" charms). It would be far preferable to default to using a resource. |
It actually started out as the URL being the value of the |
To my understanding, the library will try to fetch from the internet UNLESS you passed the |
No, I think they are fine:
The direction of what is consumer and what is producer follows the roles of the relation: |
Indeed - this is a bit of a mess that will eventually be fixed through a combination of subordinates on Kubernetes, and by being able to specify dependencies or resources for charm libraries. @mmanciop is right though -- there should be no attempts to reach out to Github if a resource is attached, and we should make sure the documentation on how to achieve that is first class. |
It works that way. First we check if Promtail is attached. If it's attached we use that file. def _obtain_promtail(self, event) -> None:
"""Obtain promtail binary from an attached resource or download it."""
if self._is_promtail_attached():
return
if self._promtail_must_be_downloaded():
self._download_and_push_promtail_to_workload(event)
else:
self._push_binary_to_workload() |
Co-authored-by: Leon <82407168+sed-i@users.noreply.github.com>
Co-authored-by: Leon <82407168+sed-i@users.noreply.github.com>
Following in #70
Related to #63
This PR merge
log_proxy
lib intoloki_push_api
.LogProxyConsumer
was moved toloki_push_api.py
andLogProxyProvider
removed.LokiPushApiConsumer
now inherits fromConsumerBase
.ConsumerBase
handles alert rules stuff.