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

[exporter/signalfx] enabled http2 healthcheck #29716

Merged
merged 1 commit into from
Dec 11, 2023
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
27 changes: 27 additions & 0 deletions .chloggen/sfx-exporter-http2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: signalfxexporter

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Enable HTTP/2 health check by default

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
issues: [29716]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# If your change doesn't affect end users or the exported elements of any package,
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: []
4 changes: 4 additions & 0 deletions exporter/signalfxexporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ The following configuration options can also be configured:
defined in `translation/constants.go`.
- `timeout` (default = 10s): Amount of time to wait for a send operation to
complete.
- `http2_read_idle_timeout` (default = 10s): Send a ping frame for a health check if the connection has been idle for the configured value.
0s means http/2 health check will be disabled.
- `http2_ping_timeout` (default = 10s): Triggered by `http2_read_idle_timeout`; When there's no response to the ping within the configured value,
the connection will be closed. If this value is set to 0, it will default to 15s.
dloucasfx marked this conversation as resolved.
Show resolved Hide resolved
- `headers` (no default): Headers to pass in the payload.
- `max_idle_conns` (default = 100): The maximum idle HTTP connections the client can keep open.
- `max_idle_conns_per_host` (default = 100): The maximum idle HTTP connections the client can keep open per host.
Expand Down
20 changes: 12 additions & 8 deletions exporter/signalfxexporter/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,13 @@ func TestLoadConfig(t *testing.T) {
AccessToken: "testToken",
Realm: "ap0",
HTTPClientSettings: confighttp.HTTPClientSettings{
Timeout: 10 * time.Second,
Headers: nil,
MaxIdleConns: &hundred,
MaxIdleConnsPerHost: &hundred,
IdleConnTimeout: &idleConnTimeout,
Timeout: 10 * time.Second,
Headers: nil,
MaxIdleConns: &hundred,
MaxIdleConnsPerHost: &hundred,
IdleConnTimeout: &idleConnTimeout,
HTTP2ReadIdleTimeout: 10 * time.Second,
HTTP2PingTimeout: 10 * time.Second,
},
RetrySettings: exporterhelper.RetrySettings{
Enabled: true,
Expand Down Expand Up @@ -114,9 +116,11 @@ func TestLoadConfig(t *testing.T) {
"added-entry": "added value",
"dot.test": "test",
},
MaxIdleConns: &seventy,
MaxIdleConnsPerHost: &seventy,
IdleConnTimeout: &idleConnTimeout,
MaxIdleConns: &seventy,
MaxIdleConnsPerHost: &seventy,
IdleConnTimeout: &idleConnTimeout,
HTTP2ReadIdleTimeout: 10 * time.Second,
HTTP2PingTimeout: 10 * time.Second,
},
RetrySettings: exporterhelper.RetrySettings{
Enabled: true,
Expand Down
16 changes: 10 additions & 6 deletions exporter/signalfxexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ import (
)

const (
defaultHTTPTimeout = time.Second * 10
defaultMaxConns = 100
defaultHTTPTimeout = time.Second * 10
defaultHTTP2ReadIdleTimeout = time.Second * 10
defaultHTTP2PingTimeout = time.Second * 10
defaultMaxConns = 100

defaultDimMaxBuffered = 10000
defaultDimSendDelay = 10 * time.Second
Expand Down Expand Up @@ -52,10 +54,12 @@ func createDefaultConfig() component.Config {
RetrySettings: exporterhelper.NewDefaultRetrySettings(),
QueueSettings: exporterhelper.NewDefaultQueueSettings(),
HTTPClientSettings: confighttp.HTTPClientSettings{
Timeout: defaultHTTPTimeout,
MaxIdleConns: &maxConnCount,
MaxIdleConnsPerHost: &maxConnCount,
IdleConnTimeout: &idleConnTimeout,
Timeout: defaultHTTPTimeout,
MaxIdleConns: &maxConnCount,
MaxIdleConnsPerHost: &maxConnCount,
IdleConnTimeout: &idleConnTimeout,
HTTP2ReadIdleTimeout: defaultHTTP2ReadIdleTimeout,
HTTP2PingTimeout: defaultHTTP2PingTimeout,
},
AccessTokenPassthroughConfig: splunk.AccessTokenPassthroughConfig{
AccessTokenPassthrough: true,
Expand Down