Capturing the Pulse of Your GitHub Actions with OpenObserve

Observability is no longer a luxury but a necessity for today's fast-paced software development environments. And in a CI/CD landscape where continuous improvement is the mantra, every byte of data and every log matters.
Not only does it allow you to effectively capture logs, metrics, and traces from your applications, but the open-source community around it is constantly innovating. A recent development from this is a GitHub Action that enables you to capture logs from your GitHub Actions and send them straight to OpenObserve.
Repository Spotlight: mdp/openobserve_github_action_logs
Developed by the talented Mark Percival, this GitHub Action is a must-have for any team that relies on GitHub Actions for CI/CD and wants to maintain visibility into their workflow logs, this GitHub Action is designed to capture logs from your GitHub Actions and send them seamlessly to OpenObserve. And it does this with an elegance and simplicity that is just so in line with the ethos of OpenObserve.
Incorporating this GitHub Action into your workflow is straightforward. Let's look at a brief example:
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
npm ci
- run: |
npm run all
- run: npm test
send_logs_to_openobserve:
runs-on: ubuntu-latest
needs: build-and-test # wait until build-and-test is done
environment: dev
steps:
- uses: actions/checkout@v3
- uses: mdp/openobserve_github_action_logs@main
with:
openobserve_endpoint: ${{ secrets.OPENOBSERVE_ENDPOINT }}
openobserve_username: ${{ secrets.OPENOBSERVE_USERNAME }}
openobserve_key: ${{ secrets.OPENOBSERVE_KEY }}
github_token: ${{ secrets.GITHUB_TOKEN }}
Once integrated, all your logs from GitHub Actions will be automatically piped to OpenObserve. It's that simple!
curl -u you@yourdomain.com:18qlg4b673Rgdgd2 -k https://api.openobserve.ai/api/your_organization_254/default/_json -d [JSON-DATA]
In this case, values are:
OPENOBSERVE_ENDPOINT : https://api.openobserve.ai/api/your_organization_254/default/_json
OPENOBSERVE_USERNAME : you@yourdomain.com
OPENOBSERVE_KEY : 18qlg4b673Rgdgd2
OPENOBSERVE_USERNAME
.OPENOBSERVE_KEY
.OPENOBSERVE_ENDPOINT
.Once you've added these secrets, your GitHub Actions workflow will be able to access them using the syntax ${{ secrets.OPENOBSERVE_USERNAME }}
and ${{ secrets.OPENOBSERVE_KEY }}
respectively.
By securely storing these credentials in GitHub Secrets, you ensure that your sensitive data remains private while still being accessible to the GitHub Actions that need them.
Once you have all the above working you should see logs in OpenObserve.
Now, why might one want to capture these logs, you wonder? It's all about long-term analysis. Think of every CI/CD pipeline as a living organism. Just as doctors analyze our vitals and medical history to detect patterns and predict future health concerns, developers and DevOps teams can analyze the historical data from their builds to detect patterns, bottlenecks, and potential points of failure.
By collecting and analyzing logs over an extended period:
OpenObserve's integration with GitHub Actions is a match made in developer heaven. Not only does it provide a seamless way to capture valuable logs, but it also sets the stage for long-term insights that can drastically improve your CI/CD pipeline. And the best part? All of this is open source. The community is continually contributing, ensuring that this tool remains at the cutting edge of technology.
So, if you're looking to take your CI/CD pipeline to the next level, give OpenObserve and the openobserve_github_action_logs repository a try. The future of your builds is just one integration away.
Happy building!