Giter VIP home page Giter VIP logo

go-prometheus-client-example's Introduction

Go Prometheus Client Example

This is an example of a web app that queries a Prometheus server. Originally intended as a proof-of-concept for querying the Prometheus server in the using Rancher's cluster monitoring, this can also be applied to other Prometheus instances that optionally have basic authentication.

The web app uses Echo.

Getting Started

For development, using dotenv is recommended for configuration. In production, this can be replaced with docker-compose environment or kubernetes config map.

cp .env.example .env
  • PROMETHEUS_URL: Prometheus URL
  • PROMETHEUS_AUTH_USERNAME: Optional basic auth username
  • PROMETHEUS_AUTH_PASSWORD: Optional basic auth password

The project comes with basic support for docker container development and deployment. This is optional.

cd docker
cp .env.example .env
docker-compose up -d

Reflex will automatically reload the server if there are changes in .go or .html files.

Rancher Cluster Monitoring

A step-by-step guide can be found at https://hellowillie.com/2020/01/17/sample-go-web-app-for-querying-rancher-cluster-monitoring-prometheus/

To query the Prometheus instance deployed with Rancher's cluster monitoring:

License

This project is licensed under the MIT License - see the LICENSE file for details.

go-prometheus-client-example's People

Contributors

dependabot[bot] avatar n3v3rf411 avatar

Watchers

 avatar  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.