Collect Snapshot Metrics #2436
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Collect Snapshot Metrics | |
| on: | |
| schedule: | |
| # Run every hour for repo and instrumentation metrics | |
| - cron: '0 * * * *' | |
| workflow_dispatch: | |
| jobs: | |
| collect-snapshot-metrics: | |
| runs-on: ubuntu-latest | |
| environment: main | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@v4 | |
| - name: Build and run Docker container | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| OTEL_EXPORTER_OTLP_ENDPOINT: ${{ secrets.OTEL_EXPORTER_OTLP_ENDPOINT }} | |
| OTEL_EXPORTER_OTLP_HEADERS: ${{ secrets.OTEL_EXPORTER_OTLP_HEADERS }} | |
| OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf | |
| run: | | |
| echo "OTEL_EXPORTER_OTLP_ENDPOINT is set: ${OTEL_EXPORTER_OTLP_ENDPOINT:+true}" | |
| docker build -t github-snapshot-metrics -f Dockerfile.snapshot . | |
| docker run \ | |
| -e GITHUB_TOKEN="$GITHUB_TOKEN" \ | |
| -e OTEL_EXPORTER_OTLP_ENDPOINT="$OTEL_EXPORTER_OTLP_ENDPOINT" \ | |
| -e OTEL_EXPORTER_OTLP_HEADERS="$OTEL_EXPORTER_OTLP_HEADERS" \ | |
| -e OTEL_EXPORTER_OTLP_PROTOCOL="$OTEL_EXPORTER_OTLP_PROTOCOL" \ | |
| github-snapshot-metrics | |