Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ffd8772
feat: enable log forwarding through otel collector
florentianayuwono Apr 22, 2026
14514f2
chore(deps): update dependency packaging to v26.1 (#180)
renovate[bot] Apr 18, 2026
77f12cf
chore(deps): update dependency sphinx-ubuntu-images to v0.2.0 (#181)
renovate[bot] Apr 18, 2026
f41fd56
chore(deps): replace astral-sh/setup-uv action with astral-sh/setup-u…
renovate[bot] Apr 19, 2026
11631ad
fix(deps): update module github.com/jackc/pgx/v5 to v5.9.2 (#183)
renovate[bot] Apr 19, 2026
b2cff4d
fix(dashboard): remove dead override hiding job queue time series (#184)
cbartz Apr 22, 2026
564ff2c
chore: update Copilot collections to v0.11.0 (#172)
github-actions[bot] Apr 22, 2026
7b44fd0
chore(docs): update contributing guidelines (charmkeeper) (#170)
erinecon Apr 22, 2026
5961c47
Merge branch 'main' into feat/log-forwarding-isd-5146
florentianayuwono Apr 22, 2026
1bdb99d
fix: run shell as bash
florentianayuwono Apr 22, 2026
32eb82f
Update docs/how-to/enable-log-forwarding.md
florentianayuwono Apr 23, 2026
f7f4147
Apply suggestions from code review
florentianayuwono Apr 23, 2026
0539529
fix docs
florentianayuwono Apr 23, 2026
16a1ff7
add index
florentianayuwono Apr 23, 2026
9934f4e
Update actions/enable-log-forwarding/enable-log-forwarding.py
florentianayuwono Apr 23, 2026
8337420
Update actions/enable-log-forwarding/enable-log-forwarding.py
florentianayuwono Apr 23, 2026
9590fd5
Merge branch 'main' into feat/log-forwarding-isd-5146
florentianayuwono Apr 23, 2026
3f3fd59
address code reviews
florentianayuwono Apr 23, 2026
f15564a
add license
florentianayuwono Apr 23, 2026
bc2a1e4
fix docs
florentianayuwono Apr 24, 2026
5016dcb
refactor code
florentianayuwono Apr 24, 2026
a920d9a
Apply suggestions from code review
florentianayuwono Apr 27, 2026
356f39f
Merge branch 'main' into feat/log-forwarding-isd-5146
florentianayuwono Apr 29, 2026
dc8fd5a
address code reviews
florentianayuwono Apr 29, 2026
9a3491d
remove pyyaml
florentianayuwono Apr 29, 2026
39ae8fb
parameterized test
florentianayuwono Apr 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 90 additions & 0 deletions .github/workflows/enable_log_forwarding_action_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Enable Log Forwarding Action Tests

on:
pull_request:
workflow_call:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
action: ${{ steps.filter.outputs.action }}
steps:
- uses: actions/checkout@v6
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
action:
- 'actions/enable-log-forwarding/**'
- '.github/workflows/enable_log_forwarding_action_tests.yaml'

test-action:
needs: detect-changes
if: ${{ needs.detect-changes.outputs.action == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Set up uv
uses: astral-sh/setup-uv@v8.1.0

- name: Install tox
run: uv tool install tox --with tox-uv

- name: Run lint, static checks, and unit tests
run: tox -e actions-lint,actions-static,actions-unit

smoke-test-self-hosted:
needs: detect-changes
if: ${{ needs.detect-changes.outputs.action == 'true' }}
runs-on: [self-hosted-linux-amd64-noble-edge]
Comment thread
yanksyoon marked this conversation as resolved.
env:
TEST_CONFIG_FILE: 91-enable-log-forwarding-smoke-${{ github.run_id }}-${{ github.run_attempt }}.yaml
steps:
- uses: actions/checkout@v6

- name: Run enable log forwarding action
uses: ./actions/enable-log-forwarding
with:
files: |
/var/log/syslog
config-file-name: ${{ env.TEST_CONFIG_FILE }}
otlp-endpoint: 127.0.0.1:4317

- name: Verify generated config file exists
run: |
sudo test -f /etc/otelcol/config.d/${TEST_CONFIG_FILE}

- name: Verify generated config contains expected receiver
run: |
sudo grep -q '"filelog/github_runner_optin"' /etc/otelcol/config.d/${TEST_CONFIG_FILE}

smoke-test-github-hosted:
needs: detect-changes
if: ${{ needs.detect-changes.outputs.action == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Run enable log forwarding action on github-hosted runner
uses: ./actions/enable-log-forwarding
with:
files: |
/var/log/syslog

- name: Verify workflow continues after github-hosted no-op
run: |
echo "enable-log-forwarding exited successfully on github-hosted runner"
39 changes: 39 additions & 0 deletions actions/enable-log-forwarding/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 2026 Canonical Ltd.
# See LICENSE file for licensing details.
name: Enable log forwarding
description: Opt in to forward selected log files from a self-hosted GitHub runner to Loki.

inputs:
files:
description: |
Newline or comma-separated list of file paths and glob patterns to forward.
Examples:
newline-separated: /var/log/syslog\n/var/log/kern.log
comma-separated: /var/log/syslog,/var/log/kern.log
glob: /var/log/chrony/*.log
required: true
otlp-endpoint:
description: |
Optional OTLP/gRPC endpoint for upstream OpenTelemetry Collector logs export.
When not set, the action falls back to ACTION_OTEL_EXPORTER_OTLP_ENDPOINT,
which is injected by Canonical self-hosted runners.
Example: otel-gateway.internal:4317
required: false
default: ""
config-file-name:
description: |
File name for the generated collector fragment under /etc/otelcol/config.d.
Use this to control merge/load priority relative to other fragments.
required: false
default: 90-github-runner-log-forwarding.yaml
Comment thread
yanksyoon marked this conversation as resolved.

runs:
using: composite
steps:
- name: Configure collector for opt-in file log forwarding
shell: bash
env:
INPUT_FILES: ${{ inputs.files }}
INPUT_OTLP_ENDPOINT: ${{ inputs.otlp-endpoint }}
INPUT_CONFIG_FILE_NAME: ${{ inputs.config-file-name }}
run: python3 "${{ github.action_path }}/enable_log_forwarding.py"
Loading
Loading