Friday, May 9, 2025
News PouroverAI
Visit PourOver.AI
No Result
View All Result
  • Home
  • AI Tech
  • Business
  • Blockchain
  • Data Science & ML
  • Cloud & Programming
  • Automation
  • Front-Tech
  • Marketing
  • Home
  • AI Tech
  • Business
  • Blockchain
  • Data Science & ML
  • Cloud & Programming
  • Automation
  • Front-Tech
  • Marketing
News PouroverAI
No Result
View All Result

Deploy Prometheus and Grafana to AWS with GitHub Actions

December 12, 2023
in Front-Tech
Reading Time: 3 mins read
0 0
A A
0
Share on FacebookShare on Twitter



Ever wanted to host your own system to track important metrics over time? You’re in luck! Bitovi’s DevOps team has created a new GitHub Action called Deploy Prometheus that makes hosting an instance of Prometheus and Grafana in your own AWS account super easy! Whether you want to track the temperature of rooms in your house, website traffic visits, or even your company’s financial health, Prometheus makes it easy. And with Bitovi’s new action, you can seamlessly and easily set up Prometheus and Grafana to up your monitoring game! If you have a GitHub repo, an AWS account, and a desire to track anything you want, this post is for you!

What does the Deploy Prometheus Action do?
Our Deploy Prometheus Action will create the required infrastructure in AWS, install Prometheus and Grafana, and provide you with a URL. It creates an EC2 instance behind a load balancer, among other resources. It also copies the Prometheus and Grafana config (Docker compose) to the VM and runs docker-compose up. After your workflow completes, a link to your deployment URL will be provided.

Prerequisites:
– Nice to Have: A domain in Route53 – Setting this up in AWS will make the final deployment a breeze. (See our blog on how to set this up! – It’s as simple as adding sub_domain and domain_name to your action)

Summary of Work:
This example uses the files located here. The example repository gives us a Sandbox Prometheus and Grafana instance with URL access to each. In this article, you will:
1. Add Observability configuration files
2. Add a workflow (which calls the action)
3. Clean up the infrastructure when you’re done

This article assumes you are using branch-based environments, so start by creating a new branch: sandbox.

1. Add Observability Configuration Files:
Prometheus and Grafana each use file-based configuration. To configure Prometheus, create a new file for the sandbox Prometheus:
sandbox/observability/prometheus/prometheus.yml

“`
global:
scrape_interval: 15s
scrape_timeout: 10s
evaluation_interval: 15s
alerting:
alertmanagers:
– static_configs:
– targets: []
scheme: http
timeout: 10s
api_version: v1
scrape_configs:
– job_name: prometheus
honor_timestamps: true
scrape_interval: 15s
scrape_timeout: 10s
metrics_path: /metrics
scheme: http
static_configs:
– targets:
– localhost:9090
“`

To configure Grafana, create a new file for the sandbox Prometheus:
sandbox/observability/grafana/datasources/sources.yml

“`
apiVersion: 1
datasources:
# set the local prometheus instance as a datasource
– name: Prometheus
type: prometheus
url: http://prometheus:9090
isDefault: true
access: proxy
editable: true
“`

2. Add a Workflow:
To deploy Prometheus and Grafana with Bitovi’s deploy-prometheus action using the above configuration, all you need to do is create a workflow file under .github/workflows for each branch-based environment. For example, to create our sandbox deployment, create the following file: .github/workflows/deploy-sandbox.yaml

“`
name: Deploy Prometheus Sandbox
on:
push:
branches: [sandbox]
paths:
– ‘.github/workflows/deploy-sandbox.yaml’
– ‘observability/**’
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# Bitovi’s Deploy Prometheus
– id: deploy
name: Deploy
uses: bitovi/github-actions-deploy-prometheus@v0.1.0
with:
# AWS config
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID}}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
# Secrets config
env_ghs: ${{ secrets.DOT_ENV }}
# observability config
grafana_datasource_dir: sandbox/observability/grafana/datasources
prometheus_config: sandbox/observability/prometheus/prometheus.yml
“`

You can check all the possible variables you can use by going to our Github Action Marketplace Listing: Deploy Prometheus. When you push code to the repo’s sandbox branch and the action completes, it will output a URL you can use to access your new instance. The URL will point to the Load Balancer in front of your instance, or if you also set up a domain name in Route53, the output will be that domain name.

Prometheus UI:
[Grafana UI](url)

3. Cleanup:
If you wish to destroy all of the resources created, you can add the following inputs at the bottom of your workflow. Merging this to main will trigger the workflow again.

“`
tf_stack_destroy: true # If you wish to delete the auto-generated bucket
tf_state_bucket_destroy: true
“`

That’s it! That covers the basics.

Conclusion:
Congratulations! 🎉 You have deployed an instance of Prometheus! 🚀 With Bitovi’s Deploy Prometheus action, you now have a powerful tracking machine to keep an eye on all the metrics you love!

