Skip to content

Synthetic monitoring Tracetest (Production) #6021

Synthetic monitoring Tracetest (Production)

Synthetic monitoring Tracetest (Production) #6021

name: Synthetic monitoring Tracetest (Production)
on:
# allows the manual trigger
workflow_dispatch:
schedule:
- cron: '0 * * * *' # every hour
jobs:
pokeshop-trace-based-tests:
name: Run trace based tests for Pokeshop
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure Tracetest CLI
timeout-minutes: 5
uses: kubeshop/tracetest-github-action@v1
with:
token: ${{secrets.TRACETEST_POKESHOP_TOKEN}}
- name: Run synthetic monitoring tests
timeout-minutes: 10
run: |
tracetest run testsuite --file ./testing/synthetic-monitoring/pokeshop/_testsuite.yaml --vars ./testing/synthetic-monitoring/pokeshop/_variableset.yaml
- name: Send message on Slack in case of failure
if: ${{ failure() }}
uses: slackapi/[email protected]
with:
payload: |
{
"text": ":warning: Synthetic Monitoring failed for *Pokeshop Demo*. <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow>"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SYNTETIC_MONITORING_SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
pokeshop-serverless-trace-based-tests:
name: Run trace based tests for Pokeshop Serverless
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure Tracetest CLI
timeout-minutes: 5
uses: kubeshop/tracetest-github-action@v1
with:
token: ${{secrets.TRACETEST_SERVERLESS_POKESHOP_TOKEN}}
- name: Run synthetic monitoring tests
timeout-minutes: 10
run: |
tracetest run testsuite --file ./testing/synthetic-monitoring/pokeshop-serverless/_testsuite.yaml --vars ./testing/synthetic-monitoring/pokeshop-serverless/_variableset.yaml
- name: Send message on Slack in case of failure
if: ${{ failure() }}
uses: slackapi/[email protected]
with:
payload: |
{
"text": ":warning: Synthetic Monitoring failed for *Serverless Pokeshop Demo*. <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow>"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SYNTETIC_MONITORING_SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
otel-demo-trace-based-tests:
name: Run trace based tests for Open Telemetry demo
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Configure Tracetest CLI
timeout-minutes: 5
uses: kubeshop/tracetest-github-action@v1
with:
token: ${{secrets.TRACETEST_OTELDEMO_TOKEN}}
- name: Run synthetic monitoring tests
timeout-minutes: 10
run: |
tracetest run testsuite --file ./testing/synthetic-monitoring/otel-demo/_testsuite.yaml --vars ./testing/synthetic-monitoring/otel-demo/_variableset.yaml
- name: Send message on Slack in case of failure
if: ${{ failure() }}
uses: slackapi/[email protected]
with:
payload: |
{
"text": ":warning: Synthetic Monitoring failed for *OTel Demo*. <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow>"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SYNTETIC_MONITORING_SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
failure-notification:
name: Check if failure happened in all monitors
needs: [pokeshop-trace-based-tests, pokeshop-serverless-trace-based-tests, otel-demo-trace-based-tests]
runs-on: ubuntu-latest
if: ${{ failure() }}
steps:
- name: Send message on Slack
if: ${{ needs.pokeshop-trace-based-tests.result == 'failure' && needs.pokeshop-serverless-trace-based-tests.result == 'failure' && needs.otel-demo-trace-based-tests.result == 'failure' }}
uses: slackapi/[email protected]
with:
payload: |
{
"text": ":red_circle: :loudspeaker: \n*All synthetic monitoring crashed on production!* \n<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow>"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SYNTETIC_MONITORING_SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK