Skip to content
Draft
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
2 changes: 1 addition & 1 deletion datadog-ipc/tarpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
//!
//! Lastly let's write our `main` that will start the server. While this example uses an
//! [in-process channel](transport::channel), tarpc also ships a generic [`serde_transport`]
//! behind the `serde-transport` feature, with additional [TCP](serde_transport::tcp) functionality
//! behind the `serde-transport` feature, with additional TCP functionality (`serde_transport::tcp`)
//! available behind the `tcp` feature.
//!
//! ```rust
Expand Down
2 changes: 1 addition & 1 deletion datadog-ipc/tarpc/src/server/tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl<T, S> TokioServerExecutor<T, S> {

/// A future that drives the server by [spawning](tokio::spawn) each [response
/// handler](super::InFlightRequest::execute) on tokio's default executor. Returned by
/// [`Channel::execute`](crate::server::Channel::execute).
/// [`Channel::execute`].
#[must_use]
#[pin_project]
#[derive(Debug)]
Expand Down
2 changes: 1 addition & 1 deletion datadog-remote-config/src/fetch/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ where
/// with a potentially incomplete configuration.
#[allow(clippy::type_complexity)]
inactive: Arc<Mutex<HashMap<Arc<RemoteConfigPath>, Arc<S::StoredFile>>>>,
/// times ConfigFetcher::<S>::fetch_once() is currently being run
/// times `ConfigFetcher::<S>::fetch_once`() is currently being run
run_id: Arc<RunnersGeneration>,
}

Expand Down
2 changes: 1 addition & 1 deletion datadog-sidecar-ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub struct NativeFile {
pub handle: Box<PlatformHandle<File>>,
}

