timescale / prometheus-postgresql-adapter

Use PostgreSQL as a remote storage database for Prometheus
Apache License 2.0
335 stars 66 forks source link

Check installed extensions and schema before attempting setup #100

Closed antekresic closed 4 years ago

antekresic commented 4 years ago

In some environments, running commands like CREATE EXTENSION require superuser access and can cause extraneous error logs on each adapter startup if the necessary setup is already in place. This commit verifies if the setup is already in place to skip the setup on startup.

Fixes #98, #90

codecov[bot] commented 4 years ago

Codecov Report

Merging #100 into master will decrease coverage by 0.76%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #100      +/-   ##
==========================================
- Coverage   13.94%   13.18%   -0.77%     
==========================================
  Files           4        4              
  Lines         588      622      +34     
==========================================
  Hits           82       82              
- Misses        491      525      +34     
  Partials       15       15
Impacted Files Coverage Δ
pkg/postgresql/client.go 9.61% <0%> (-1%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a2ec517...b2630eb. Read the comment docs.