Skip to content

Commit b0578be

Browse files
committed
Update configuration files: change access_log values to use standardized formats and enhance routing matcher syntax
1 parent ab3a1c3 commit b0578be

File tree

11 files changed

+285
-119
lines changed

11 files changed

+285
-119
lines changed

bench/config/standalone/pavis.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ telemetry:
77
level: "warn"
88
pingora: "error"
99
service_name: "pavis-benchmark"
10-
access_log: false
10+
access_log: Disabled
1111
metrics: "0.0.0.0:9090"
1212

1313
upstreams:

bench/config/system/pavis/pavis.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ telemetry:
77
level: "warn"
88
pingora: "error"
99
service_name: "pavis-benchmark"
10-
access_log: false
10+
access_log: Disabled
1111
metrics: "0.0.0.0:9090"
1212

1313
upstreams:

bench/config/system/pavis/relay-configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ data:
6464
level: "warn"
6565
pingora: "error"
6666
service_name: "pavis-benchmark"
67-
access_log: false
67+
access_log: Disabled
6868
metrics: "0.0.0.0:9090"
6969
7070
upstreams:
Lines changed: 57 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,55 @@
1-
server:
2-
listen_addr: "0.0.0.0:8080"
3-
# worker_threads: 4
4-
# tls:
5-
# enabled: true
6-
# cert_path: "/path/to/cert.pem"
7-
# key_path: "/path/to/key.pem"
1+
listeners:
2+
- name: "default"
3+
address: "0.0.0.0:8080"
4+
# workers: 4
5+
# tls:
6+
# cert_path: "/path/to/cert.pem"
7+
# key_path: "/path/to/key.pem"
8+
# client_auth:
9+
# required:
10+
# ca_path: "/path/to/ca.pem"
811

912
telemetry:
1013
level: "debug"
1114
pingora: "warn"
12-
access_log: "stdout" # Options: stdout (default), false, or file path
13-
# service_name: "pavis-proxy" # Not supported yet
14-
# prometheus_addr: "0.0.0.0:9090" # Not supported yet
15-
# tracing: # Not supported yet
16-
# enabled: true
17-
# provider: "opentelemetry"
18-
# sampling_rate: 1.0
15+
service_name: "pavis-proxy"
16+
metrics: "0.0.0.0:9090"
17+
access_log: Stdout
18+
# tracing:
19+
# provider: "otlp"
20+
# sampling: 100
21+
# endpoint: "http://localhost:4317"
22+
23+
shutdown:
24+
enabled: true
25+
drain_timeout_ms: 30000
26+
27+
admin:
28+
enabled: false
29+
address: "127.0.0.1:9901"
30+
31+
features:
32+
routing:
33+
advanced_matchers: false
34+
regex_limits: {}
1935

2036
upstreams:
2137
- name: "backend-v1"
22-
lb: "round-robin" # Options: random, round-robin (default)
23-
http: "h1" # Options: h1 (default), h2, h2h1
38+
balancer: "round-robin" # Options: round-robin, random, least-request
39+
protocol: "h1" # Options: h1, h2, h2h1
2440
pool:
25-
idle_timeout: "60s" # Keep connections alive for 60s (default)
26-
connection_timeout: "5s" # Connection timeout (default: 5s)
41+
idle: "60s" # Default: 60s
42+
connect: "5s" # Default: 5s
43+
# max: 128
44+
queue_capacity: 0
45+
queue_timeout_ms: 0
2746
# tls:
2847
# enabled: true
2948
# verify_cert: true
3049
# verify_hostname: true
3150
# sni_mode: auto
3251
# # sni: "backend.example.com"
33-
# #
34-
# # OpenSSL is the only supported TLS backend; these options are enforced:
35-
# # ca_bundle_path: "/etc/pavis/certs/upstream-ca.pem"
52+
# # ca_bundle_path: "/etc/pavis/certs/upstream-ca.pem" # Ignored by Rustls backend
3653
# # cert:
3754
# # cert_path: "/etc/pavis/certs/client.crt"
3855
# # key_path: "/etc/pavis/certs/client.key"
@@ -51,42 +68,43 @@ upstreams:
5168
# healthy_threshold: 1
5269
# unhealthy_threshold: 1
5370
endpoints:
54-
- ip: "127.0.0.1"
71+
- address: "127.0.0.1"
5572
port: 8081
5673
weight: 1
5774

5875
- name: "backend-v2"
59-
lb: "random"
60-
http: "h2"
76+
balancer: "random"
77+
protocol: "h2"
6178
endpoints:
62-
- ip: "127.0.0.1"
79+
- address: "127.0.0.1"
6380
port: 8082
6481
weight: 1
6582

