-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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/datadogexporter] Rely on http.Client's timeout instead of in exporterhelper's #6414
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -25,6 +25,7 @@ import ( | |||||||||||
"github.com/DataDog/datadog-agent/pkg/trace/exportable/stats" | ||||||||||||
"github.com/gogo/protobuf/proto" | ||||||||||||
"go.opentelemetry.io/collector/component" | ||||||||||||
"go.opentelemetry.io/collector/exporter/exporterhelper" | ||||||||||||
|
||||||||||||
"github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter/internal/utils" | ||||||||||||
) | ||||||||||||
|
@@ -45,19 +46,18 @@ type traceEdgeConnectionImpl struct { | |||||||||||
} | ||||||||||||
|
||||||||||||
const ( | ||||||||||||
traceEdgeTimeout time.Duration = 10 * time.Second | ||||||||||||
traceEdgeRetryInterval time.Duration = 10 * time.Second | ||||||||||||
) | ||||||||||||
|
||||||||||||
// createTraceEdgeConnection returns a new traceEdgeConnection | ||||||||||||
func createTraceEdgeConnection(rootURL, apiKey string, buildInfo component.BuildInfo) traceEdgeConnection { | ||||||||||||
func createTraceEdgeConnection(rootURL, apiKey string, buildInfo component.BuildInfo, settings exporterhelper.TimeoutSettings) traceEdgeConnection { | ||||||||||||
|
||||||||||||
return &traceEdgeConnectionImpl{ | ||||||||||||
traceURL: rootURL + "/api/v0.2/traces", | ||||||||||||
statsURL: rootURL + "/api/v0.2/stats", | ||||||||||||
buildInfo: buildInfo, | ||||||||||||
apiKey: apiKey, | ||||||||||||
client: utils.NewHTTPClient(traceEdgeTimeout), | ||||||||||||
client: utils.NewHTTPClient(settings), | ||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This changes the timeout value from 10 seconds to 15 seconds (if I read opentelemetry-collector-contrib/exporter/datadogexporter/factory.go Lines 49 to 53 in 77d48a5
defaulttimeoutSettings to return 10 seconds instead?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is fine (we care about the timeout of the batch processor for traces but that's about it, the timeout here should be fine no matter the value) |
||||||||||||
} | ||||||||||||
} | ||||||||||||
|
||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this be confusing if some exporters use this
TimeoutSettings
as the timeout setting for the entire operation where as other exporters use it per network call? This makes me think we should have a different configuration option for it. What do you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tried to use a pattern that is already used in the Collector in other exporters:
opentelemetry-collector-contrib/exporter/signalfxexporter/factory.go
Lines 121 to 122 in 243d642
opentelemetry-collector-contrib/exporter/lokiexporter/factory.go
Lines 71 to 72 in 243d642
opentelemetry-collector-contrib/exporter/splunkhecexporter/factory.go
Lines 105 to 106 in 243d642
opentelemetry-collector-contrib/exporter/observiqexporter/exporter.go
Lines 42 to 43 in 243d642
I would expect most users not to care about a global
Consume[Metrics/Traces/Logs]
function timeout (they don't even need to know that such a function exists to use the exporter). If we use different options I think we should have a wider conversation to have a consistent solution for all exporters that do this differently today.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I'm happy to approve this PR. It would be good to have that discussion if the pattern of disabling this timeout already happening, maybe the global timeout is less important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened open-telemetry/opentelemetry-collector#4497 to discuss this