Skip to content

Add opstool environment for SRE tooling AKS cluster #3740

Add opstool environment for SRE tooling AKS cluster

Add opstool environment for SRE tooling AKS cluster #3740

name: 'ci-observability'
on:
pull_request:
branches:
- main
jobs:
paths-filter:
runs-on: ubuntu-latest
outputs:
grafana: ${{ steps.filter.outputs.grafana }}
prometheus: ${{ steps.filter.outputs.prometheus }}
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 1
- name: Filter paths
id: filter
uses: dorny/paths-filter@v3
with:
filters: |
grafana:
- 'observability/grafana/**'
- '.github/workflows/ci-python.yml'
prometheus:
- 'observability/alerts/**'
- 'observability/prometheus/**'
- '.github/workflows/ci-python.yml'
test-grafana-script:
needs: paths-filter
if: needs.paths-filter.outputs.grafana == 'true'
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 1
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: '3.10'
- run: cd observability/grafana && make test
- run: |
cd observability/grafana &&
pip install black &&
make format
- run: |
if [[ ! -z "$(git status --short)" ]]
then
echo "there are some modified files, rerun 'make format' to update them and check the changes in"
git status
exit 1
fi
test-prometheus-rules:
needs: paths-filter
if: needs.paths-filter.outputs.prometheus == 'true'
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 1
- name: 'Set up Go'
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version-file: 'go.work'
check-latest: true
- name: 'Install promtool'
run: |
cd $(mktemp -d)
curl -sfLo - https://github.com/prometheus/prometheus/releases/download/v3.2.1/prometheus-3.2.1.linux-amd64.tar.gz | tar xzf -
sudo mv prometheus-3.2.1.linux-amd64/promtool /usr/local/bin/promtool
chmod +x /usr/local/bin/promtool
- name: 'Make alerts'
run: |
# https://github.com/actions/runner-images/issues/11987
az config set bicep.use_binary_from_path=false
az bicep install
cd observability &&
make alerts
- name: 'Ensure all changes are persisted'
run: |-
if [[ ! -z "$(git status --short)" ]]
then
echo "there are some modified files, rerun 'make alerts' to update them and check the changes in"
git status
exit 1
fi