6683
routes:
6784
- host: "backend"
6885
paths:
69-
- match_type: "prefix" # Options: prefix (default), exact, regex
70-
path: "/api/v1"
71-
# timeout: "2s" # Not supported yet
72-
# retry: # Not supported yet
73-
# attempts: 3
74-
# retry_on: [500, 502, 503, "gateway_error", "connect_failure"]
75-
# per_try_timeout: "500ms"
86+
- matcher:
87+
path: !prefix { path: "/api/v1" }
88+
# timeout: "2s"
89+
# retry:
90+
# max_attempts: 3
91+
# retryable_reasons: ["status_code", "connect_error"]
92+
# retryable_status_codes: [502, 503, 504]
93+
# per_try: "500ms"
7694
request_headers:
77-
add:
78-
x-sidecar-proxy: "pavis"
79-
remove:
95+
add_headers:
96+
- ["x-sidecar-proxy", "pavis"]
97+
remove_headers:
8098
- "x-internal-token"
8199
response_headers:
82-
add:
83-
x-served-by: "pavis"
100+
add_headers:
101+
- ["x-served-by", "pavis"]
84102
destinations:
85103
- upstream: "backend-v1"
86104
weight: 100
87105

88-
- match_type: "prefix"
89-
path: "/api/v2"
106+
- matcher:
107+
path: !prefix { path: "/api/v2" }
90108
destinations:
91109
- upstream: "backend-v2"
92110
weight: 100

crates/pavis/config.yaml

Lines changed: 51 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,92 @@
1-
server:
2-
listen_addr: "0.0.0.0:8080"
3-
# worker_threads: 4
4-
# tls:
5-
# enabled: true
6-
# cert_path: "/path/to/cert.pem"
7-
# key_path: "/path/to/key.pem"
1+
listeners:
2+
- name: "default"
3+
address: "0.0.0.0:8080"
4+
# workers: 4
5+
# tls:
6+
# cert_path: "/path/to/cert.pem"
7+
# key_path: "/path/to/key.pem"
8+
# client_auth:
9+
# required:
10+
# ca_path: "/path/to/ca.pem"
811

912
telemetry:
1013
level: "debug"
1114
pingora: "warn"
12-
access_log: "stdout" # Options: stdout (default), false, or file path
15+
service_name: "pavis-proxy"
16+
metrics: "0.0.0.0:9090"
17+
access_log: Stdout
18+
# tracing:
19+
# provider: "otlp"
20+
# sampling: 100
21+
# endpoint: "http://localhost:4317"
22+
23+
shutdown:
24+
enabled: true
25+
drain_timeout_ms: 30000
26+
27+
admin:
28+
enabled: false
29+
address: "127.0.0.1:9901"
30+
31+
features:
32+
routing:
33+
advanced_matchers: false
34+
regex_limits: {}
1335

1436
upstreams:
1537
- name: "backend-v1"
16-
lb: "round-robin" # Options: random, round-robin (default)
17-
http: "h1" # Options: h1 (default), h2, h2h1
38+
balancer: "round-robin" # Options: round-robin, random, least-request
39+
protocol: "h1" # Options: h1, h2, h2h1
1840
pool:
19-
idle_timeout: "60s" # Keep connections alive for 60s (default)
20-
connection_timeout: "5s" # Connection timeout (default: 5s)
41+
idle: "60s" # Default: 60s
42+
connect: "5s" # Default: 5s
43+
# max: 128
44+
queue_capacity: 0
45+
queue_timeout_ms: 0
2146
# tls:
2247
# enabled: true
2348
# verify_cert: true
2449
# verify_hostname: true
2550
# sni_mode: auto
2651
# # sni: "backend.example.com"
27-
# #
28-
# # OpenSSL is the only supported TLS backend; these options are enforced:
29-
# # ca_bundle_path: "/etc/pavis/certs/upstream-ca.pem"
52+
# # ca_bundle_path: "/etc/pavis/certs/upstream-ca.pem" # Ignored by Rustls backend
3053
# # cert:
3154
# # cert_path: "/etc/pavis/certs/client.crt"
3255
# # key_path: "/etc/pavis/certs/client.key"
3356
# # chain_mode: "none" # none | embedded | file
3457
# # chain_path: "/etc/pavis/certs/client-chain.pem"
3558
endpoints:
36-
- ip: "127.0.0.1"
59+
- address: "127.0.0.1"
3760
port: 8081
3861
weight: 1
3962

