Skip to content

feat(tracing): lazy sampling #36054

feat(tracing): lazy sampling

feat(tracing): lazy sampling #36054

Workflow file for this run

name: System Tests
on:
push:
branches:
- main
pull_request:
workflow_dispatch: {}
schedule:
- cron: '00 04 * * 2-6'
jobs:
needs-run:
runs-on: ubuntu-latest
outputs:
outcome: ${{ steps.run_needed.outcome }}
steps:
- uses: actions/checkout@v3
- id: run_needed
name: Check if run is needed
run: |
git fetch origin ${{ github.event.pull_request.base.sha }}
export PATHS=$(git diff --name-only HEAD ${{ github.event.pull_request.base.sha }})
python -c "import os,sys,fnmatch;sys.exit(not bool([_ for pattern in {'ddtrace/*', 'setup*', 'pyproject.toml', '.github/workflows/system-tests.yml'} for _ in fnmatch.filter(os.environ['PATHS'].splitlines(), pattern)]))"
continue-on-error: true
system-tests:
runs-on: ubuntu-latest
needs: needs-run
strategy:
matrix:
include:
- weblog-variant: flask-poc
- weblog-variant: uwsgi-poc
- weblog-variant: django-poc
- weblog-variant: fastapi
# runs django-poc for 3.12
- weblog-variant: python3.12
fail-fast: false
env:
TEST_LIBRARY: python
WEBLOG_VARIANT: ${{ matrix.weblog-variant }}
# system-tests requires an API_KEY, but it does not have to be a valid key, as long as we don't run a scenario
# that make assertion on backend data. Using a fake key allow to run system tests on PR originating from forks.
# If ever it's needed, a valid key exists in the repo, using ${{ secrets.DD_API_KEY }}
DD_API_KEY: 1234567890abcdef1234567890abcdef
CMAKE_BUILD_PARALLEL_LEVEL: 12
steps:
- name: Setup python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Checkout system tests
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
uses: actions/checkout@v3
with:
repository: 'DataDog/system-tests'
- name: Checkout dd-trace-py
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
uses: actions/checkout@v3
with:
path: 'binaries/dd-trace-py'
fetch-depth: 0
- name: Build
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./build.sh
- name: Run
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./run.sh
- name: Run REMOTE_CONFIG_MOCKED_BACKEND_ASM_FEATURES
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./run.sh REMOTE_CONFIG_MOCKED_BACKEND_ASM_FEATURES
- name: Run REMOTE_CONFIG_MOCKED_BACKEND_LIVE_DEBUGGING
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./run.sh REMOTE_CONFIG_MOCKED_BACKEND_LIVE_DEBUGGING
- name: Run REMOTE_CONFIG_MOCKED_BACKEND_ASM_DD
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./run.sh REMOTE_CONFIG_MOCKED_BACKEND_ASM_DD
- name: Run APPSEC_MISSING_RULES
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./run.sh APPSEC_MISSING_RULES
- name: Run APPSEC_CUSTOM_RULES
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./run.sh APPSEC_CUSTOM_RULES
- name: Run APPSEC_CORRUPTED_RULES
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./run.sh APPSEC_CORRUPTED_RULES
- name: Run APPSEC_RULES_MONITORING_WITH_ERRORS
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./run.sh APPSEC_RULES_MONITORING_WITH_ERRORS
- name: Run APPSEC_BLOCKING
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./run.sh APPSEC_BLOCKING
- name: Run APPSEC_DISABLED
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./run.sh APPSEC_DISABLED
- name: Run APPSEC_LOW_WAF_TIMEOUT
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./run.sh APPSEC_LOW_WAF_TIMEOUT
- name: Run APPSEC_CUSTOM_OBFUSCATION
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./run.sh APPSEC_CUSTOM_OBFUSCATION
- name: Run APPSEC_RATE_LIMITER
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./run.sh APPSEC_RATE_LIMITER
- name: Run APPSEC_BLOCKING_FULL_DENYLIST
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./run.sh APPSEC_BLOCKING_FULL_DENYLIST
- name: Run APPSEC_REQUEST_BLOCKING
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./run.sh APPSEC_REQUEST_BLOCKING
- name: Run APPSEC_RUNTIME_ACTIVATION
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./run.sh APPSEC_RUNTIME_ACTIVATION
- name: Run APPSEC_WAF_TELEMETRY
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./run.sh APPSEC_WAF_TELEMETRY
- name: Run SAMPLING
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./run.sh SAMPLING
- name: Run INTEGRATIONS
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./run.sh INTEGRATIONS
# even on failures, we want to have artifact to be able to investigate
# The compress step speed up a lot the upload artifact process
- name: Compress artifact
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: tar -czvf artifact.tar.gz $(ls | grep logs)
- name: Upload artifact
uses: actions/upload-artifact@v3
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
with:
name: logs_${{ matrix.weblog-variant }}
path: artifact.tar.gz
parametric:
runs-on: ubuntu-latest
needs: needs-run
env:
TEST_LIBRARY: python
steps:
- name: Checkout system tests
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
uses: actions/checkout@v3
with:
repository: 'DataDog/system-tests'
- name: Checkout dd-trace-py
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
uses: actions/checkout@v3
with:
path: 'binaries/dd-trace-py'
fetch-depth: 0
- uses: actions/setup-python@v4
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
with:
python-version: '3.9'
- name: Build
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./build.sh -i runner
- name: Run
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: ./run.sh PARAMETRIC
- name: Compress artifact
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
run: tar -czvf artifact.tar.gz $(ls | grep logs)
- name: Upload artifact
uses: actions/upload-artifact@v3
if: needs.needs-run.outputs.outcome == 'success' || github.event_name == 'schedule'
with:
name: logs_parametric
path: artifact.tar.gz