GithubHelp home page GithubHelp logo

jamessewell / prometheus-postgresql-adapter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from timescale/prometheus-postgresql-adapter

0.0 3.0 0.0 37 KB

License: Apache License 2.0

Makefile 5.61% Go 94.39%

prometheus-postgresql-adapter's Introduction

Prometheus remote storage adapter for PostgreSQL

With this remote storage adapter, Prometheus can use PostgreSQL as a long-term store for time-series metrics.

Related packages to install:

Docker instructions

A docker image for the prometheus-postgreSQL storage adapter is available on Docker Hub at timescale/prometheus-postgresql-adapter.

The easiest way to use this image is in conjunction with the pg_prometheus docker image provided by Timescale. This image packages PostgreSQL, pg_prometheus, and TimescaleDB together in one docker image.

To run this image use:

docker run --name pg_prometheus -d -p 5432:5432 timescale/pg_prometheus:master postgres \
      -csynchronous_commit=off

Then, start the prometheus-postgreSQL storage adapter using:

 docker run --name prometheus_postgresql_adapter --link pg_prometheus -d -p 9201:9201 \
 timescale/prometheus-postgresql-adapter:master \
 -pg-host=pg_prometheus \
 -pg-prometheus-log-samples

Finally, you can start Prometheus with:

docker run -p 9090:9090 --link prometheus_postgresql_adapter -v /path/to/prometheus.yml:/etc/prometheus/prometheus.yml \
       prom/prometheus

(a sample prometheus.yml file can be found in sample-docker-prometheus.yml in this repository).

Configuring Prometheus to use this remote storage adapter

You must tell prometheus to use this remote storage adapter by adding the following lines to prometheus.yml:

remote_write:
  - url: "http://<adapter-address>:9201/write"
remote_read:
  - url: "http://<adapter-address>:9201/read"

Building

Before building, make sure the following prerequisites are installed:

  • Dep for dependency management.
  • Go

Then build as follows:

# Install dependencies (only required once)
dep ensure

# Build binary
make

Building new Docker images

# Build Docker image
make docker-image

# Push to Docker registry (requires permission)
make docker-push ORGANIZATION=myorg 

Contributing

We welcome contributions to this adaptor, which like TimescaleDB is released under the Apache2 Open Source License. The same Contributors Agreement applies; please sign the Contributor License Agreement (CLA) if you're a new contributor.

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.