Giter Club home page Giter Club logo

grafana-prometheus-for-fargate's Introduction

Index

Introduction

This pipeline via automation will deploy Prometheus and Grafana on an AWS Fargate also the core infrastructure to support it.

Grafana - Grafana is a multi-platform open source analytics and interactive visualization web application.

Prometheus - Prometheus is a free software application used for event monitoring and alerting.

Diagram

The below diagram shows the AWS resources.

Diagram

Requirements

  1. These tools were installed:
  1. Update the file group_vars/all/common.yml accordingly.
---
cloudformation:
  check_mode_override: false
  region: ap-southeast-2
  create_changeset: true
  state: present

Route53:
  HostedZoneName: "ugulino.com."
  RecordName: "monitor.ugulino.com"
  CertificateId: "5eaa197e" # your ACM Id

Ansible

Playbook Command

The file deploy-role.yml will deploy each role required to deploy this project.

---
- hosts: localhost
  roles:
    - vpc-baseline
    - ecs-cluster
    - ecs-monitor
    - route53

The below command will execute the tasks defined on the above file.

ansible-playbook deploy-role.yml -vvv

Output

You can verify the deployment via ansible output or via AWS CloudFormation console.

  • Ansible Output:

AnsibleOutput

  • AWS CloudFormation Console:

AWSCF

AWS

Network

Network

ECS Cluster

ecs-cluster

AWS EFS

aws-efs

ECS Tasks

aws-ecs

Domain

An 'A' record was created pointing to Application Load Balancer via automation.

ARecord

Application

Web Console

You can access and setup Grafana accessing the URL https://monitor.ugulino.com (be aware that this is my domain, probably you've setup a different one)

Default username and password is admin

web-console

Setup the Data Source for prometheus.

EC2 REQUIREMENTS:

  • The EC2 instances taged as below
  • The application node-exporter installed on the EC2.
  • Allow Inbound and Outbound port 9100.

ec2-tag

Grafana Dashboard Id 1860

ec2-monitor

The below prometheus.yml was used for this environment. Upload this file to AWS EFS.

################-----//-----################

# USE THIS FILE AS AN EXAMPLE.

################-----//-----################

# my global config
global:
  scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.

scrape_configs:
  - job_name: "ec2-nodes"
    ec2_sd_configs:
      - region: ap-southeast-2
        port: 9100

    relabel_configs:
      - source_labels: [__meta_ec2_tag_prometheus]
        regex: true.*
        action: keep

      - source_labels: [__meta_ec2_tag_Name]
        target_label: instance

Destroy

Basically, to destroy this deployment you can either do it via ansible command or AWS CloudFormation.

Via Ansible

Change the file group_vars/all/common.yml

cloudformation:
  check_mode_override: false
  region: ap-southeast-2
  create_changeset: true
  state: absent # this is the value you need to change to destroy the stacks

Execute the command:

ansible-playbook deploy-role.yml -vvv

Via CloudFormation

Select the CloudFormation stack, click delete, and then Delete stack.

destroy

grafana-prometheus-for-fargate's People

Contributors

lessandro-ugulino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

grafana-prometheus-for-fargate's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.