-
Notifications
You must be signed in to change notification settings - Fork 16
Svls 6036 respect timeouts #537
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
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 |
|---|---|---|
| @@ -1,11 +1,22 @@ | ||
| // Copyright 2023-Present Datadog, Inc. https://www.datadoghq.com/ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| use crate::config; | ||
| use crate::tags::provider; | ||
| use crate::traces::span_pointers::{attach_span_pointers_to_meta, SpanPointer}; | ||
| use crate::traces::{ | ||
| AWS_XRAY_DAEMON_ADDRESS_URL_PREFIX, DNS_LOCAL_HOST_ADDRESS_URL_PREFIX, | ||
| DNS_NON_ROUTABLE_ADDRESS_URL_PREFIX, INVOCATION_SPAN_RESOURCE, LAMBDA_EXTENSION_URL_PREFIX, | ||
| LAMBDA_RUNTIME_URL_PREFIX, LAMBDA_STATSD_URL_PREFIX, | ||
| }; | ||
| use datadog_trace_obfuscation::obfuscate::obfuscate_span; | ||
| use datadog_trace_obfuscation::obfuscation_config; | ||
| use datadog_trace_protobuf::pb; | ||
| use datadog_trace_protobuf::pb::Span; | ||
| use datadog_trace_utils::config_utils::trace_intake_url; | ||
| use datadog_trace_utils::send_data::{RetryBackoffType, RetryStrategy}; | ||
| use datadog_trace_utils::trace_utils::SendData; | ||
| use datadog_trace_utils::trace_utils::{self}; | ||
| use datadog_trace_utils::tracer_header_tags; | ||
| use datadog_trace_utils::tracer_payload::{ | ||
| TraceChunkProcessor, TraceCollection::V07, TracerPayloadCollection, | ||
|
|
@@ -14,16 +25,6 @@ use ddcommon::Endpoint; | |
| use std::str::FromStr; | ||
| use std::sync::Arc; | ||
|
|
||
| use crate::config; | ||
| use crate::traces::{ | ||
| AWS_XRAY_DAEMON_ADDRESS_URL_PREFIX, DNS_LOCAL_HOST_ADDRESS_URL_PREFIX, | ||
| DNS_NON_ROUTABLE_ADDRESS_URL_PREFIX, INVOCATION_SPAN_RESOURCE, LAMBDA_EXTENSION_URL_PREFIX, | ||
| LAMBDA_RUNTIME_URL_PREFIX, LAMBDA_STATSD_URL_PREFIX, | ||
| }; | ||
| use datadog_trace_obfuscation::obfuscate::obfuscate_span; | ||
| use datadog_trace_protobuf::pb::Span; | ||
| use datadog_trace_utils::trace_utils::{self, SendData}; | ||
|
|
||
| #[derive(Clone)] | ||
| #[allow(clippy::module_name_repetitions)] | ||
| pub struct ServerlessTraceProcessor { | ||
|
|
@@ -161,11 +162,18 @@ impl TraceProcessor for ServerlessTraceProcessor { | |
| let endpoint = Endpoint { | ||
| url: hyper::Uri::from_str(&intake_url).expect("can't parse trace intake URL, exiting"), | ||
| api_key: Some(self.resolved_api_key.clone().into()), | ||
| timeout_ms: Endpoint::DEFAULT_TIMEOUT, | ||
| timeout_ms: config.flush_timeout * 1_000, | ||
| test_token: None, | ||
| }; | ||
|
|
||
| SendData::new(body_size, payload, header_tags, &endpoint) | ||
| let mut send_data = SendData::new(body_size, payload, header_tags, &endpoint); | ||
| send_data.set_retry_strategy(RetryStrategy::new( | ||
| 1, | ||
| 100, | ||
|
Comment on lines
+171
to
+172
Contributor
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. Magic numbers
Contributor
Author
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. they come from defaults here
Contributor
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. can't you just create it once and clone it another place? |
||
| RetryBackoffType::Exponential, | ||
| None, | ||
| )); | ||
| send_data | ||
| } | ||
| } | ||
|
|
||
|
|
||
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.
What if flush_timeout is not set? Do we have a default?
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.
it should, it's not an Option
also
https://github.com/DataDog/datadog-lambda-extension/blob/main/bottlecap/src/config/mod.rs#L132
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 don't see the
DD_FLUSH_TIMEOUTorflush_timeoutoption in the datadog agent, where does this come from?