Git Product home page Git Product logo

go-prom's Introduction

         ,_---~~~~~----._
  _,,_,*^____      _____``*g*\"*,
 / __/ /'     ^.  /      \ ^@q   f
[  @f | @))    |  | @))   l  0 _/
 \`/   \~____ / __ \_____/    \
  |           _l__l_           I
  }          [______]           I
  ]            | | |            |
  ]             ~ ~             |
  |                            |
   |                           |
Go-prom

About

This is based on the Prometheus docs (Instrumenting a GO application for Prometheus).

I just take that post as a base project with the idea to create a simple Go application, deploy on a container and then try some Prometheus metrics on a local and kubernetes premises, in the way to make some tests with custom metrics.

This repo will be public, collaborative to anyone who wants to write some code just for fun.

Getting started

How to make it run:

Local Docker standalone

Fork the Go-prom repo and:

  $ git clone [email protected]:my-github-user/go-prom.git
  $ cd go-prom
  $ docker build -t my-github-user/go-prom .
  $ docker run -p80:2112 my-github-user/go-prom

At this point Prometheus should be serving metrics at http://localhost/metrics.

Run on terminal:

$> curl http://localhost/metrics

And you will be able to see some Prometheus metrics

Local Docker + Prometheus

Now it's time to make thing more complex. Let's try to start a Prometheus+Grafana to see some dashboards with our desired metrics.

First you will need to install docker-compose, configure it will be fine too :P

Then run the following commands:

$> docker-compose build
$> docker-compose up

At this point you will be able to navitage into Prometheus and Grafana (grafana login: admin/eatme)

As you could see there is a dashboard with some basic Go metrics!

Ps. To clean this mess you should run the following commands:

$> docker-compose stop
$> docker-compose rm
$> docker volume rm go-prom_grafana_data go-prom_prometheus_data

Enjoy!

Local Kubernetes (Kind sample)

TBD: This will have some Helm and YAML definitions to deploy a Kubernetes environment (with Kind)

go-prom's People

Contributors

cosckoya avatar nando avatar

Watchers

 avatar

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.