Skip to content

Commit

Permalink
chore: update analytics examples
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Phelps <209477+markphelps@users.noreply.github.com>
  • Loading branch information
markphelps committed Nov 27, 2024
1 parent 5ca3e32 commit 080c89a
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 9 deletions.
1 change: 1 addition & 0 deletions examples/analytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ For more information on the different analytics configurations, see the [Analyti
## Contents

* [Clickhouse Example](clickhouse/README.md)
* [Prometheus Example](prometheus/README.md)
4 changes: 2 additions & 2 deletions examples/analytics/clickhouse/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src="../../images/logos/clickhouse.svg" alt="MySQL" width=150 height=150 />
<img src="../../images/logos/clickhouse.svg" alt="ClickHouse" width=150 height=150 />
</p>

# ClickHouse Example
Expand All @@ -8,7 +8,7 @@ Flipt supports storing and querying flag evaluation data by leveraging [ClickHou

This example demonstrates how to use Flipt with ClickHouse to store and query flag evaluation data.

!['ClickHouse Example'](../../images/clickhouse.png)
!['Analytics Example'](../../images/analytics.png)

## Requirements

Expand Down
25 changes: 25 additions & 0 deletions examples/analytics/prometheus/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<p align="center">
<img src="../../images/logos/prometheus.svg" alt="Prometheus" width=150 height=150 />
</p>

# Prometheus Example

Flipt supports storing and querying flag evaluation data by leveraging [Prometheus](https://prometheus.io/) as the backend data store.

This example demonstrates how to use Flipt with Prometheus to store and query flag evaluation data.

!['Analytics Example'](../../images/analytics.png)

## Requirements

To run this example application you'll need:

* [Docker](https://docs.docker.com/install/)
* [docker-compose](https://docs.docker.com/compose/install/)

## Running the Example

1. Run `docker compose up` from this directory
1. Open the Flipt UI (default: [http://localhost:8080](http://localhost:8080))
1. Create some sample data: Flags/Segments/etc. Perform a few evaluations in the Console.
1. Navigate to the `Analytics` tab for the flag that you created and evaluated.
7 changes: 3 additions & 4 deletions examples/analytics/prometheus/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ services:
- "9090:9090"
command:
- --config.file=/etc/prometheus/prometheus.yml
- --web.config.file=/etc/prometheus/web-config.yml
# - --web.config.file=/etc/prometheus/web-config.yml
flipt:
image: flipt/flipt:latest
volumes:
- "./flipt-config.yml:/etc/flipt/config/default.yml"
depends_on:
prometheus:
condition: service_healthy
- prometheus
ports:
- "8080:8080"
networks:
Expand All @@ -27,7 +26,7 @@ services:
- FLIPT_LOG_LEVEL=info
- FLIPT_ANALYTICS_STORAGE_PROMETHEUS_ENABLED=true
- FLIPT_ANALYTICS_STORAGE_PROMETHEUS_URL=http://prometheus:9090
- PROMETHEUS_AUTH_TOKEN='Basic YWRtaW46dGVzdA=='
# - PROMETHEUS_AUTH_TOKEN='Basic YWRtaW46dGVzdA=='
- FLIPT_META_TELEMETRY_ENABLED=false
command: ["/flipt", "--force-migrate"]

Expand Down
6 changes: 3 additions & 3 deletions examples/analytics/prometheus/flipt-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ analytics:
storage:
prometheus:
enabled: true
url: http://localhost:9090
headers:
Authorization: ${PROMETHEUS_AUTH_TOKEN}
url: http://prometheus:9090
# headers:
# Authorization: ${PROMETHEUS_AUTH_TOKEN}
File renamed without changes

0 comments on commit 080c89a

Please sign in to comment.