Skip to content

Commit

Permalink
feat: persistent connections + improved connection handling
Browse files Browse the repository at this point in the history
  • Loading branch information
kainlite committed Jan 17, 2025
1 parent 3519de5 commit d7773a1
Show file tree
Hide file tree
Showing 5 changed files with 241 additions and 51 deletions.
77 changes: 44 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,23 @@ reconnect automatically, more features will be coming soon.
Sample configuration for different services:
```yaml
- name: "jaeger-ui"
# <deployment name>.<namespace>
# <service name>.<namespace>
target: "simple-query.observability"
ports:
local: 8686 # Same port as remote since it's the UI standard port
remote: 16686 # Jaeger UI default port
options:
retry_interval: 5s
max_retries: 30
# Max retries is optional and can be ignored if persistent_connection is set to true (defaults to 3 if missing)
# max_retries: 30
health_check_interval: 10s
# This is true by default and it ignores max_retries
persistent_connection: false
# local_dns:
# enabled: true
# hostname: "jaeger.localhost" # Optional (it doesn't work yet), if you want to access it through a nice local domain
# Given the case that the service name matches the pod name then you don't need to use the pod_selector
# to specify labels
pod_selector:
label: "app.kubernetes.io/instance=simple"

Expand Down
8 changes: 6 additions & 2 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- name: "jaeger-ui"
# <deployment name>.<namespace>
# <service name>.<namespace>
target: "simple-query.observability"
ports:
local: 8686 # Same port as remote since it's the UI standard port
Expand All @@ -8,6 +8,8 @@
retry_interval: 5s
max_retries: 30
health_check_interval: 10s
# This is true by default and ignores max_retries
persistent_connection: false
# local_dns:
# enabled: true
# hostname: "jaeger.localhost" # Optional (it doesn't work yet), if you want to access it through a nice local domain
Expand All @@ -21,8 +23,10 @@
remote: 8080 # https
options:
retry_interval: 5s
max_retries: 30
# max_retries: 30
health_check_interval: 10s
# This is true by default and ignores max_retries
persistent_connection: true
# local_dns:
# enabled: true
# hostname: "argocd.localhost" # Optional (it doesn't work yet), if you want to access it through a nice local domain
Expand Down
6 changes: 6 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ pub struct ForwardOptions {
pub retry_interval: Duration,
#[serde(default = "default_max_retries")]
pub max_retries: u32,
#[serde(default = "default_persistent_connection")]
pub persistent_connection: bool,
#[serde(with = "humantime_serde", default = "default_health_check_interval")]
pub health_check_interval: Duration,
}
Expand Down Expand Up @@ -53,3 +55,7 @@ fn default_max_retries() -> u32 {
fn default_health_check_interval() -> Duration {
Duration::from_secs(10)
}

fn default_persistent_connection() -> bool {
true
}
Loading

0 comments on commit d7773a1

Please sign in to comment.