Skip to content

Commit c0fbf0a

Browse files
authored
Improve ProfileExporter API docs (#59)
After some discussion on the expected values for `profiling_library_name` on slack, I've decided to go ahead and document the current expectations alongside the API.
1 parent 18fa4a8 commit c0fbf0a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

profiling-ffi/src/exporter.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,16 @@ unsafe fn try_to_endpoint(endpoint: Endpoint) -> anyhow::Result<exporter::Endpoi
113113
}
114114
}
115115

116+
/// Creates a new exporter to be used to report profiling data.
117+
/// # Arguments
118+
/// * `profiling_library_name` - Profiling library name, usually dd-trace-something, e.g. "dd-trace-rb". See
119+
/// https://datadoghq.atlassian.net/wiki/spaces/PROF/pages/1538884229/Client#Header-values (Datadog internal link)
120+
/// for a list of common values.
121+
/// * `profliling_library_version` - Version used when publishing the profiling library to a package manager
122+
/// * `family` - Profile family, e.g. "ruby"
123+
/// * `tags` - Tags to include with every profile reported by this exporter. It's also possible to include
124+
/// profile-specific tags, see `additional_tags` on `profile_exporter_build`.
125+
/// * `endpoint` - Configuration for reporting data
116126
#[must_use]
117127
#[export_name = "ddog_ProfileExporter_new"]
118128
pub extern "C" fn profile_exporter_new(

profiling/src/exporter/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,16 @@ impl Request {
113113
}
114114

115115
impl ProfileExporter {
116+
/// Creates a new exporter to be used to report profiling data.
117+
/// # Arguments
118+
/// * `profiling_library_name` - Profiling library name, usually dd-trace-something, e.g. "dd-trace-rb". See
119+
/// https://datadoghq.atlassian.net/wiki/spaces/PROF/pages/1538884229/Client#Header-values (Datadog internal link)
120+
/// for a list of common values.
121+
/// * `profliling_library_version` - Version used when publishing the profiling library to a package manager
122+
/// * `family` - Profile family, e.g. "ruby"
123+
/// * `tags` - Tags to include with every profile reported by this exporter. It's also possible to include
124+
/// profile-specific tags, see `additional_tags` on `build`.
125+
/// * `endpoint` - Configuration for reporting data
116126
pub fn new<F, N, V>(
117127
profiling_library_name: N,
118128
profiling_library_version: V,

0 commit comments

Comments
 (0)