feat: enable log forwarding through otel collector#186
feat: enable log forwarding through otel collector#186florentianayuwono merged 26 commits intomainfrom
Conversation
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…v v8 (#182) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* fix(dashboard): remove dead override hiding job queue time series The "Job queue time" panel had a leftover hideSeriesFrom override that excluded every series except one specific named expression. Combined with the panel's current query (which already aggregates with sum by (le)), the override hid all data, leaving an empty chart. The override is obsolete now that the query collapses every label except le into a single combined histogram, so removing it restores visualisation without any other change. * ci: pin astral-sh/setup-uv to v8.1.0 The astral-sh/setup-uv repository does not publish a floating v8 major tag (only v8.0.0 and v8.1.0 specific tags exist), so referencing @v8 fails to resolve and breaks the workflow on every PR.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Christopher Bartz <christopher.bartz@canonical.com>
* chore(docs): update contributing guidelines (charmkeeper) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(docs): build errors * chore: clarify PR checklist and remove unnecessary item * chore(docs): revert changes in CONTRIBUTING.md * fix(docs): whoops we're ignoring the changelog * fix: update pr checklist to incorporate previous items, remove duplicate items --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a new composite GitHub Action that can opt workflows into forwarding selected log files from self-hosted runners to Loki via an OpenTelemetry Collector snap.
Changes:
- Introduces
actions/enable-log-forwardingcomposite action that writes an otelcol config fragment and restarts the collector. - Adds unit tests and a CI workflow (including a self-hosted smoke test) for the new action.
- Documents usage in a new how-to guide and records the change in the docs changelog.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/how-to/enable-log-forwarding.md | New how-to page describing how to use the log-forwarding action and query hints. |
| docs/changelog.md | Adds a 2026-04-22 entry documenting the new action. |
| actions/enable-log-forwarding/tests/test_enable_log_forwarding.py | Unit tests for parsing inputs, endpoint resolution, exporter detection, and config generation. |
| actions/enable-log-forwarding/enable-log-forwarding.py | Action implementation that generates an otelcol config fragment, installs it, and restarts the collector. |
| actions/enable-log-forwarding/action.yaml | Composite action definition and inputs wiring to the Python script. |
| .github/workflows/enable_log_forwarding_action_tests.yaml | CI workflow to run unit tests and a self-hosted smoke test for the action. |
erinecon
left a comment
There was a problem hiding this comment.
Thanks for adding a how-to guide with this PR! Some initial comments and questions
yanksyoon
left a comment
There was a problem hiding this comment.
Initial review done, thank you!
Co-authored-by: Erin Conley <erin.conley@canonical.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Erin Conley <erin.conley@canonical.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
yanksyoon
left a comment
There was a problem hiding this comment.
A few more nits, almost there! Thanks @florentianayuwono :)
florentianayuwono
left a comment
There was a problem hiding this comment.
review session from weii
erinecon
left a comment
There was a problem hiding this comment.
I approve the documentation changes 👍 since there's code-based changes in this PR, I didn't provide an official approval.
Spotted a couple more nits + responded to a Copilot comment
Co-authored-by: Erin Conley <erin.conley@canonical.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
What this PR does
Add action to allow workflow authors to opt in to forwarding specific log files from self-hosted GitHub runners to Loki through the OpenTelemetry Collector snap.
Why we need it
So that workflow author can opt-in to forwarding specific log files from their job to Grafana, and view application logs alongside system metrics without changing their existing logging approach.
Checklist
CONTRIBUTING.mdhas been updated upon changes to the contribution/development process (e.g. changes to the way tests are run)docs/changelog.mdwith user-relevant changes(e.g., in
.github/workflows/integration_tests.yaml, ensure themoduleslist is correct)terraform fmtpasses andtflintreports no errors