Skip to content

Commit 2e71911

Browse files
committed
[exporter/signalfx] enabled http2 healthcheck
Signed-off-by: Dani Louca <[email protected]>
1 parent b4ee0b4 commit 2e71911

File tree

4 files changed

+53
-14
lines changed

4 files changed

+53
-14
lines changed

.chloggen/sfx-exporter-http2.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: signalfxexporter
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Enable HTTP/2 health check by default
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [29716]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: []

exporter/signalfxexporter/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ The following configuration options can also be configured:
8686
defined in `translation/constants.go`.
8787
- `timeout` (default = 10s): Amount of time to wait for a send operation to
8888
complete.
89+
- `http2_read_idle_timeout` (default = 10s): Send a ping frame for a health check if the connection has been idle for the configured value.
90+
0s means http/2 health check will be disabled.
91+
- `http2_ping_timeout` (default = 10s): Triggered by `http2_read_idle_timeout`; When there's no response to the ping within the configured value,
92+
the connection will be closed. If this value is set to 0, it will default to 15s.
8993
- `headers` (no default): Headers to pass in the payload.
9094
- `max_idle_conns` (default = 100): The maximum idle HTTP connections the client can keep open.
9195
- `max_idle_conns_per_host` (default = 100): The maximum idle HTTP connections the client can keep open per host.

exporter/signalfxexporter/config_test.go

+12-8
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,13 @@ func TestLoadConfig(t *testing.T) {
4848
AccessToken: "testToken",
4949
Realm: "ap0",
5050
HTTPClientSettings: confighttp.HTTPClientSettings{
51-
Timeout: 10 * time.Second,
52-
Headers: nil,
53-
MaxIdleConns: &hundred,
54-
MaxIdleConnsPerHost: &hundred,
55-
IdleConnTimeout: &idleConnTimeout,
51+
Timeout: 10 * time.Second,
52+
Headers: nil,
53+
MaxIdleConns: &hundred,
54+
MaxIdleConnsPerHost: &hundred,
55+
IdleConnTimeout: &idleConnTimeout,
56+
HTTP2ReadIdleTimeout: 10 * time.Second,
57+
HTTP2PingTimeout: 10 * time.Second,
5658
},
5759
RetrySettings: exporterhelper.RetrySettings{
5860
Enabled: true,
@@ -114,9 +116,11 @@ func TestLoadConfig(t *testing.T) {
114116
"added-entry": "added value",
115117
"dot.test": "test",
116118
},
117-
MaxIdleConns: &seventy,
118-
MaxIdleConnsPerHost: &seventy,
119-
IdleConnTimeout: &idleConnTimeout,
119+
MaxIdleConns: &seventy,
120+
MaxIdleConnsPerHost: &seventy,
121+
IdleConnTimeout: &idleConnTimeout,
122+
HTTP2ReadIdleTimeout: 10 * time.Second,
123+
HTTP2PingTimeout: 10 * time.Second,
120124
},
121125
RetrySettings: exporterhelper.RetrySettings{
122126
Enabled: true,

exporter/signalfxexporter/factory.go

+10-6
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ import (
2222
)
2323

2424
const (
25-
defaultHTTPTimeout = time.Second * 10
26-
defaultMaxConns = 100
25+
defaultHTTPTimeout = time.Second * 10
26+
defaultHTTP2ReadIdleTimeout = time.Second * 10
27+
defaultHTTP2PingTimeout = time.Second * 10
28+
defaultMaxConns = 100
2729

2830
defaultDimMaxBuffered = 10000
2931
defaultDimSendDelay = 10 * time.Second
@@ -52,10 +54,12 @@ func createDefaultConfig() component.Config {
5254
RetrySettings: exporterhelper.NewDefaultRetrySettings(),
5355
QueueSettings: exporterhelper.NewDefaultQueueSettings(),
5456
HTTPClientSettings: confighttp.HTTPClientSettings{
55-
Timeout: defaultHTTPTimeout,
56-
MaxIdleConns: &maxConnCount,
57-
MaxIdleConnsPerHost: &maxConnCount,
58-
IdleConnTimeout: &idleConnTimeout,
57+
Timeout: defaultHTTPTimeout,
58+
MaxIdleConns: &maxConnCount,
59+
MaxIdleConnsPerHost: &maxConnCount,
60+
IdleConnTimeout: &idleConnTimeout,
61+
HTTP2ReadIdleTimeout: defaultHTTP2ReadIdleTimeout,
62+
HTTP2PingTimeout: defaultHTTP2PingTimeout,
5963
},
6064
AccessTokenPassthroughConfig: splunk.AccessTokenPassthroughConfig{
6165
AccessTokenPassthrough: true,

0 commit comments

Comments
 (0)