4063
- name: "backend-v2"
41-
lb: "random"
42-
http: "h2"
64+
balancer: "random"
65+
protocol: "h2"
4366
endpoints:
44-
- ip: "127.0.0.1"
67+
- address: "127.0.0.1"
4568
port: 8082
4669
weight: 1
4770

4871
routes:
4972
- host: "backend"
5073
paths:
51-
- match_type: "prefix" # Options: prefix (default), exact, regex
52-
path: "/api/v1"
74+
- matcher:
75+
path: !prefix { path: "/api/v1" }
5376
request_headers:
54-
add:
55-
x-sidecar-proxy: "pavis"
56-
remove:
77+
add_headers:
78+
- ["x-sidecar-proxy", "pavis"]
79+
remove_headers:
5780
- "x-internal-token"
5881
response_headers:
59-
add:
60-
x-served-by: "pavis"
82+
add_headers:
83+
- ["x-served-by", "pavis"]
6184
destinations:
6285
- upstream: "backend-v1"
6386
weight: 100
6487

65-
- match_type: "prefix"
66-
path: "/api/v2"
88+
- matcher:
89+
path: !prefix { path: "/api/v2" }
6790
destinations:
6891
- upstream: "backend-v2"
6992
weight: 100

docs/configuration/examples/full-surface.yaml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,32 @@ telemetry:
77
pingora: "info"
88
service_name: "pavis-full-example"
99
metrics: "0.0.0.0:9090" # Alias: prometheus_addr
10-
access_log: "stdout" # stdout, disabled, or file path
10+
access_log: Stdout # Stdout, Disabled, or File: "/path"
1111
tracing:
1212
provider: "otlp" # otlp, jaeger, zipkin
1313
sampling: 100 # 0-100
1414
endpoint: "http://localhost:4317"
1515

16+
# Global lifecycle controls
17+
shutdown:
18+
enabled: true
19+
drain_timeout_ms: 30000
20+
21+
admin:
22+
enabled: false
23+
address: "127.0.0.1:9901"
24+
25+
# Feature flags and limits
26+
features:
27+
routing:
28+
advanced_matchers: false
29+
regex_limits:
30+
pattern_max_bytes: 256
31+
size_limit_bytes: 10485760
32+
input_max_bytes: 4096
33+
max_regex_per_route: 10
34+
max_regex_per_config: 100
35+
1636
# Inbound entry points
1737
listeners:
1838
- name: "http"
@@ -37,10 +57,9 @@ upstreams:
3757
pool:
3858
idle: "1m" # humantime format
3959
connect: "10s"
40-
max: 500 # Required, no unlimited pools (P0 enforcement)
41-
queue:
42-
capacity: 10 # Max requests to queue when pool is full
43-
timeout_ms: 1000 # Queue wait timeout in milliseconds
60+
max: 500 # Optional, defaults to 128 (no unlimited pools)
61+
queue_capacity: 10 # Max requests to queue when pool is full
62+
queue_timeout_ms: 1000 # Queue wait timeout in milliseconds
4463
tls:
4564
enabled: true
4665
verify_cert: true
@@ -125,14 +144,14 @@ routes:
125144
- upstream: "backend-cluster-1"
126145
weight: 1
127146

128-
- matcher: !exact
129-
path: "/ping"
147+
- matcher:
148+
path: !exact { path: "/ping" }
130149
status: 200
131150
body: "pong"
132151

133152
- host: "legacy.example.com"
134153
paths:
135-
- matcher: !prefix
136-
path: "/"
154+
- matcher:
155+
path: !prefix { path: "/" }
137156
status: 301
138157
location: "https://app.example.com"
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
routes:
22
- host: "api.example.com"
33
paths:
4-
- matcher: !prefix
5-
path: "/v1"
4+
- matcher:
5+
path: !prefix { path: "/v1" }
66
rewrite:
77
path: "/"
88
request_headers:
@@ -11,17 +11,17 @@ routes:
1111
destinations:
1212
- upstream: "api-v1"
1313
weight: 1
14-
- matcher: !exact
15-
path: "/health"
14+
- matcher:
15+
path: !exact { path: "/health" }
1616
status: 200
1717
body: "Healthy"
18-
- matcher: !regex
19-
path: "^/v[0-9]/legacy"
18+
- matcher:
19+
path: !regex { path: "^/v[0-9]/legacy" }
2020
status: 302
2121
location: "/v1/new-api"
2222

2323
upstreams:
2424
- name: "api-v1"
2525
endpoints:
2626
- address: "10.0.0.1"
27-
port: 80
27+
port: 80

0 commit comments

Comments
 (0)