-
Notifications
You must be signed in to change notification settings - Fork 20
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
Adapt charm to support COS integration #127
Conversation
Marked the PR as complex due to significant new feature added. @canonical/is-devops-leadership please provide feedback on the public interface. |
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.
license-eye has totally checked 88 files.
Valid | Invalid | Ignored | Fixed |
---|---|---|---|
38 | 2 | 48 | 0 |
Click to see the invalid file list
- lib/charms/loki_k8s/v0/loki_push_api.py
- lib/charms/observability_libs/v0/juju_topology.py
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.
This looks good, thanks for putting this together!
Do you think any other modifications to public interfaces are required? I'm thinking about potentially:
Also, do you think it is worthwhile to introduce CharmState with just the data required for the COS integration? That way we make a start and can gradually move the rest of the architecture to be compliant |
I have updated the draft according to your comments and the outcome of the GH Runner Roadmap meeting (story has been updated to include Grafana Dashboard and to send Runner installation event). |
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 think the interfaces look good now, minor comments
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.
license-eye has totally checked 100 files.
Valid | Invalid | Ignored | Fixed |
---|---|---|---|
46 | 1 | 53 | 0 |
Click to see the invalid file list
- .woke.yaml
After feedback from the Observability team, I changed the implementation to use the |
Test coverage for 05595ff
Static code analysis report
|
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.
Thank you!
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.
Great, thx
* Add public interface * Remove promtail prefix from fcts * Fix license header * Merge install and config into start * Add interface to log metrics * Add grafana_dashboard lib * Move logging of event to metrics module * Introduce charm state * Update attrs doc * Implement COS integration * Remove grafana_dashboard * Change proxy server settings in test_charm * Ignore whitelist in pylintrc * Add missing newlines * Exclude woke.yaml from license check * Add final newline to .woke.yaml * Remove usage of requests.session in metrics * Pin pydantic more specifically * Fix type hint/doc string in ProxyConfig * Pin pydantic * Rename NotCompleteError * Remove hardcoding of promtail arch * Remove hardcoding of promtail arch * Rename -> download_info * promtail.start -> promtail.setup * handle non-happy case first in metrics * Remove group * Adapt promtail.yaml.j2 * Introduce constant in test_charm * Move issue_metrics to RunnerManagerConfig * Fix promtail.service.j2 * Capture time only when needed * Narrow the exception catch * Introduce constants in Promtail * Retry Promtail health check and raise error * Use Path.write_bytes in promtail * set unit status to Blocked for unhealthy promtail * Fix integration test Breaking change in latest Pygithub version * Lint * Catch RequestException * Drop Promtail and call Loki directly * Add unit test for charm state * Switch to cos_agent integration * Adapt integration test * Fix integration test * Simplify integration test * Fix issue_event * Add code to set up logrotate * Update grafana dashboard * Cleanup * Remove status in wait_for_idle * Small fixes * Dont keep charm inside state * Update src-docs * Dont use mutable default value * Compute event name on instantiation * Raise LogrotateSetupError * Reuse _create_runner func * Check that metrics log is empty * Fix docstring in Event * Lint * app_no_runner -> app
Applicable spec: ISD-075
Overview
The PR adapts the charm to send metric logs to Loki by using the cos-agent integration.
RunnerInstalled
) is fired to test the integration.Rationale
To implement the COS integration as specified in the spec, the GitHub Runner charm needs to be adapted to send the metrics to Loki.
Juju Events Changes
Library Changes
New libraries fetched:
charms/grafana_agent/v0/cos_agent.py
Checklist
src-docs
urgent
,trivial
,complex
)