1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Copyright 2025-Present Datadog, Inc. https://www.datadoghq.com/
// SPDX-License-Identifier: Apache-2.0
//! Memory allocation sampling.
//!
//! Opt in by declaring [`SampledAllocator`] as your process's
//! `#[global_allocator]`:
//!
//! ```no_run
//! use datadog_opentelemetry::memory_profiling::SampledAllocator;
//! use std::alloc::System;
//!
//! #[global_allocator]
//! static ALLOC: SampledAllocator<System> = SampledAllocator::<System>::DEFAULT;
//!
//! datadog_opentelemetry::memory_profiling().init();
//! ```
//!
//! This crate only emits sampled allocation events; it does not collect or
//! export them. Run an out-of-process profiler such as
//! [`datadog-agent`](https://github.com/DataDog/datadog-agent)
//! alongside the instrumented process to collect and ship samples to
//! Datadog.
pub use SampledAllocator;
/// Builder for enabling memory allocation sampling.
/// Starts building a memory profiling configuration.