A Note on Platform Engineering with GitHub:
Did you know that with this Deploy Prometheus GitHub Action, you’re already using GitHub as a Platform Engineering platform? Want to know how to get more value from GitHub as a Platform Engineering platform? Bitovi loves working with Clients and Partners to build GitHub Actions for their products and services. Reach out to schedule a free Platform Engineering consultation! We’re looking forward to a bright future helping you with GitHub Actions and Platform Engineering.

Need Help?
Got a quick question or want to meet the team? Drop into Bitovi’s Community Discord, and talk to us in the devops forum.



Source link

Tags: ActionsAWSdeployGitHubGrafanaPrometheus
Previous Post

Looming Trouble In The Banking Industry

Next Post

A Chat With HubSpot CEO Yamini Rangan

Related Posts

The essential principles of a good homepage
Front-Tech

The essential principles of a good homepage

June 7, 2024
How to measure and improve user retention
Front-Tech

How to measure and improve user retention

June 6, 2024
Push Animation on Grid Items
Front-Tech

Push Animation on Grid Items

June 5, 2024
How to build a Rails API with rate limiting
Front-Tech

How to build a Rails API with rate limiting

June 4, 2024
Introduction to the B.I.A.S. framework
Front-Tech

Introduction to the B.I.A.S. framework

June 3, 2024
Blue Ridge Ruby is exactly what we need
Front-Tech

Blue Ridge Ruby is exactly what we need

June 3, 2024
Next Post
A Chat With HubSpot CEO Yamini Rangan

A Chat With HubSpot CEO Yamini Rangan

Are Your Code Signing Processes Mature? A Guide to Navigating Your Code Signing Maturity Journey

Are Your Code Signing Processes Mature? A Guide to Navigating Your Code Signing Maturity Journey

Introducing Dataquest’s Chandra – the Future of Learning to Code – Dataquest

Introducing Dataquest’s Chandra – the Future of Learning to Code – Dataquest

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Trending
  • Comments
  • Latest
Is C.AI Down? Here Is What To Do Now

Is C.AI Down? Here Is What To Do Now

January 10, 2024
Porfo: Revolutionizing the Crypto Wallet Landscape

Porfo: Revolutionizing the Crypto Wallet Landscape

October 9, 2023
A Complete Guide to BERT with Code | by Bradney Smith | May, 2024

A Complete Guide to BERT with Code | by Bradney Smith | May, 2024

May 19, 2024
A faster, better way to prevent an AI chatbot from giving toxic responses | MIT News

A faster, better way to prevent an AI chatbot from giving toxic responses | MIT News

April 10, 2024
Part 1: ABAP RESTful Application Programming Model (RAP) – Introduction

Part 1: ABAP RESTful Application Programming Model (RAP) – Introduction

November 20, 2023
Saginaw HMI Enclosures and Suspension Arm Systems from AutomationDirect – Library.Automationdirect.com

Saginaw HMI Enclosures and Suspension Arm Systems from AutomationDirect – Library.Automationdirect.com

December 6, 2023
Can You Guess What Percentage Of Their Wealth The Rich Keep In Cash?

Can You Guess What Percentage Of Their Wealth The Rich Keep In Cash?

June 10, 2024
AI Compared: Which Assistant Is the Best?

AI Compared: Which Assistant Is the Best?

June 10, 2024
How insurance companies can use synthetic data to fight bias

How insurance companies can use synthetic data to fight bias

June 10, 2024
5 SLA metrics you should be monitoring

5 SLA metrics you should be monitoring

June 10, 2024
From Low-Level to High-Level Tasks: Scaling Fine-Tuning with the ANDROIDCONTROL Dataset

From Low-Level to High-Level Tasks: Scaling Fine-Tuning with the ANDROIDCONTROL Dataset

June 10, 2024
UGRO Capital: Targeting to hit milestone of Rs 20,000 cr loan book in 8-10 quarters: Shachindra Nath

UGRO Capital: Targeting to hit milestone of Rs 20,000 cr loan book in 8-10 quarters: Shachindra Nath

June 10, 2024
Facebook Twitter LinkedIn Pinterest RSS
News PouroverAI

The latest news and updates about the AI Technology and Latest Tech Updates around the world... PouroverAI keeps you in the loop.

CATEGORIES

  • AI Technology
  • Automation
  • Blockchain
  • Business
  • Cloud & Programming
  • Data Science & ML
  • Digital Marketing
  • Front-Tech
  • Uncategorized

SITEMAP

  • Disclaimer
  • Privacy Policy
  • DMCA
  • Cookie Privacy Policy
  • Terms and Conditions
  • Contact us

Copyright © 2023 PouroverAI News.
PouroverAI News

No Result
View All Result
  • Home
  • AI Tech
  • Business
  • Blockchain
  • Data Science & ML
  • Cloud & Programming
  • Automation
  • Front-Tech
  • Marketing

Copyright © 2023 PouroverAI News.
PouroverAI News

Welcome Back!

Login to your account below

Forgotten Password? Sign Up

Create New Account!

Fill the forms bellow to register

All fields are required. Log In

Retrieve your password

Please enter your username or email address to reset your password.

Log In