Skip to content

Commit 24f7644

Browse files
zz_yclaude
andcommitted
refactor: keep original Arroyo configs, add separate precompute versions
Instead of modifying the existing docker-compose.yml and prometheus.yml, keep them unchanged (Arroyo-based) and add new files for the precompute engine variant: - docker-compose-precompute.yml: e2e stack using the hand-crafted precompute engine (no Kafka/Arroyo/asap-summary-ingest needed) - prometheus-precompute.yml: remote_write pointing to queryengine:9091 Usage: docker compose -f docker-compose-precompute.yml up Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8b4bb10 commit 24f7644

4 files changed

Lines changed: 474 additions & 15 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Prometheus configuration for pattern-based fake exporters demo
2+
# Uses the hand-crafted precompute engine (instead of Arroyo) for sketch building
3+
4+
global:
5+
scrape_interval: 1s
6+
evaluation_interval: 1s
7+
8+
# Remote write configuration to send metrics to the precompute engine for sketch building
9+
remote_write:
10+
- url: http://queryengine:9091/api/v1/write
11+
queue_config:
12+
batch_send_deadline: 1s
13+
write_relabel_configs:
14+
- source_labels: [__name__]
15+
regex: sensor_reading
16+
action: keep
17+
18+
scrape_configs:
19+
# Scrape pattern-based fake exporters
20+
# Each exporter generates one pattern type (constant, sine, linear, etc.)
21+
# All metrics have a 'pattern' label indicating their pattern type
22+
- job_name: 'pattern-exporters'
23+
metric_relabel_configs:
24+
- source_labels: [__name__]
25+
regex: sensor_reading
26+
action: keep
27+
static_configs:
28+
- targets:
29+
- 'fake-exporter-constant:50000'
30+
- 'fake-exporter-linear-up:50001'
31+
- 'fake-exporter-linear-down:50002'
32+
- 'fake-exporter-sine:50003'
33+
- 'fake-exporter-sine-noise:50004'
34+
- 'fake-exporter-step:50005'
35+
- 'fake-exporter-spiky:50006'
36+
- 'fake-exporter-exp-up:50007'

‎asap-quickstart/config/prometheus.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ global:
44
scrape_interval: 1s
55
evaluation_interval: 1s
66

