https://github.com/suzuki-shunsuke/github-ci-monitor
Monitor GitHub repositories CI statues by DataDog
https://github.com/suzuki-shunsuke/github-ci-monitor
datadog github lambda-functions oss
Last synced: about 2 months ago
JSON representation
Monitor GitHub repositories CI statues by DataDog
- Host: GitHub
- URL: https://github.com/suzuki-shunsuke/github-ci-monitor
- Owner: suzuki-shunsuke
- License: mit
- Archived: true
- Created: 2020-11-01T02:42:48.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-11-23T07:41:41.000Z (5 months ago)
- Last Synced: 2025-02-18T22:34:14.290Z (3 months ago)
- Topics: datadog, github, lambda-functions, oss
- Language: Go
- Homepage:
- Size: 319 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# github-ci-monitor
[](https://github.com/suzuki-shunsuke/github-ci-monitor/actions)
[](https://goreportcard.com/report/github.com/suzuki-shunsuke/github-ci-monitor)
[](https://github.com/suzuki-shunsuke/github-ci-monitor)
[](https://raw.githubusercontent.com/suzuki-shunsuke/github-ci-monitor/main/LICENSE)Check GitHub repositories CI statues and send them to DataDog.
## Overview
When we merge pull requests, sometimes CI/CD fails.
Then we want to find the failure.By running this tool periodically, we can monitor the status by DataDog.
This tool gets GitHub repositories CI statues (commit status and Check API) and sends the result by DataDog API.
## Running on AWS Lambda
### Architecture

1. Run a Lambda Function periodically with Amazon CloudWatch Events.
1. In a Lambda Function, get repositories statuses by GitHub API
1. Send service checks by DataDog API
1. Configure DataDog Monitor and send alerts from DataDog to Slack### How to setup
We publish [github-ci-monitor at AWS Serverless Application Repository](https://ap-northeast-1.console.aws.amazon.com/lambda/home?region=ap-northeast-1#/create/app?applicationId=arn:aws:serverlessrepo:ap-northeast-1:455828037039:applications/github-ci-monitor).
* Create AWS Secrets Manager's secret
* Deploy the Lambda Function with AWS SAM
* [Example of SAM template](examples/sam/template.yaml)### Configuration
* Lambda's environment variables
* AWS Secrets Manager's secret#### Lambda's environment variables
* `CONFIG`: YAML
```yaml
---
repos:
- owner: suzuki-shunsuke
repo: test-github-action
ref: master
status: true
check_run: true
check_suite: true
tags:
codeowner: sre
region: ap-northeast-1
secret_id: github-ci-monitor
check_name: ci.ok
tags:
sender: github-ci-monitor
```#### AWS Secrets Manager's secret
* datadog_api_key
* github_token## How to create the DataDog Monitor
New Monitor > Custom Check
* Select a check: `ci.ok`
## LICENSE
[MIT](LICENSE)