Skip to content

Commit d7773a1

Browse files
committed
feat: persistent connections + improved connection handling
1 parent 3519de5 commit d7773a1

File tree

5 files changed

+241
-51
lines changed

5 files changed

+241
-51
lines changed

Cargo.lock

+44-33
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,23 @@ reconnect automatically, more features will be coming soon.
1111
Sample configuration for different services:
1212
```yaml
1313
- name: "jaeger-ui"
14-
# <deployment name>.<namespace>
14+
# <service name>.<namespace>
1515
target: "simple-query.observability"
1616
ports:
1717
local: 8686 # Same port as remote since it's the UI standard port
1818
remote: 16686 # Jaeger UI default port
1919
options:
2020
retry_interval: 5s
21-
max_retries: 30
21+
# Max retries is optional and can be ignored if persistent_connection is set to true (defaults to 3 if missing)
22+
# max_retries: 30
2223
health_check_interval: 10s
24+
# This is true by default and it ignores max_retries
25+
persistent_connection: false
2326
# local_dns:
2427
# enabled: true
2528
# hostname: "jaeger.localhost" # Optional (it doesn't work yet), if you want to access it through a nice local domain
29+
# Given the case that the service name matches the pod name then you don't need to use the pod_selector
30+
# to specify labels
2631
pod_selector:
2732
label: "app.kubernetes.io/instance=simple"
2833

config.yaml

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
- name: "jaeger-ui"
2-
# <deployment name>.<namespace>
2+
# <service name>.<namespace>
33
target: "simple-query.observability"
44
ports:
55
local: 8686 # Same port as remote since it's the UI standard port
@@ -8,6 +8,8 @@
88
retry_interval: 5s
99
max_retries: 30
1010
health_check_interval: 10s
11+
# This is true by default and ignores max_retries
12+
persistent_connection: false
1113
# local_dns:
1214
# enabled: true
1315
# hostname: "jaeger.localhost" # Optional (it doesn't work yet), if you want to access it through a nice local domain
@@ -21,8 +23,10 @@
2123
remote: 8080 # https
2224
options:
2325
retry_interval: 5s
24-
max_retries: 30
26+
# max_retries: 30
2527
health_check_interval: 10s
28+
# This is true by default and ignores max_retries
29+
persistent_connection: true
2630
# local_dns:
2731
# enabled: true
2832
# hostname: "argocd.localhost" # Optional (it doesn't work yet), if you want to access it through a nice local domain

src/config.rs

+6
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ pub struct ForwardOptions {
2626
pub retry_interval: Duration,
2727
#[serde(default = "default_max_retries")]
2828
pub max_retries: u32,
29+
#[serde(default = "default_persistent_connection")]
30+
pub persistent_connection: bool,
2931
#[serde(with = "humantime_serde", default = "default_health_check_interval")]
3032
pub health_check_interval: Duration,
3133
}
@@ -53,3 +55,7 @@ fn default_max_retries() -> u32 {
5355
fn default_health_check_interval() -> Duration {
5456
Duration::from_secs(10)
5557
}
58+
59+
fn default_persistent_connection() -> bool {
60+
true
61+
}

0 commit comments

Comments
 (0)