cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

🎥 How to Instrument GitHub Workflows and Actions Using OpenTelemetry

GosiaMurawska
Community Team
Community Team


While GitHub provides Webhooks to get some level of observability into pull requests, jobs, and workflows, details about what slows workflows down or what actions are taking place in detail and why they may fail are limited!

Philipp Lengauer, Sr Principal Product Manager at Dynatrace, needed to understand where his jobs, actions, and workflows slow down or fail. To get that level of detail, he created a new open source project that can automatically instrument Bash, GitHub Actions, and Workflows with OpenTelemetry. In this Community Tips & Tricks session, Philipp walks us through enabling OpenTelemetry instrumentation for GitHub repositories and how to then analyze the resulting OpenTelemetry logs, metrics, and traces to optimize your GitHub workflow, action and job usage, and health!-----------------------------

📖 Chapters 📖

00:00 - Introduction
00:30 - GitHub End-2-End Workflow Trace Example
00:55
- How to Instrument your GitHub repo with OpenTelemetry
07:33
- Recap Enabling OTel GitHub Support
10:10
- Recap End-2-End Trace
11:03
- Wrap Up

-----------------------------
🔗 Additional Links

GitHub Repo for GitHub OTel Instrumentation
GitHub Health Analytics Video: How to Analyze GitHub Health Using OpenTelemetry
Try out Dynatrace with a free trial

-----------------------------
Subscribe to our YT channel 
Stay up-to-date with Dynatrace! Follow us on FacebookInstagramLinkedIn, TwitterTwitch  

2 REPLIES 2

patmis
Guide

Hi Community,

We're trying to monitor some of our GitHub Actions but are encountering difficulties. We've followed the instructions in the video and on the GitHub page, deploying the following:

name: Deploy OpenTelemetry
on:
  push:
    branches: main
    paths:
      - .github/workflows/**
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: plengauer/Thoth/actions/instrument/job@v5.16.4
        with:
          secrets_to_redact: ${{ toJSON(secrets) }}
        env:
          OTEL_EXPORTER_OTLP_ENDPOINT: ${{ secrets.OTEL_EXPORTER_OTLP_ENDPOINT }}
          OTEL_EXPORTER_OTLP_HEADERS: ${{ secrets.OTEL_EXPORTER_OTLP_HEADERS }}
      - name: Checkout repository
        uses: actions/checkout@v4
      - name: Deploy with OpenTelemetry Instrumentation
        uses: plengauer/Thoth/actions/instrument/deploy@v5.16.4
        with:
          github_token: ${{ secrets.ACTIONS_GITHUB_TOKEN }}
        env:
          OTEL_EXPORTER_OTLP_ENDPOINT: ${{ secrets.OTEL_EXPORTER_OTLP_ENDPOINT }}
          OTEL_EXPORTER_OTLP_HEADERS: ${{ secrets.OTEL_EXPORTER_OTLP_HEADERS }}

We believe the job instrumentation was added automatically. We then created a job like this:

name: Simple Action with Custom Token
on:
  push:
    branches: ["main"]
jobs:
  hello:
    runs-on: ubuntu-latest
    steps:
      - uses: plengauer/Thoth/actions/instrument/job@v5.16.4
        with:
          secrets_to_redact: ${{ toJSON(secrets) }}
        env:
          OTEL_EXPORTER_OTLP_ENDPOINT: ${{ secrets.OTEL_EXPORTER_OTLP_ENDPOINT }}
          OTEL_EXPORTER_OTLP_HEADERS: ${{ secrets.OTEL_EXPORTER_OTLP_HEADERS }}
      - name: Say Hello
        run: echo "Hello Observability"
      - name: Curl https://www.post.ch
        run: curl https://www.post.ch

However, we're not seeing any traces reaching our system. We've verified that the connection to our OTLP endpoint is working.

Could you please help us identify what we might be doing wrong or what we're missing?

Thank you for your assistance,
Patrick

 

patmis
Guide

And we intend to send the traces via one of our ActiveGates. 

Featured Posts