/// This creates Rust PlatformHandle<File> from supplied C std FILE object.
/// This creates Rust `PlatformHandle<File>` from supplied C std FILE object.
/// This method takes the ownership of the underlying file descriptor.
///
/// # Safety
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
}
},
"SiCodes": {
"description": "See https://man7.org/linux/man-pages/man2/sigaction.2.html MUST REMAIN IN SYNC WITH THE ENUM IN emit_sigcodes.c",
"description": "See <https://man7.org/linux/man-pages/man2/sigaction.2.html> MUST REMAIN IN SYNC WITH THE ENUM IN emit_sigcodes.c",
"type": "string",
"enum": [
"BUS_ADRALN",
Expand Down Expand Up @@ -345,7 +345,7 @@
}
},
"SignalNames": {
"description": "See https://man7.org/linux/man-pages/man7/signal.7.html",
"description": "See <https://man7.org/linux/man-pages/man7/signal.7.html>",
"type": "string",
"enum": [
"SIGHUP",
Expand Down
2 changes: 1 addition & 1 deletion libdd-common-ffi/src/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl From<Error> for VoidResult {
}

/// A generic result type for when an operation may fail,
/// or may return <T> in case of success.
/// or may return `<T>` in case of success.
#[repr(C)]
pub enum Result<T> {
Ok(T),
Expand Down
4 changes: 2 additions & 2 deletions libdd-common-ffi/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::panic::{catch_unwind, AssertUnwindSafe};

/// Wraps a C-FFI function in standard form
/// Expects the function to return a result type that implements into and to be decorated with
/// #[named].
/// #\[named\].
#[macro_export]
macro_rules! wrap_with_ffi_result {
($body:block) => {{
Expand Down Expand Up @@ -34,7 +34,7 @@ macro_rules! wrap_with_ffi_result_no_catch {
}

/// Wraps a C-FFI function in standard form.
/// Expects the function to return a VoidResult and to be decorated with #[named].
/// Expects the function to return a VoidResult and to be decorated with #\[named\].
#[macro_export]
macro_rules! wrap_with_void_ffi_result {
($body:block) => {{
Expand Down
2 changes: 1 addition & 1 deletion libdd-common/src/connector/named_pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use std::path::{Path, PathBuf};

/// Windows Named Pipe
/// https://docs.microsoft.com/en-us/windows/win32/ipc/named-pipes
/// <https://docs.microsoft.com/en-us/windows/win32/ipc/named-pipes>
///
/// The form a windows named pipe path is either local to the computer:
/// \\.\pipe\pipename
Expand Down
8 changes: 4 additions & 4 deletions libdd-crashtracker-ffi/src/collector/spans.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub unsafe extern "C" fn ddog_crasht_clear_trace_ids() -> VoidResult {
/// Err() on failure. The most likely cause of failure is that the underlying set is full.
///
/// Note: 128 bit ints in FFI were not stabilized until Rust 1.77
/// https://blog.rust-lang.org/2024/03/30/i128-layout-update.html
/// <https://blog.rust-lang.org/2024/03/30/i128-layout-update.html>
/// We're currently locked into 1.76.0, have to do an ugly workaround involving 2 64 bit ints
/// until we can upgrade.
///
Expand Down Expand Up @@ -78,7 +78,7 @@ pub unsafe extern "C" fn ddog_crasht_insert_trace_id(id_high: u64, id_low: u64)
/// Err() on failure. The most likely cause of failure is that the underlying set is full.
///
/// Note: 128 bit ints in FFI were not stabilized until Rust 1.77
/// https://blog.rust-lang.org/2024/03/30/i128-layout-update.html
/// <https://blog.rust-lang.org/2024/03/30/i128-layout-update.html>
/// We're currently locked into 1.76.0, have to do an ugly workaround involving 2 64 bit ints
/// until we can upgrade.
///
Expand Down Expand Up @@ -108,7 +108,7 @@ pub unsafe extern "C" fn ddog_crasht_insert_span_id(id_high: u64, id_low: u64) -
/// be modified.
///
/// Note: 128 bit ints in FFI were not stabilized until Rust 1.77
/// https://blog.rust-lang.org/2024/03/30/i128-layout-update.html
/// <https://blog.rust-lang.org/2024/03/30/i128-layout-update.html>
/// We're currently locked into 1.76.0, have to do an ugly workaround involving 2 64 bit ints
/// until we can upgrade.
///
Expand Down Expand Up @@ -142,7 +142,7 @@ pub unsafe extern "C" fn ddog_crasht_remove_span_id(
/// be modified.
///
/// Note: 128 bit ints in FFI were not stabilized until Rust 1.77
/// https://blog.rust-lang.org/2024/03/30/i128-layout-update.html
/// <https://blog.rust-lang.org/2024/03/30/i128-layout-update.html>
/// We're currently locked into 1.76.0, have to do an ugly workaround involving 2 64 bit ints
/// until we can upgrade.
///
Expand Down
4 changes: 2 additions & 2 deletions libdd-crashtracker/src/crash_info/sig_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct SigInfo {
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
#[allow(clippy::upper_case_acronyms, non_camel_case_types)]
#[repr(C)]
/// See https://man7.org/linux/man-pages/man7/signal.7.html
/// See <https://man7.org/linux/man-pages/man7/signal.7.html>
pub enum SignalNames {
SIGHUP,
SIGINT,
Expand Down Expand Up @@ -260,7 +260,7 @@ mod unix {
)]
#[allow(clippy::upper_case_acronyms, non_camel_case_types)]
#[repr(C)]
/// See https://man7.org/linux/man-pages/man2/sigaction.2.html
/// See <https://man7.org/linux/man-pages/man2/sigaction.2.html>
/// MUST REMAIN IN SYNC WITH THE ENUM IN emit_sigcodes.c
pub enum SiCodes {
BUS_ADRALN,
Expand Down
10 changes: 5 additions & 5 deletions libdd-data-pipeline/src/agent_info/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ mod fetcher;
static AGENT_INFO_CACHE: LazyLock<ArcSwapOption<schema::AgentInfo>> =
LazyLock::new(|| ArcSwapOption::new(None));

/// Returns the most recent [`AgentInfo`] cached globally.
/// Returns the most recent \[`AgentInfo`\] cached globally.
///
/// This function provides access to the latest [`AgentInfo`] that has been
/// This function provides access to the latest \[`AgentInfo`\] that has been
/// fetched from the Datadog Agent's `/info` endpoint by the [`AgentInfoFetcher`].
/// The [`AgentInfo`] is stored in a global static cache that persists across thread
/// The \[`AgentInfo`\] is stored in a global static cache that persists across thread
/// boundaries and process forks.
///
/// # Return Value
///
/// Returns `Some(Arc<AgentInfo>)` if an [`AgentInfo`] has been successfully
/// fetched at least once, or `None` if no [`AgentInfo`] is available yet.
/// Returns `Some(Arc<AgentInfo>)` if an \[`AgentInfo`\] has been successfully
/// fetched at least once, or `None` if no \[`AgentInfo`\] is available yet.
pub fn get_agent_info() -> Option<Arc<schema::AgentInfo>> {
AGENT_INFO_CACHE.load_full()
}
Expand Down
4 changes: 2 additions & 2 deletions libdd-ddsketch-ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ pub unsafe extern "C" fn ddog_ddsketch_encode(mut sketch: *mut Handle<DDSketch>)
}
}

/// Frees the memory allocated for a Vec<u8> returned by ddsketch functions.
/// Frees the memory allocated for a `Vec<u8>` returned by ddsketch functions.
///
/// # Safety
///
/// The vec parameter must be a valid Vec<u8> returned by this library.
/// The vec parameter must be a valid `Vec<u8>` returned by this library.
/// After being called, the vec will not point to valid memory.
#[no_mangle]
pub extern "C" fn ddog_Vec_U8_drop(_vec: ffi::Vec<u8>) {
Expand Down
10 changes: 5 additions & 5 deletions libdd-dogstatsd-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const QUEUE_SIZE: usize = 32 * 1024;

/// The `DogStatsDActionOwned` enum gathers the metric types that can be sent to the DogStatsD
/// server. This type takes ownership of the relevant data to support the sidecar better.
/// For documentation on the dogstatsd metric types: https://docs.datadoghq.com/metrics/types/?tab=count#metric-types
/// For documentation on the dogstatsd metric types: <https://docs.datadoghq.com/metrics/types/?tab=count#metric-types>
///
/// Originally I attempted to combine this type with `DogStatsDAction` but this GREATLY complicates
/// the types to the point of insanity. I was unable to come up with a satisfactory approach that
Expand All @@ -50,8 +50,8 @@ pub enum DogStatsDActionOwned {
#[allow(missing_docs)]
Histogram(String, f64, Vec<Tag>),
/// Cadence only support i64 type as value
/// but Golang implementation uses string (https://github.com/DataDog/datadog-go/blob/331d24832f7eac97b091efd696278fe2c4192b29/statsd/statsd.go#L230)
/// and PHP implementation uses float or string (https://github.com/DataDog/php-datadogstatsd/blob/0efdd1c38f6d3dd407efbb899ad1fd2e5cd18085/src/DogStatsd.php#L251)
/// but Golang implementation uses string (<https://github.com/DataDog/datadog-go/blob/331d24832f7eac97b091efd696278fe2c4192b29/statsd/statsd.go#L230>)
/// and PHP implementation uses float or string (<https://github.com/DataDog/php-datadogstatsd/blob/0efdd1c38f6d3dd407efbb899ad1fd2e5cd18085/src/DogStatsd.php#L251>)
Set(String, i64, Vec<Tag>),
}

Expand All @@ -68,8 +68,8 @@ pub enum DogStatsDAction<'a, T: AsRef<str>, V: IntoIterator<Item = &'a Tag>> {
#[allow(missing_docs)]
Histogram(T, f64, V),
/// Cadence only support i64 type as value
/// but Golang implementation uses string (https://github.com/DataDog/datadog-go/blob/331d24832f7eac97b091efd696278fe2c4192b29/statsd/statsd.go#L230)
/// and PHP implementation uses float or string (https://github.com/DataDog/php-datadogstatsd/blob/0efdd1c38f6d3dd407efbb899ad1fd2e5cd18085/src/DogStatsd.php#L251)
/// but Golang implementation uses string (<https://github.com/DataDog/datadog-go/blob/331d24832f7eac97b091efd696278fe2c4192b29/statsd/statsd.go#L230>)
/// and PHP implementation uses float or string (<https://github.com/DataDog/php-datadogstatsd/blob/0efdd1c38f6d3dd407efbb899ad1fd2e5cd18085/src/DogStatsd.php#L251>)
Set(T, i64, V),
}

Expand Down
2 changes: 1 addition & 1 deletion libdd-profiling-protobuf/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ unsafe impl Value for &str {
/// exceeding the protobuf 2 GiB limit.
///
/// A value of 0 means "no string" or "empty string" (they are synonymous).
/// cbindgen:field-names=[offset]
/// cbindgen:field-names=\[offset\]
#[repr(C)]
#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[cfg_attr(feature = "bolero", derive(bolero::generator::TypeGenerator))]
Expand Down
4 changes: 2 additions & 2 deletions libdd-profiling/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub struct Mapping<'a> {

/// The object this entry is loaded from. This can be a filename on
/// disk for the main binary and shared libraries, or virtual
/// abstractions like "[vdso]".
/// abstractions like "\[vdso\]".
pub filename: &'a str,

/// A string that uniquely identifies a particular program version
Expand Down Expand Up @@ -164,7 +164,7 @@ impl Label<'_> {

#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Sample<'a> {
/// The leaf is at locations[0].
/// The leaf is at locations\[0\].
pub locations: Vec<Location<'a>>,

/// The type and unit of each value is defined by the corresponding
Expand Down
2 changes: 1 addition & 1 deletion libdd-profiling/src/exporter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl ProfileExporter {
/// Creates a new exporter to be used to report profiling data.
/// # Arguments
/// * `profiling_library_name` - Profiling library name, usually dd-trace-something, e.g. "dd-trace-rb". See
/// https://datadoghq.atlassian.net/wiki/spaces/PROF/pages/1538884229/Client#Header-values (Datadog internal link)
/// <https://datadoghq.atlassian.net/wiki/spaces/PROF/pages/1538884229/Client#Header-values> (Datadog internal link)
/// for a list of common values.
/// * `profiling_library_version` - Version used when publishing the profiling library to a
/// package manager
Expand Down
2 changes: 1 addition & 1 deletion libdd-profiling/src/internal/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use super::*;

/// Represents a [pprof::Function] with some space-saving changes:
/// Represents a \[pprof::Function\] with some space-saving changes:
/// - The id is not stored on the struct. It's stored in the container that holds the struct.
/// - ids for linked objects use 32-bit numbers instead of 64 bit ones.
#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Hash, PartialOrd, Ord)]
Expand Down
2 changes: 1 addition & 1 deletion libdd-profiling/src/internal/location.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use super::*;

/// Represents a [pprof::Location] with some space-saving changes:
/// Represents a \[pprof::Location\] with some space-saving changes:
/// - The id is not stored on the struct. It's stored in the container that holds the struct.
/// - ids for linked objects use 32-bit numbers instead of 64 bit ones.
/// - in libdatadog, we always use 1 Line per Location, so this is directly inlined into the
Expand Down
4 changes: 2 additions & 2 deletions libdd-profiling/src/internal/mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use super::*;

/// Represents a [pprof::Mapping] with some space-saving changes:
/// Represents a \[pprof::Mapping\] with some space-saving changes:
/// - The id is not stored on the struct. It's stored in the container that holds the struct.
/// - ids for linked objects use 32-bit numbers instead of 64 bit ones.
#[derive(Eq, PartialEq, Hash)]
Expand All @@ -17,7 +17,7 @@ pub struct Mapping {

/// The object this entry is loaded from. This can be a filename on
/// disk for the main binary and shared libraries, or virtual
/// abstractions like "[vdso]".
/// abstractions like "\[vdso\]".
pub filename: StringId,

/// A string that uniquely identifies a particular program version
Expand Down
2 changes: 1 addition & 1 deletion libdd-profiling/src/internal/stack_trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use super::*;
#[derive(Eq, PartialEq, Hash)]
pub struct StackTrace {
/// The ids recorded here correspond to a Profile.location.id.
/// The leaf is at location_id[0].
/// The leaf is at location_id\[0\].
pub locations: Vec<LocationId>,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::ffi::c_void;
use std::ops::Deref;

/// A string set which can have parallel read and write operations.
/// This is a newtype wrapper around ParallelSliceSet<u8> that adds
/// This is a newtype wrapper around `ParallelSliceSet<u8>` that adds
/// string-specific functionality like well-known strings.
#[repr(transparent)]
pub struct ParallelStringSet {
Expand Down
2 changes: 1 addition & 1 deletion libdd-profiling/src/profiles/collections/string_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub const WELL_KNOWN_STRING_REFS: [StringRef; 5] = [
];

/// Holds unique strings and provides [`StringRef`]s to fetch them later.
/// This is a newtype around SliceSet<u8> to enforce UTF-8 invariants.
/// This is a newtype around `SliceSet<u8>` to enforce UTF-8 invariants.
pub struct UnsyncStringSet(SliceSet<u8>);

impl UnsyncStringSet {
Expand Down
2 changes: 1 addition & 1 deletion libdd-trace-obfuscation/src/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn is_quoted(bytes: &[u8], start: usize, end: usize) -> bool {
/// sensitive decision, contrary to the more exhaustive datadog-agent implementation.
///
/// based off
/// https://github.com/DataDog/dd-trace-java/blob/36e924eaa/internal-api/src/main/java/datadog/trace/api/normalize/SQLNormalizer.java
/// <https://github.com/DataDog/dd-trace-java/blob/36e924eaa/internal-api/src/main/java/datadog/trace/api/normalize/SQLNormalizer.java>
pub fn obfuscate_sql_string(s: &str) -> String {
let bytes = s.as_bytes();
let mut obfuscated = String::new();
Expand Down
1 change: 0 additions & 1 deletion libdd-trace-utils/src/send_with_retry/retry_strategy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use std::time::Duration;
use tokio::time::sleep;

/// Enum representing the type of backoff to use for the delay between retries.
/// ```
#[derive(Debug, Clone)]
#[cfg_attr(test, derive(PartialEq))]
pub enum RetryBackoffType {
Expand Down
4 changes: 2 additions & 2 deletions libdd-trace-utils/src/span/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl FromStr for SpanKey {
}

/// Trait representing the requirements for a type to be used as a Span "string" type.
/// Note: Borrow<str> is not required by the derived traits, but allows to access HashMap elements
/// Note: `Borrow<str>` is not required by the derived traits, but allows to access HashMap elements
/// from a static str and check if the string is empty.
pub trait SpanText: Eq + Hash + Borrow<str> + Serialize + Default {
fn from_static_str(value: &'static str) -> Self;
Expand Down Expand Up @@ -89,7 +89,7 @@ fn is_empty_str<T: Borrow<str>>(value: &T) -> bool {
///
/// `T` is the type used to represent strings in the span, it can be either owned (e.g. BytesString)
/// or borrowed (e.g. &str). To define a generic function taking any `Span<T>` you can use the
/// [`SpanValue`] trait:
/// [`SpanText`] trait:
/// ```
/// use libdd_trace_utils::span::{Span, SpanText};
/// fn foo<T: SpanText>(span: Span<T>) {
Expand Down
Loading