Monitoring the digitalocean app platform with ...the digitalocean app platform?
Tags: dohackathon, monitoring, hackathon, digitalocean
Published: 2021-01-09 18:47:56

## What I built

I created a pull request to add existing functionality to a popular digitalocean monitoring app to monitor resources on the digitalocean app platform and tied it into my first hackathon entry. Along with adding functionality to monitor the app platform, I added a deploy template + button to allow simple deployment for consumers.

### Category Submission: 

**Built for Business**

I contemplated whether or not this should be submitted for the Random Roulette category or not. While this app is not suited to turn a profit, I think it can really help commercial entities monitor and track their infrastructure on digitalocean to monitor costs, availability, and just get general insight into their resources on the cloud platform such as deployments and builds. 

### App Link

- [DigitalOcean Exporter Deployment](https://digitalocean-exporter-gm83a.ondigitalocean.app/metrics)

- [DigitalOcean App Platform Monitoring Dashboard](https://mcbroken-dashboard-t7vfw.ondigitalocean.app/grafana/d/KF7IjE-Gk/digitalocean-apps?orgId=1)

### Screenshots

![Screen Shot 2021-01-09 at 12.14.16 PM](https://dev-to-uploads.s3.amazonaws.com/i/qf8655dyappovqomjj7w.png)

![Screen Shot 2021-01-09 at 12.19.28 PM](https://dev-to-uploads.s3.amazonaws.com/i/ssa32a359v3vtnbxn2vf.png)

![alt text](https://user-images.githubusercontent.com/21261388/103571669-e6d66700-4e90-11eb-8d7f-f9106eb47f79.png)

### Description
 
This is actually my second hackathon entry which builds off of [my first app](https://dev.to/circa10a/the-mcbroken-dashboard-1eij).

For this entry, I went back to our [hacktoberfest](https://hacktoberfest.digitalocean.com/) roots and took an open source approach. For this entry, [I made a pull request to add additional features](https://github.com/metalmatze/digitalocean_exporter/pull/16) to the [digitalocean prometheus exporter](https://github.com/metalmatze/digitalocean_exporter). This allows any user to deploy the prometheus exporter on the app platform and monitor the status of their apps for things like builds, deployments, regions and tiers.

### Link to Source Code

- [My DigitalOcean exporter fork](https://github.com/circa10a/digitalocean_exporter/tree/app-platform-circa10a)

- [DigitalOcean Exporter Pull Request](https://github.com/metalmatze/digitalocean_exporter/pull/16)

- [Prometheus/Grafana deployment code from first entry](https://github.com/circa10a/mcbroken-dashboard)

### Permissive License

MIT

## Background

I've previously worked on the application and this is my 3rd featured added. Given the new capabilities of the platform, it felt like a no-brainer for this functionality to be enabled for the community.

### How I built it 

I wrote some Go code utilizing digitalocean's godo client to pull details from the app platform and converted them to prometheus metrics via a new collector. I also added a digitalocean application deployment template to make it simple for users to deploy.
 
Once the new features were ready, I deployed the exporter on the platform and added the endpoint to my existing prometheus configuration to scrape. Once data was being ingested, I created a [new grafana dashboard](https://mcbroken-dashboard-t7vfw.ondigitalocean.app/grafana/d/KF7IjE-Gk/digitalocean-apps?orgId=1) to showcase available metrics and ideal usage of the data in a real world setting.

It was lots of fun to make the app platform data more accessible... while also using the platform!

### Additional Resources/Info

While the pull request hasn't been merged yet, I'm confident that it will be. I even [added new functionality to scrape digitalocean managed database info](https://github.com/metalmatze/digitalocean_exporter/pull/17) during the hackathon... because why not.