From 1d0014d443f034367c2e5e261786906cd2cfc341 Mon Sep 17 00:00:00 2001 From: Mark Phelps Date: Sun, 7 Jul 2019 13:37:50 -0400 Subject: [PATCH] Add integration test for metrics; updated Changelog and docs to include reference to metrics --- CHANGELOG.md | 3 ++- docs/configuration.md | 22 +++++++++++++++++++++- test/integration | 6 ++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd6d75fc79..592502af0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,11 +3,12 @@ This format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## [v0.7.0](https://github.com/markphelps/flipt/releases/tag/v0.7.0) - 2019-07-07 ### Added * CORS support with `cors` config options +* [Prometheus](https://prometheus.io/) metrics exposed at `/metrics` ## [v0.6.1](https://github.com/markphelps/flipt/releases/tag/v0.6.1) - 2019-06-14 diff --git a/docs/configuration.md b/docs/configuration.md index 09d2981e59..e7edab2cfe 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -123,8 +123,28 @@ Work is planned to add caching support to rule evaluation soon. !!! warning Enabling in-memory caching when running more that one instance of Flipt is not advised as it will lead to unpredictable results. +## Metrics + +Flipt exposes [Prometheus](https://prometheus.io/) metrics at the `/metrics` HTTP endpoint. To see which metrics are currently supported, point your browser to `FLIPT_HOST/metrics` (ex: `localhost:8080/metrics`). + +You should see a bunch of metrics being recorded such as: + +```text +flipt_cache_hit_total{cache="memory",type="flag"} 1 +flipt_cache_miss_total{cache="memory",type="flag"} 1 +... +go_gc_duration_seconds{quantile="0"} 8.641e-06 +go_gc_duration_seconds{quantile="0.25"} 2.499e-05 +go_gc_duration_seconds{quantile="0.5"} 3.5359e-05 +go_gc_duration_seconds{quantile="0.75"} 6.6594e-05 +go_gc_duration_seconds{quantile="1"} 0.00026651 +go_gc_duration_seconds_sum 0.000402094 +go_gc_duration_seconds_count 5 +... +``` + ## Authentication -Flipt currently has no built in authentication, authorization or encryption as Flipt was designed to work inside your trusted architecture and not be exposed publicly. +There is currently no built in authentication, authorization or encryption as Flipt was designed to work inside your trusted architecture and not be exposed publicly. If you do wish to expose the Flipt dashboard and REST API publicly using HTTP Basic Authentication, you can do so by using a reverse proxy. There is an [example](https://github.com/markphelps/flipt/tree/master/examples/auth) provided in the GitHub repository showing how this could work. diff --git a/test/integration b/test/integration index 26d1df03d6..286bd33ba7 100755 --- a/test/integration +++ b/test/integration @@ -218,6 +218,11 @@ step_7_test_meta() contains "\"database\"" } +step_8_test_metrics() +{ + shakedown GET "$flipt_host/metrics" + status 200 +} run() { @@ -251,6 +256,7 @@ run() step_5_test_evaluation step_6_test_delete step_7_test_meta + step_8_test_metrics } cleanup ()