Skip to content

Commit

Permalink
Add example usage for grafana and prometheus in integration (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
agbpatro committed Apr 9, 2024
1 parent 3e395bc commit 0431c0f
Show file tree
Hide file tree
Showing 7 changed files with 1,856 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ The following [dispatchers](./telemetry/producer.go#L10-L19) are supported
>NOTE: To add a new dispatcher, please provide integration tests and updated documentation. To serialize dispatcher data as json instead of protobufs, add a config `transmit_decoded_records` and set value to `true` as shown [here](config/test_configs_test.go#L104)

## Metrics
Configure and use Prometheus or a StatsD-interface supporting data store for metrics.
Configure and use Prometheus or a StatsD-interface supporting data store for metrics. The integration test runs fleet telemetry with [grafana](https://grafana.com/docs/grafana/latest/datasources/google-cloud-monitoring/), which is compatible with prometheus. It also has an example dashboard which tracks important metrics related to the hosted server. Sample screenshot for the [sample dashboard](./test/integration/grafana/provisioning/dashboards/dashboard.json):-

![Basic Dashboard](./doc/grafana-dashboard.png)

## Protos
Data is encapsulated into protobuf messages of different types. Protos can be recompiled via:
Expand Down
Binary file added doc/grafana-dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,25 @@ services:
interval: 5s
volumes:
- ./test/integration/mongodb/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro

prometheus:
image: prom/prometheus
ports:
- "19090:9090"
volumes:
- ./test/integration/prometheus:/etc/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'

grafana:
image: grafana/grafana
ports:
- "13000:3000"
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=grafana
volumes:
- ./test/integration/grafana/provisioning:/etc/grafana/provisioning
depends_on:
prometheus:
condition: service_started
Loading

0 comments on commit 0431c0f

Please sign in to comment.