Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add keep alive params to grpc server #1858

Merged
merged 5 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions common/config/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/goccy/go-yaml"
"github.com/odigos-io/odigos/common"
"github.com/odigos-io/odigos/common/consts"
)

const (
Expand Down Expand Up @@ -151,6 +152,13 @@ func getBasicConfig(memoryLimiterConfig GenericMap) (*Config, []string) {
// setting it to a large value to avoid dropping batches.
"max_recv_msg_size_mib": 128,
"endpoint": "0.0.0.0:4317",
// The Node Collector opens a gRPC stream to send data. This ensures that the Node Collector establishes a new connection when the Gateway scales up to include additional instances.
"keepalive": GenericMap{
"server_parameters": GenericMap{
"max_connection_age": consts.GatewayMaxConnectionAge,
"max_connection_age_grace": consts.GatewayMaxConnectionAgeGrace,
},
},
},
// Node collectors send in gRPC, so this is probably not needed
"http": GenericMap{
Expand Down
4 changes: 4 additions & 0 deletions common/config/testdata/debugexporter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ receivers:
protocols:
grpc:
endpoint: 0.0.0.0:4317
keepalive:
server_parameters:
max_connection_age: 15s
max_connection_age_grace: 2s
max_recv_msg_size_mib: 128
http:
endpoint: 0.0.0.0:4318
Expand Down
4 changes: 4 additions & 0 deletions common/config/testdata/minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ receivers:
protocols:
grpc:
endpoint: 0.0.0.0:4317
keepalive:
server_parameters:
max_connection_age: 15s
max_connection_age_grace: 2s
max_recv_msg_size_mib: 128
http:
endpoint: 0.0.0.0:4318
Expand Down
4 changes: 4 additions & 0 deletions common/consts/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ const (
InstrumentationDisabled = "disabled"
OdigosReportedNameAnnotation = "odigos.io/reported-name"

// GatewayMaxConnectionAge and GatewayMaxConnectionAgeGrace are the default values for the gateway collector.
GatewayMaxConnectionAge = "15s"
GatewayMaxConnectionAgeGrace = "2s"

// Used to store the original value of the environment variable in the pod manifest.
// This is used to restore the original value when an instrumentation is removed
// or odigos is uninstalled.
Expand Down
Loading