7-
# Remote write configuration to send metrics to the precompute engine for sketch building
7+
# Remote write configuration to send metrics to Arroyo for sketch building
88
remote_write:
9-
- url: http://queryengine:9091/api/v1/write
9+
- url: http://arroyo:9091/receive
1010
queue_config:
1111
batch_send_deadline: 1s
1212
write_relabel_configs:
Lines changed: 301 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,301 @@
1+
name: asapquery-quickstart-precompute
2+
3+
# Docker Compose file for pattern-based fake exporters demo
4+
# Uses the hand-crafted precompute engine instead of Arroyo for streaming aggregation
5+
# This eliminates the need for Kafka, Arroyo, and asap-summary-ingest
6+
7+
networks:
8+
asap-network:
9+
driver: bridge
10+
ipam:
11+
driver: default
12+
config:
13+
- subnet: 172.25.0.0/16
14+
15+
volumes:
16+
prometheus-data:
17+
grafana-data:
18+
asap-planner-output:
19+
20+
services:
21+
#############################################################################
22+
# INFRASTRUCTURE SERVICES
23+
#############################################################################
24+
25+
prometheus:
26+
image: prom/prometheus:v3.9.1
27+
container_name: asap-prometheus
28+
hostname: prometheus
29+
networks:
30+
- asap-network
31+
ports:
32+
- "9090:9090"
33+
volumes:
34+
- ./config/prometheus-precompute.yml:/etc/prometheus/prometheus.yml:ro
35+
- prometheus-data:/prometheus
36+
command:
37+
- "--config.file=/etc/prometheus/prometheus.yml"
38+
- "--storage.tsdb.path=/prometheus"
39+
- "--web.console.libraries=/usr/share/prometheus/console_libraries"
40+
- "--web.console.templates=/usr/share/prometheus/consoles"
41+
- "--web.enable-lifecycle"
42+
healthcheck:
43+
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:9090/-/healthy || exit 1"]
44+
interval: 10s
45+
timeout: 5s
46+
retries: 5
47+
depends_on:
48+
queryengine:
49+
condition: service_healthy
50+
restart: no
51+
52+
grafana:
53+
image: grafana/grafana-enterprise:12.3.3
54+
container_name: asap-grafana
55+
hostname: grafana
56+
networks:
57+
- asap-network
58+
ports:
59+
- "3000:3000"
60+
environment:
61+
- GF_SECURITY_ADMIN_PASSWORD=admin
62+
- GF_SECURITY_ADMIN_USER=admin
63+
- GF_USERS_ALLOW_SIGN_UP=false
64+
- GF_SERVER_ROOT_URL=http://localhost:3000
65+
- GF_SECURITY_ALLOW_EMBEDDING=true
66+
volumes:
67+
- grafana-data:/var/lib/grafana
68+
- ./config/grafana/provisioning:/etc/grafana/provisioning:ro
69+
healthcheck:
70+
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3000/api/health || exit 1"]
71+
interval: 10s
72+
timeout: 5s
73+
retries: 5
74+
restart: no
75+
76+
#############################################################################
77+
# INIT CONTAINERS
78+
#############################################################################
79+
80+
asap-planner-rs:
81+
image: ghcr.io/projectasap/asap-planner-rs:v0.2.0
82+
container_name: asap-planner-rs
83+
hostname: asap-planner-rs
84+
networks:
85+
- asap-network
86+
command:
87+
- "--input_config=/config/controller-config.yaml"
88+
- "--output_dir=/asap-planner-output"
89+
- "--prometheus_scrape_interval=1"
90+
- "--streaming_engine=arroyo"
91+
- "--range-duration=300"
92+
- "--step=10"
93+
volumes:
94+
- ./config/controller-config.yaml:/config/controller-config.yaml:ro
95+
- asap-planner-output:/asap-planner-output
96+
restart: "no"
97+
98+
#############################################################################
99+
# CORE SERVICES
100+
#############################################################################
101+
102+
queryengine:
103+
image: ghcr.io/projectasap/asap-query-engine:v0.2.0
104+
container_name: asap-queryengine
105+
hostname: queryengine
106+
networks:
107+
- asap-network
108+
ports:
109+
- "8088:8088"
110+
expose:
111+
- "9091"
112+
environment:
113+
- RUST_LOG=INFO
114+
- RUST_BACKTRACE=1
115+
volumes:
116+
- asap-planner-output:/asap-planner-output:ro
117+
- ./output/queryengine:/app/outputs
118+
command:
119+
- "--config=/asap-planner-output/inference_config.yaml"
120+
- "--streaming-config=/asap-planner-output/streaming_config.yaml"
121+
- "--prometheus-server=http://prometheus:9090"
122+
- "--prometheus-scrape-interval=1"
123+
- "--streaming-engine=precompute"
124+
- "--prometheus-remote-write-port=9091"
125+
- "--delete-existing-db"
126+
- "--log-level=INFO"
127+
- "--output-dir=/app/outputs"
128+
- "--query-language=PROMQL"
129+
- "--lock-strategy=per-key"
130+
- "--forward-unsupported-queries"
131+
healthcheck:
132+
test: ["CMD-SHELL", "curl -sf http://localhost:8088/api/v1/query?query=up || exit 1"]
133+
interval: 10s
134+
timeout: 5s
135+
retries: 10
136+
start_period: 15s
137+
depends_on:
138+
asap-planner-rs:
139+
condition: service_completed_successfully
140+
restart: no
141+
142+
#############################################################################
143+
# PATTERN-BASED FAKE EXPORTERS
144+
# Each exporter generates one pattern type with the 'pattern' label
145+
# All series within an exporter follow the same pattern shape with variation
146+
#############################################################################
147+
148+
# Constant values - baseline for comparison
149+
fake-exporter-constant:
150+
image: ghcr.io/projectasap/asap-fake-exporter:v0.2.0
151+
container_name: asap-fake-exporter-constant
152+
hostname: fake-exporter-constant
153+
networks:
154+
- asap-network
155+
expose:
156+
- "50000"
157+
command:
158+
- "--port=50000"
159+
- "--valuescale=1000"
160+
- "--dataset=constant"
161+
- "--num-labels=3"
162+
- "--num-values-per-label=30,30,30"
163+
- "--metric-type=gauge"
164+
- "--metric-name=sensor_reading"
165+
- "--label-names=region,service,host"
166+
- "--label-value-prefixes=region,svc,host"
167+
- "--add-pattern-label"
168+
restart: no
169+
170+
# Linear increasing - tests trend preservation
171+
fake-exporter-linear-up:
172+
image: ghcr.io/projectasap/asap-fake-exporter:v0.2.0
173+
container_name: asap-fake-exporter-linear-up
174+
hostname: fake-exporter-linear-up
175+
networks:
176+
- asap-network
177+
expose:
178+
- "50001"
179+
command:
180+
- "--port=50001"
181+
- "--valuescale=1000"
182+
- "--dataset=linear-up"
183+
- "--num-labels=3"
184+
- "--num-values-per-label=30,30,30"
185+
- "--metric-type=gauge"
186+
- "--metric-name=sensor_reading"
187+
- "--label-names=region,service,host"
188+
- "--label-value-prefixes=region,svc,host"
189+
- "--add-pattern-label"
190+
restart: no
191+
192+
# Linear decreasing - tests trend preservation
193+
fake-exporter-linear-down:
194+
image: ghcr.io/projectasap/asap-fake-exporter:v0.2.0
195+
container_name: asap-fake-exporter-linear-down
196+
hostname: fake-exporter-linear-down
197+
networks:
198+
- asap-network
199+
expose:
200+
- "50002"
201+
command:
202+
- "--port=50002"
203+
- "--valuescale=1000"
204+
- "--dataset=linear-down"
205+
- "--num-labels=3"
206+
- "--num-values-per-label=30,30,30"
207+
- "--metric-type=gauge"
208+
- "--metric-name=sensor_reading"
209+
- "--label-names=region,service,host"
210+
- "--label-value-prefixes=region,svc,host"
211+
- "--add-pattern-label"
212+
restart: no
213+
214+
# Sine wave - tests periodicity preservation
215+
fake-exporter-sine:
216+
image: ghcr.io/projectasap/asap-fake-exporter:v0.2.0
217+
container_name: asap-fake-exporter-sine
218+
hostname: fake-exporter-sine
219+
networks:
220+
- asap-network
221+
expose:
222+
- "50003"
223+
command:
224+
- "--port=50003"
225+
- "--valuescale=1000"
226+
- "--dataset=sine"
227+
- "--num-labels=3"
228+
- "--num-values-per-label=30,30,30"
229+
- "--num-values-per-label=30,30,30"
230+
- "--metric-type=gauge"
231+
- "--metric-name=sensor_reading"
232+
- "--label-names=region,service,host"
233+
- "--label-value-prefixes=region,svc,host"
234+
- "--add-pattern-label"
235+
restart: no
236+
237+
# Sine with noise - tests signal extraction / smoothing
238+
fake-exporter-sine-noise:
239+
image: ghcr.io/projectasap/asap-fake-exporter:v0.2.0
240+
container_name: asap-fake-exporter-sine-noise
241+
hostname: fake-exporter-sine-noise
242+
networks:
243+
- asap-network
244+
expose:
245+
- "50004"
246+
command:
247+
- "--port=50004"
248+
- "--valuescale=1000"
249+
- "--dataset=sine-noise"
250+
- "--num-labels=3"
251+
- "--num-values-per-label=30,30,30"
252+
- "--metric-type=gauge"
253+
- "--metric-name=sensor_reading"
254+
- "--label-names=region,service,host"
255+
- "--label-value-prefixes=region,svc,host"
256+
- "--add-pattern-label"
257+
restart: no
258+
259+
# Step function - tests edge preservation
260+
fake-exporter-step:
261+
image: ghcr.io/projectasap/asap-fake-exporter:v0.2.0
262+
container_name: asap-fake-exporter-step
263+
hostname: fake-exporter-step
264+
networks:
265+
- asap-network
266+
expose:
267+
- "50005"
268+
command:
269+
- "--port=50005"
270+
- "--valuescale=1000"
271+
- "--dataset=step"
272+
- "--num-labels=3"
273+
- "--num-values-per-label=30,30,30"
274+
- "--metric-type=gauge"
275+
- "--metric-name=sensor_reading"
276+
- "--label-names=region,service,host"
277+
- "--label-value-prefixes=region,svc,host"
278+
- "--add-pattern-label"
279+
restart: no
280+
281+
# Exponential growth - tests non-linear patterns
282+
fake-exporter-exp-up:
283+
image: ghcr.io/projectasap/asap-fake-exporter:v0.2.0
284+
container_name: asap-fake-exporter-exp-up
285+
hostname: fake-exporter-exp-up
286+
networks:
287+
- asap-network
288+
expose:
289+
- "50007"
290+
command:
291+
- "--port=50007"
292+
- "--valuescale=1000"
293+
- "--dataset=exp-up"
294+
- "--num-labels=3"
295+
- "--num-values-per-label=30,30,30"
296+
- "--metric-type=gauge"
297+
- "--metric-name=sensor_reading"
298+
- "--label-names=region,service,host"
299+
- "--label-value-prefixes=region,svc,host"
300+
- "--add-pattern-label"
301+
restart: no

0 commit comments

Comments
 (0)