Skip to content

Commit f85d1b1

Browse files
Improve Grafana Alloy useability (#8)
* Improve alloy docker image. Cleanup folders * Update documentation * Move dashboards into folders
1 parent 87924a8 commit f85d1b1

File tree

25 files changed

+87
-225
lines changed

25 files changed

+87
-225
lines changed

docs/observability/customization/custom-prometheus-configs.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Mount these files under `site/prometheus/scrape-configs/exporters/*.yml` in dock
1212

1313

1414
### Add Exporters to Prometheus
15-
- `prometheus/scrape-configs/exporters/` -
15+
- `prometheus/scrape-configs/exporters/`
1616
Add yaml files into this folder. These file should contain all exporter prometheus metrics, for example from node_exporter or CAdvisor. Add any hosts and ip addresses you want to collect /metrics from will be retrieved
1717

1818
```yaml
@@ -26,6 +26,9 @@ Mount these files under `site/prometheus/scrape-configs/exporters/*.yml` in dock
2626
# __metrics_path__: /path/metrics # Optionally override the metrics path, the default is just /metrics
2727
# ... add all targets
2828
```
29+
30+
Note that this project is setup to run Grafana Alloy to push metrics from individual VMs. The config in `prometheus/scrape-configs/exporters/` is an alternative way, allowing you to pull metrics from any other services.
31+
2932
## Custom Prometheus Scrape Configs
3033

3134
You can add compeltely custom prometheus scrape configs and recording rules by mounting in docker.

docs/observability/get-started/quickstart.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ If you can't use the script, see the [Manual Quickstart](../reference/quickstart
2828
### Optional Step: Probe your own web page
2929
Now you can look at getting monitoring of your own page
3030

31-
1. In your current folder, in the file `prometheus/scrape-configs/probers/probe-simple.yml` add the following yml to the bottom of the file:
31+
1. In your current folder, in the file `alloy/probers/probe-observability.yml` add the following yml to the bottom of the file:
3232

3333
```yaml
3434
- targets:
@@ -52,11 +52,7 @@ This is the end of this quickstart tutorial, that enables probing availability o
5252

5353
For the next steps we can:
5454
- Look deeper into the observability dashboards, on [Dashboards Userguide](./userguide-tutorial.md)
55-
- Productionise our deployment to enable further features
56-
- Configure *Telemetry* like VM memory usage, and Elasticsearch index size, by running Exporters
57-
- Enable *Alerting* based on our availability and a defined Service Level Objective (SLO)
58-
- Setup further *Probing* of our running services to get availability metrics
59-
- Fully customize the stack with our own dashboards, recording rules and metrics
55+
- Productionise our deployment to enable further features by following [Production Setup](../setup/production-setup.md)
6056

6157

6258

docs/observability/setup/production-setup.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ If you're new, we recommend completing the [Quickstart Tutorial](../get-started/
66

77
By the end of the tutorial, you will have a complete stack offering all the observability features, customized to your usage.
88

9+
We will run the stack and then:
10+
- Configure *Telemetry* like VM memory usage, and Elasticsearch index size, by running Exporters
11+
- Enable *Alerting* based on our availability and a defined Service Level Objective (SLO)
12+
- Setup further *Probing* of our running services to get availability metrics
13+
14+
915
---
1016

1117
## Step 1: Understand the Folder Structure
@@ -44,7 +50,7 @@ Downloads the example docker compose files:
4450

4551
Downloads the configurations:
4652
- [alloy/probers/probe-external.yml](../../../observability/examples/full/alloy/probers/probe-external.yml)
47-
- [alloy/probers/probe-internal.yml ](../../../observability/examples/full/alloy/probers/probe-internal.yml)
53+
- [alloy/probers/probe-observability.yml ](../../../observability/examples/full/alloy/probers/probe-observability.yml)
4854
- [prometheus/scrape-configs/exporters/exporters.yml](../../../observability/examples/full/prometheus/scrape-configs/exporters/exporters.yml)
4955
- [prometheus/scrape-configs/recording-rules/slo.yml](../../../observability/examples/full/prometheus/scrape-configs/recording-rules/slo.yml)
5056

@@ -58,10 +64,10 @@ The files come with basic defaults, so we can now run the stack
5864

5965
```
6066
docker compose up -d
61-
docker compose -f exporters.docker-compose.yml up -d
6267
```
6368

64-
This will launch Prometheus, Grafana, and all required services with
69+
This will launch Prometheus, Grafana, and Alloy
70+
6571

6672

6773
## Step 4: Create Site-Specific Config Files
@@ -70,21 +76,24 @@ You must provide your own scrape and recording rules to tell Prometheus what to
7076
This is probably the hardest step: You will actually need to know what is running, and where it is! Building out these config files will give you that inventory, and give a real definition of what is running where.
7177

7278
- Probers: HTTP endpoints you want to monitor for availability
73-
- Add files in `scrape-configs/probers/*.yml`
79+
- Add files in `alloy/probers/*.yml`
7480
- [Configure Probers](./probing.md)
75-
76-
- Exporters: Targets like Elasticsearch or Docker
77-
- Add files in `scrape-configs/exporters/*.yml`
78-
- [Add Exporters](./telemetry.md)
81+
82+
- Telemetry: Run Grafana Alloy on every VM you want telemetry from
83+
- [Configure Telemetry](./probing.md)
7984

8085
- Recording Rules: Define uptime goals or custom aggregations
8186
- Add files in `recording-rules/*.yml`
8287
- [Enable Alerting](./alerting.md)
8388

84-
## Step 5: Run Exporters Everywhere
85-
The exporters need to be run on each VM that you want information from. It's a pull model, not push.
89+
## Step 5: Run Grafana Alloy on every VM
90+
The Grafana Alloy image needs to be run on each VM that you want to get information from.
8691

92+
Use the example docker compose file in [exporters.docker-compose.yml](../../../observability/examples/full/exporters.docker-compose.yml) which will start up alloy and get metrics
8793

94+
```
95+
docker compose -f exporters.docker-compose.yml up -d
96+
```
8897
---
8998

9099
## What’s Next?
@@ -93,7 +102,7 @@ Your observability stack is now monitoring your services, and you have a product
93102

94103
You can now setup prometheus with any telemetry or probers required following the remaining steps in [Setup](./_index.md)
95104

96-
For the last steps, you can
105+
For the last steps, you can:
97106

98107
- Run the exporters on all the VMs that you want access to
99108
- Deploy the stack in produciton

docs/observability/setup/telemetry.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Grafana Alloy is used to get telemetry. These features are configured by default
1010
- Elastic Search Exporter: Get ES metrics like index size
1111
- CAdvisor: This gives docker metrics, eg what containers are running
1212

13-
1413
## How to get Telemetry
1514

1615
- Copy this docker compose file: (exporters.docker-compose.yml)[observability/examples/full/exporters.docker-compose.yml]

observability/examples/alloy/docker-compose.yml

Lines changed: 0 additions & 78 deletions
This file was deleted.

observability/examples/alloy/prometheus/scrape-configs/probers/probe-internal.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.

observability/examples/alloy/prometheus/scrape-configs/recording-rules/slo.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

observability/examples/full/alloy/probers/probe-internal.yml

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
- targets:
2+
- cogstack-observability-traefik-1/grafana/api/health
3+
labels:
4+
name: grafana
5+
job: probe-observability-stack
6+
host: localhost
7+
- targets:
8+
- cogstack-observability-traefik-1/prometheus/-/healthy
9+
labels:
10+
name: prometheus
11+
job: probe-observability-stack
12+
host: localhost

observability/examples/full/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ services:
66
image: cogstacksystems/cogstack-observability-alloy:latest
77
ports:
88
- "12345:12345"
9+
networks:
10+
- observability
911
volumes:
1012
- ${BASE_DIR-.}/alloy/probers:/etc/alloy/probers
1113
# CAdvisor

0 commit comments

Comments
 (0)