Skip to content

Commit c8f40ff

Browse files
authored
Merge pull request #11 from agenixframework/feature/refactor-prometheus-config-structure
Refactor Prometheus config structure and update GitHub workflow for a…
2 parents 6075866 + 76b3a4c commit c8f40ff

File tree

5 files changed

+41
-2
lines changed

5 files changed

+41
-2
lines changed

.github/workflows/publish-nuget-and-containers.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,22 @@ jobs:
324324
echo "Resolved compose generated at ./artifacts/compose/docker-compose-${{ needs.build.outputs.version }}.yml (and copied as docker-compose.yml)"
325325
head -n 50 ./artifacts/compose/docker-compose-${{ needs.build.outputs.version }}.yml || true
326326
327+
echo "Including configuration directories (prometheus, provisioning)"
328+
if [ -d "./prometheus" ]; then
329+
cp -R ./prometheus ./artifacts/compose/prometheus
330+
fi
331+
if [ -f "./prometheus.yml" ]; then
332+
# Legacy fallback if a single-file layout is used somewhere
333+
cp ./prometheus.yml ./artifacts/compose/prometheus.yml
334+
fi
335+
if [ -d "./provisioning" ]; then
336+
cp -R ./provisioning ./artifacts/compose/provisioning
337+
fi
338+
339+
echo "Copying source compose files for reference"
340+
cp docker-compose.yml ./artifacts/compose/_source-docker-compose.yml
341+
cp docker-compose.images.yml ./artifacts/compose/_source-docker-compose.images.yml
342+
327343
- name: Upload docker-compose artifact
328344
uses: actions/upload-artifact@v4
329345
with:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ HTTP API summary
131131
Metrics and observability
132132

133133
- Hub and Workers expose Prometheus metrics at `http://<host-port>/metrics` (compose maps hub 5100, workers 5200+).
134-
- Prometheus is preconfigured to scrape hub and workers (see prometheus.yml).
134+
- Prometheus is preconfigured to scrape hub and workers (see prometheus/prometheus.yml).
135135
- Grafana is provisioned; open http://127.0.0.1:3000 and explore dashboards.
136136

137137
Testing (GridTests)

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ services:
2020
ports:
2121
- "9090:9090"
2222
volumes:
23-
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
23+
- ./prometheus:/etc/prometheus:ro
2424
restart: unless-stopped
2525

2626
grafana:

prometheus.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ scrape_configs:
1414
- job_name: 'worker2'
1515
static_configs:
1616
- targets: ['worker2:5000']
17+
18+
- job_name: 'worker3'
19+
static_configs:
20+
- targets: ['worker3:5000']

prometheus/prometheus.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
global:
2+
scrape_interval: 5s
3+
4+
scrape_configs:
5+
- job_name: 'hub'
6+
static_configs:
7+
- targets: ['hub:5000']
8+
9+
- job_name: 'worker1'
10+
static_configs:
11+
- targets: ['worker1:5000']
12+
13+
- job_name: 'worker2'
14+
static_configs:
15+
- targets: ['worker2:5000']
16+
17+
- job_name: 'worker3'
18+
static_configs:
19+
- targets: ['worker3:5000']

0 commit comments

Comments
 (0)