libdatadog 6.0.0.2.0 → 9.0.0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/lib/libdatadog/version.rb +2 -2
  3. data/lib/libdatadog.rb +16 -0
  4. data/vendor/{libdatadog-6.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-9.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu}/LICENSE-3rdparty.yml +17283 -7448
  5. data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/bin/libdatadog-crashtracking-receiver +0 -0
  6. data/vendor/libdatadog-9.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/blazesym.h +895 -0
  7. data/vendor/{libdatadog-6.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-9.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu}/include/datadog/common.h +369 -42
  8. data/vendor/{libdatadog-6.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-9.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu}/include/datadog/profiling.h +293 -40
  9. data/vendor/libdatadog-9.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/telemetry.h +288 -0
  10. data/vendor/libdatadog-9.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
  11. data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/lib/pkgconfig/datadog_profiling_with_rpath.pc +2 -4
  12. data/vendor/{libdatadog-6.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-9.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl}/LICENSE-3rdparty.yml +17283 -7448
  13. data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/bin/libdatadog-crashtracking-receiver +0 -0
  14. data/vendor/libdatadog-9.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/blazesym.h +895 -0
  15. data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/common.h +369 -42
  16. data/vendor/{libdatadog-6.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-9.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl}/include/datadog/profiling.h +293 -40
  17. data/vendor/libdatadog-9.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/telemetry.h +288 -0
  18. data/vendor/libdatadog-9.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
  19. data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc +2 -4
  20. data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/LICENSE-3rdparty.yml +17283 -7448
  21. data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/bin/libdatadog-crashtracking-receiver +0 -0
  22. data/vendor/libdatadog-9.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/blazesym.h +895 -0
  23. data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/common.h +369 -42
  24. data/vendor/{libdatadog-6.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-9.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu}/include/datadog/profiling.h +293 -40
  25. data/vendor/libdatadog-9.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/telemetry.h +288 -0
  26. data/vendor/libdatadog-9.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
  27. data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/pkgconfig/datadog_profiling_with_rpath.pc +2 -4
  28. data/vendor/{libdatadog-6.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-9.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/LICENSE-3rdparty.yml +17283 -7448
  29. data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/bin/libdatadog-crashtracking-receiver +0 -0
  30. data/vendor/libdatadog-9.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/blazesym.h +895 -0
  31. data/vendor/{libdatadog-6.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-9.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/include/datadog/common.h +369 -42
  32. data/vendor/{libdatadog-6.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-9.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/include/datadog/profiling.h +293 -40
  33. data/vendor/libdatadog-9.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/telemetry.h +288 -0
  34. data/vendor/libdatadog-9.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
  35. data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc +2 -4
  36. metadata +42 -34
  37. data/vendor/libdatadog-6.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
  38. data/vendor/libdatadog-6.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
  39. data/vendor/libdatadog-6.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
  40. data/vendor/libdatadog-6.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
  41. /data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/LICENSE +0 -0
  42. /data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/NOTICE +0 -0
  43. /data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/LICENSE +0 -0
  44. /data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/NOTICE +0 -0
  45. /data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/LICENSE +0 -0
  46. /data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/NOTICE +0 -0
  47. /data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/LICENSE +0 -0
  48. /data/vendor/{libdatadog-6.0.0 → libdatadog-9.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/NOTICE +0 -0
@@ -1,5 +1,6 @@
1
- // Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
2
- // This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021-Present Datadog, Inc.
1
+ // Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
3
4
 
4
5
  #ifndef DDOG_COMMON_H
5
6
  #define DDOG_COMMON_H
@@ -10,13 +11,11 @@
10
11
  #include <stddef.h>
11
12
  #include <stdint.h>
12
13
 
13
- #if defined(_MSC_VER)
14
- #define DDOG_CHARSLICE_C(string) \
15
- /* NOTE: Compilation fails if you pass in a char* instead of a literal */ {.ptr = "" string, .len = sizeof(string) - 1}
16
- #else
17
14
  #define DDOG_CHARSLICE_C(string) \
18
15
  /* NOTE: Compilation fails if you pass in a char* instead of a literal */ ((ddog_CharSlice){ .ptr = "" string, .len = sizeof(string) - 1 })
19
- #endif
16
+
17
+ #define DDOG_CHARSLICE_C_BARE(string) \
18
+ /* NOTE: Compilation fails if you pass in a char* instead of a literal */ { .ptr = "" string, .len = sizeof(string) - 1 }
20
19
 
21
20
  #if defined __GNUC__
22
21
  # define DDOG_GNUC_VERSION(major) __GNUC__ >= major
@@ -84,6 +83,32 @@ typedef struct ddog_Slice_CChar {
84
83
  */
85
84
  typedef struct ddog_Slice_CChar ddog_CharSlice;
86
85
 
86
+ typedef enum ddog_Option_Error_Tag {
87
+ DDOG_OPTION_ERROR_SOME_ERROR,
88
+ DDOG_OPTION_ERROR_NONE_ERROR,
89
+ } ddog_Option_Error_Tag;
90
+
91
+ typedef struct ddog_Option_Error {
92
+ ddog_Option_Error_Tag tag;
93
+ union {
94
+ struct {
95
+ struct ddog_Error some;
96
+ };
97
+ };
98
+ } ddog_Option_Error;
99
+
100
+ typedef struct ddog_Option_Error ddog_MaybeError;
101
+
102
+ /**
103
+ * A wrapper for returning owned strings from FFI
104
+ */
105
+ typedef struct ddog_StringWrapper {
106
+ /**
107
+ * This is a String stuffed into the vec.
108
+ */
109
+ struct ddog_Vec_U8 message;
110
+ } ddog_StringWrapper;
111
+
87
112
  /**
88
113
  * Holds the raw parts of a Rust Vec; it should only be created from Rust,
89
114
  * never from C.
@@ -113,14 +138,10 @@ typedef struct ddog_Vec_Tag_ParseResult {
113
138
  struct ddog_Error *error_message;
114
139
  } ddog_Vec_Tag_ParseResult;
115
140
 
116
- typedef enum ddog_prof_CrashtrackerResolveFrames {
117
- DDOG_PROF_CRASHTRACKER_RESOLVE_FRAMES_NEVER,
118
- /**
119
- * Resolving frames is experimental, and can fail/crash
120
- */
121
- DDOG_PROF_CRASHTRACKER_RESOLVE_FRAMES_EXPERIMENTAL_IN_PROCESS,
122
- DDOG_PROF_CRASHTRACKER_RESOLVE_FRAMES_EXPERIMENTAL_IN_RECEIVER,
123
- } ddog_prof_CrashtrackerResolveFrames;
141
+ typedef enum ddog_prof_DemangleOptions {
142
+ DDOG_PROF_DEMANGLE_OPTIONS_COMPLETE,
143
+ DDOG_PROF_DEMANGLE_OPTIONS_NAME_ONLY,
144
+ } ddog_prof_DemangleOptions;
124
145
 
125
146
  /**
126
147
  * This enum represents operations a profiler might be engaged in.
@@ -144,6 +165,22 @@ typedef enum ddog_prof_ProfilingOpTypes {
144
165
  DDOG_PROF_PROFILING_OP_TYPES_SIZE,
145
166
  } ddog_prof_ProfilingOpTypes;
146
167
 
168
+ /**
169
+ * Stacktrace collection occurs in the context of a crashing process.
170
+ * If the stack is sufficiently corruputed, it is possible (but unlikely),
171
+ * for stack trace collection itself to crash.
172
+ * We recommend fully enabling stacktrace collection, but having an environment
173
+ * variable to allow downgrading the collector.
174
+ */
175
+ typedef enum ddog_prof_StacktraceCollection {
176
+ /**
177
+ * Stacktrace collection occurs in the
178
+ */
179
+ DDOG_PROF_STACKTRACE_COLLECTION_DISABLED,
180
+ DDOG_PROF_STACKTRACE_COLLECTION_WITHOUT_SYMBOLS,
181
+ DDOG_PROF_STACKTRACE_COLLECTION_ENABLED,
182
+ } ddog_prof_StacktraceCollection;
183
+
147
184
  typedef struct ddog_CancellationToken ddog_CancellationToken;
148
185
 
149
186
  typedef struct ddog_prof_Exporter ddog_prof_Exporter;
@@ -153,16 +190,16 @@ typedef struct ddog_prof_ProfiledEndpointsStats ddog_prof_ProfiledEndpointsStats
153
190
  typedef struct ddog_prof_Exporter_Request ddog_prof_Exporter_Request;
154
191
 
155
192
  /**
156
- * A generic result type for when a profiling operation may fail, but there's
157
- * nothing to return in the case of success.
193
+ * A generic result type for when a crashtracking operation may fail,
194
+ * but there's nothing to return in the case of success.
158
195
  */
159
- typedef enum ddog_prof_Profile_Result_Tag {
160
- DDOG_PROF_PROFILE_RESULT_OK,
161
- DDOG_PROF_PROFILE_RESULT_ERR,
162
- } ddog_prof_Profile_Result_Tag;
196
+ typedef enum ddog_prof_CrashtrackerResult_Tag {
197
+ DDOG_PROF_CRASHTRACKER_RESULT_OK,
198
+ DDOG_PROF_CRASHTRACKER_RESULT_ERR,
199
+ } ddog_prof_CrashtrackerResult_Tag;
163
200
 
164
- typedef struct ddog_prof_Profile_Result {
165
- ddog_prof_Profile_Result_Tag tag;
201
+ typedef struct ddog_prof_CrashtrackerResult {
202
+ ddog_prof_CrashtrackerResult_Tag tag;
166
203
  union {
167
204
  struct {
168
205
  /**
@@ -175,34 +212,76 @@ typedef struct ddog_prof_Profile_Result {
175
212
  struct ddog_Error err;
176
213
  };
177
214
  };
178
- } ddog_prof_Profile_Result;
215
+ } ddog_prof_CrashtrackerResult;
179
216
 
180
- typedef enum ddog_Endpoint_Tag {
181
- DDOG_ENDPOINT_AGENT,
182
- DDOG_ENDPOINT_AGENTLESS,
183
- } ddog_Endpoint_Tag;
217
+ typedef struct ddog_prof_Slice_CharSlice {
218
+ /**
219
+ * Must be non-null and suitably aligned for the underlying type.
220
+ */
221
+ const ddog_CharSlice *ptr;
222
+ /**
223
+ * The number of elements (not bytes) that `.ptr` points to. Must be less
224
+ * than or equal to [isize::MAX].
225
+ */
226
+ uintptr_t len;
227
+ } ddog_prof_Slice_CharSlice;
184
228
 
185
- typedef struct ddog_Endpoint_ddog_prof_Agentless_Body {
229
+ typedef enum ddog_prof_Endpoint_Tag {
230
+ DDOG_PROF_ENDPOINT_AGENT,
231
+ DDOG_PROF_ENDPOINT_AGENTLESS,
232
+ DDOG_PROF_ENDPOINT_FILE,
233
+ } ddog_prof_Endpoint_Tag;
234
+
235
+ typedef struct ddog_prof_Endpoint_ddog_prof_Agentless_Body {
186
236
  ddog_CharSlice _0;
187
237
  ddog_CharSlice _1;
188
- } ddog_Endpoint_ddog_prof_Agentless_Body;
238
+ } ddog_prof_Endpoint_ddog_prof_Agentless_Body;
189
239
 
190
- typedef struct ddog_Endpoint {
191
- ddog_Endpoint_Tag tag;
240
+ typedef struct ddog_prof_Endpoint {
241
+ ddog_prof_Endpoint_Tag tag;
192
242
  union {
193
243
  struct {
194
244
  ddog_CharSlice agent;
195
245
  };
196
- ddog_Endpoint_ddog_prof_Agentless_Body AGENTLESS;
246
+ ddog_prof_Endpoint_ddog_prof_Agentless_Body AGENTLESS;
247
+ struct {
248
+ ddog_CharSlice file;
249
+ };
197
250
  };
198
- } ddog_Endpoint;
251
+ } ddog_prof_Endpoint;
199
252
 
200
253
  typedef struct ddog_prof_CrashtrackerConfiguration {
254
+ struct ddog_prof_Slice_CharSlice additional_files;
201
255
  bool create_alt_stack;
202
256
  /**
203
- * The endpoint to send the crash repor to (can be a file://)
257
+ * The endpoint to send the crash report to (can be a file://)
258
+ */
259
+ struct ddog_prof_Endpoint endpoint;
260
+ enum ddog_prof_StacktraceCollection resolve_frames;
261
+ uint64_t timeout_secs;
262
+ } ddog_prof_CrashtrackerConfiguration;
263
+
264
+ typedef struct ddog_prof_EnvVar {
265
+ ddog_CharSlice key;
266
+ ddog_CharSlice val;
267
+ } ddog_prof_EnvVar;
268
+
269
+ typedef struct ddog_prof_Slice_EnvVar {
270
+ /**
271
+ * Must be non-null and suitably aligned for the underlying type.
272
+ */
273
+ const struct ddog_prof_EnvVar *ptr;
274
+ /**
275
+ * The number of elements (not bytes) that `.ptr` points to. Must be less
276
+ * than or equal to [isize::MAX].
204
277
  */
205
- struct ddog_Endpoint endpoint;
278
+ uintptr_t len;
279
+ } ddog_prof_Slice_EnvVar;
280
+
281
+ typedef struct ddog_prof_CrashtrackerReceiverConfig {
282
+ struct ddog_prof_Slice_CharSlice args;
283
+ struct ddog_prof_Slice_EnvVar env;
284
+ ddog_CharSlice path_to_receiver_binary;
206
285
  /**
207
286
  * Optional filename to forward stderr to (useful for logging/debugging)
208
287
  */
@@ -211,12 +290,7 @@ typedef struct ddog_prof_CrashtrackerConfiguration {
211
290
  * Optional filename to forward stdout to (useful for logging/debugging)
212
291
  */
213
292
  ddog_CharSlice optional_stdout_filename;
214
- ddog_CharSlice path_to_receiver_binary;
215
- /**
216
- * Whether/when we should attempt to resolve frames
217
- */
218
- enum ddog_prof_CrashtrackerResolveFrames resolve_frames;
219
- } ddog_prof_CrashtrackerConfiguration;
293
+ } ddog_prof_CrashtrackerReceiverConfig;
220
294
 
221
295
  typedef struct ddog_prof_CrashtrackerMetadata {
222
296
  ddog_CharSlice profiling_library_name;
@@ -228,6 +302,122 @@ typedef struct ddog_prof_CrashtrackerMetadata {
228
302
  const struct ddog_Vec_Tag *tags;
229
303
  } ddog_prof_CrashtrackerMetadata;
230
304
 
305
+ /**
306
+ * Represents a CrashInfo. Do not access its member for any reason, only use
307
+ * the C API functions on this struct.
308
+ */
309
+ typedef struct ddog_prof_CrashInfo {
310
+ struct ddog_prof_CrashInfo *inner;
311
+ } ddog_prof_CrashInfo;
312
+
313
+ /**
314
+ * Returned by [ddog_prof_Profile_new].
315
+ */
316
+ typedef enum ddog_prof_CrashInfoNewResult_Tag {
317
+ DDOG_PROF_CRASH_INFO_NEW_RESULT_OK,
318
+ DDOG_PROF_CRASH_INFO_NEW_RESULT_ERR,
319
+ } ddog_prof_CrashInfoNewResult_Tag;
320
+
321
+ typedef struct ddog_prof_CrashInfoNewResult {
322
+ ddog_prof_CrashInfoNewResult_Tag tag;
323
+ union {
324
+ struct {
325
+ struct ddog_prof_CrashInfo ok;
326
+ };
327
+ struct {
328
+ struct ddog_Error err;
329
+ };
330
+ };
331
+ } ddog_prof_CrashInfoNewResult;
332
+
333
+ typedef struct ddog_prof_SigInfo {
334
+ uint64_t signum;
335
+ ddog_CharSlice signame;
336
+ } ddog_prof_SigInfo;
337
+
338
+ typedef enum ddog_prof_Option_U32_Tag {
339
+ DDOG_PROF_OPTION_U32_SOME_U32,
340
+ DDOG_PROF_OPTION_U32_NONE_U32,
341
+ } ddog_prof_Option_U32_Tag;
342
+
343
+ typedef struct ddog_prof_Option_U32 {
344
+ ddog_prof_Option_U32_Tag tag;
345
+ union {
346
+ struct {
347
+ uint32_t some;
348
+ };
349
+ };
350
+ } ddog_prof_Option_U32;
351
+
352
+ typedef struct ddog_prof_StackFrameNames {
353
+ struct ddog_prof_Option_U32 colno;
354
+ ddog_CharSlice filename;
355
+ struct ddog_prof_Option_U32 lineno;
356
+ ddog_CharSlice name;
357
+ } ddog_prof_StackFrameNames;
358
+
359
+ typedef struct ddog_prof_Slice_StackFrameNames {
360
+ /**
361
+ * Must be non-null and suitably aligned for the underlying type.
362
+ */
363
+ const struct ddog_prof_StackFrameNames *ptr;
364
+ /**
365
+ * The number of elements (not bytes) that `.ptr` points to. Must be less
366
+ * than or equal to [isize::MAX].
367
+ */
368
+ uintptr_t len;
369
+ } ddog_prof_Slice_StackFrameNames;
370
+
371
+ typedef struct ddog_prof_StackFrame {
372
+ uintptr_t ip;
373
+ uintptr_t module_base_address;
374
+ struct ddog_prof_Slice_StackFrameNames names;
375
+ uintptr_t sp;
376
+ uintptr_t symbol_address;
377
+ } ddog_prof_StackFrame;
378
+
379
+ typedef struct ddog_prof_Slice_StackFrame {
380
+ /**
381
+ * Must be non-null and suitably aligned for the underlying type.
382
+ */
383
+ const struct ddog_prof_StackFrame *ptr;
384
+ /**
385
+ * The number of elements (not bytes) that `.ptr` points to. Must be less
386
+ * than or equal to [isize::MAX].
387
+ */
388
+ uintptr_t len;
389
+ } ddog_prof_Slice_StackFrame;
390
+
391
+ /**
392
+ * A wrapper for returning owned strings from FFI
393
+ */
394
+ typedef struct ddog_prof_StringWrapper {
395
+ /**
396
+ * This is a String stuffed into the vec.
397
+ */
398
+ struct ddog_Vec_U8 message;
399
+ } ddog_prof_StringWrapper;
400
+
401
+ /**
402
+ * Returned by [ddog_prof_Profile_new].
403
+ */
404
+ typedef enum ddog_prof_StringWrapperResult_Tag {
405
+ DDOG_PROF_STRING_WRAPPER_RESULT_OK,
406
+ DDOG_PROF_STRING_WRAPPER_RESULT_ERR,
407
+ } ddog_prof_StringWrapperResult_Tag;
408
+
409
+ typedef struct ddog_prof_StringWrapperResult {
410
+ ddog_prof_StringWrapperResult_Tag tag;
411
+ union {
412
+ struct {
413
+ struct ddog_prof_StringWrapper ok;
414
+ };
415
+ struct {
416
+ struct ddog_Error err;
417
+ };
418
+ };
419
+ } ddog_prof_StringWrapperResult;
420
+
231
421
  typedef struct ddog_Slice_U8 {
232
422
  /**
233
423
  * Must be non-null and suitably aligned for the underlying type.
@@ -375,6 +565,31 @@ typedef struct ddog_prof_Period {
375
565
  int64_t value;
376
566
  } ddog_prof_Period;
377
567
 
568
+ /**
569
+ * A generic result type for when a profiling operation may fail, but there's
570
+ * nothing to return in the case of success.
571
+ */
572
+ typedef enum ddog_prof_Profile_Result_Tag {
573
+ DDOG_PROF_PROFILE_RESULT_OK,
574
+ DDOG_PROF_PROFILE_RESULT_ERR,
575
+ } ddog_prof_Profile_Result_Tag;
576
+
577
+ typedef struct ddog_prof_Profile_Result {
578
+ ddog_prof_Profile_Result_Tag tag;
579
+ union {
580
+ struct {
581
+ /**
582
+ * Do not use the value of Ok. This value only exists to overcome
583
+ * Rust -> C code generation.
584
+ */
585
+ bool ok;
586
+ };
587
+ struct {
588
+ struct ddog_Error err;
589
+ };
590
+ };
591
+ } ddog_prof_Profile_Result;
592
+
378
593
  typedef struct ddog_prof_Mapping {
379
594
  /**
380
595
  * Address at which the binary (or DLL) is loaded into memory.
@@ -551,6 +766,98 @@ typedef struct ddog_prof_Profile_SerializeResult {
551
766
  };
552
767
  } ddog_prof_Profile_SerializeResult;
553
768
 
769
+ typedef enum ddog_ConfigurationOrigin {
770
+ DDOG_CONFIGURATION_ORIGIN_ENV_VAR,
771
+ DDOG_CONFIGURATION_ORIGIN_CODE,
772
+ DDOG_CONFIGURATION_ORIGIN_DD_CONFIG,
773
+ DDOG_CONFIGURATION_ORIGIN_REMOTE_CONFIG,
774
+ DDOG_CONFIGURATION_ORIGIN_DEFAULT,
775
+ } ddog_ConfigurationOrigin;
776
+
777
+ typedef enum ddog_LogLevel {
778
+ DDOG_LOG_LEVEL_ERROR,
779
+ DDOG_LOG_LEVEL_WARN,
780
+ DDOG_LOG_LEVEL_DEBUG,
781
+ } ddog_LogLevel;
782
+
783
+ typedef enum ddog_MetricNamespace {
784
+ DDOG_METRIC_NAMESPACE_TRACERS,
785
+ DDOG_METRIC_NAMESPACE_PROFILERS,
786
+ DDOG_METRIC_NAMESPACE_RUM,
787
+ DDOG_METRIC_NAMESPACE_APPSEC,
788
+ DDOG_METRIC_NAMESPACE_IDE_PLUGINS,
789
+ DDOG_METRIC_NAMESPACE_LIVE_DEBUGGER,
790
+ DDOG_METRIC_NAMESPACE_IAST,
791
+ DDOG_METRIC_NAMESPACE_GENERAL,
792
+ DDOG_METRIC_NAMESPACE_TELEMETRY,
793
+ DDOG_METRIC_NAMESPACE_APM,
794
+ DDOG_METRIC_NAMESPACE_SIDECAR,
795
+ } ddog_MetricNamespace;
796
+
797
+ typedef enum ddog_MetricType {
798
+ DDOG_METRIC_TYPE_GAUGE,
799
+ DDOG_METRIC_TYPE_COUNT,
800
+ DDOG_METRIC_TYPE_DISTRIBUTION,
801
+ } ddog_MetricType;
802
+
803
+ typedef enum ddog_TelemetryWorkerBuilderBoolProperty {
804
+ DDOG_TELEMETRY_WORKER_BUILDER_BOOL_PROPERTY_CONFIG_TELEMETRY_DEBUG_LOGGING_ENABLED,
805
+ } ddog_TelemetryWorkerBuilderBoolProperty;
806
+
807
+ typedef enum ddog_TelemetryWorkerBuilderEndpointProperty {
808
+ DDOG_TELEMETRY_WORKER_BUILDER_ENDPOINT_PROPERTY_CONFIG_ENDPOINT,
809
+ } ddog_TelemetryWorkerBuilderEndpointProperty;
810
+
811
+ typedef enum ddog_TelemetryWorkerBuilderStrProperty {
812
+ DDOG_TELEMETRY_WORKER_BUILDER_STR_PROPERTY_APPLICATION_SERVICE_VERSION,
813
+ DDOG_TELEMETRY_WORKER_BUILDER_STR_PROPERTY_APPLICATION_ENV,
814
+ DDOG_TELEMETRY_WORKER_BUILDER_STR_PROPERTY_APPLICATION_RUNTIME_NAME,
815
+ DDOG_TELEMETRY_WORKER_BUILDER_STR_PROPERTY_APPLICATION_RUNTIME_VERSION,
816
+ DDOG_TELEMETRY_WORKER_BUILDER_STR_PROPERTY_APPLICATION_RUNTIME_PATCHES,
817
+ DDOG_TELEMETRY_WORKER_BUILDER_STR_PROPERTY_HOST_CONTAINER_ID,
818
+ DDOG_TELEMETRY_WORKER_BUILDER_STR_PROPERTY_HOST_OS,
819
+ DDOG_TELEMETRY_WORKER_BUILDER_STR_PROPERTY_HOST_KERNEL_NAME,
820
+ DDOG_TELEMETRY_WORKER_BUILDER_STR_PROPERTY_HOST_KERNEL_RELEASE,
821
+ DDOG_TELEMETRY_WORKER_BUILDER_STR_PROPERTY_HOST_KERNEL_VERSION,
822
+ DDOG_TELEMETRY_WORKER_BUILDER_STR_PROPERTY_RUNTIME_ID,
823
+ } ddog_TelemetryWorkerBuilderStrProperty;
824
+
825
+ typedef struct ddog_TelemetryWorkerBuilder ddog_TelemetryWorkerBuilder;
826
+
827
+ /**
828
+ * TelemetryWorkerHandle is a handle which allows interactions with the telemetry worker.
829
+ * The handle is safe to use across threads.
830
+ *
831
+ * The worker won't send data to the agent until you call `TelemetryWorkerHandle::send_start`
832
+ *
833
+ * To stop the worker, call `TelemetryWorkerHandle::send_stop` which trigger flush asynchronously
834
+ * then `TelemetryWorkerHandle::wait_for_shutdown`
835
+ */
836
+ typedef struct ddog_TelemetryWorkerHandle ddog_TelemetryWorkerHandle;
837
+
838
+ typedef enum ddog_Option_Bool_Tag {
839
+ DDOG_OPTION_BOOL_SOME_BOOL,
840
+ DDOG_OPTION_BOOL_NONE_BOOL,
841
+ } ddog_Option_Bool_Tag;
842
+
843
+ typedef struct ddog_Option_Bool {
844
+ ddog_Option_Bool_Tag tag;
845
+ union {
846
+ struct {
847
+ bool some;
848
+ };
849
+ };
850
+ } ddog_Option_Bool;
851
+
852
+ typedef struct ddog_ContextKey {
853
+ uint32_t _0;
854
+ enum ddog_MetricType _1;
855
+ } ddog_ContextKey;
856
+
857
+ #ifdef __cplusplus
858
+ extern "C" {
859
+ #endif // __cplusplus
860
+
554
861
  /**
555
862
  * # Safety
556
863
  * Only pass null or a valid reference to a `ddog_Error`.
@@ -565,6 +872,8 @@ void ddog_Error_drop(struct ddog_Error *error);
565
872
  */
566
873
  ddog_CharSlice ddog_Error_message(const struct ddog_Error *error);
567
874
 
875
+ void ddog_MaybeError_drop(ddog_MaybeError);
876
+
568
877
  DDOG_CHECK_RETURN struct ddog_Endpoint *ddog_endpoint_from_url(ddog_CharSlice url);
569
878
 
570
879
  DDOG_CHECK_RETURN struct ddog_Endpoint *ddog_endpoint_from_api_key(ddog_CharSlice api_key);
@@ -576,6 +885,20 @@ struct ddog_Error *ddog_endpoint_from_api_key_and_site(ddog_CharSlice api_key,
576
885
 
577
886
  void ddog_endpoint_drop(struct ddog_Endpoint*);
578
887
 
888
+ /**
889
+ * # Safety
890
+ * Only pass null or a valid reference to a `ddog_StringWrapper`.
891
+ */
892
+ void ddog_StringWrapper_drop(struct ddog_StringWrapper *s);
893
+
894
+ /**
895
+ * Returns a CharSlice of the message that is valid until the StringWrapper
896
+ * is dropped.
897
+ * # Safety
898
+ * Only pass null or a valid reference to a `ddog_StringWrapper`.
899
+ */
900
+ ddog_CharSlice ddog_StringWrapper_message(const struct ddog_StringWrapper *s);
901
+
579
902
  DDOG_CHECK_RETURN struct ddog_Vec_Tag ddog_Vec_Tag_new(void);
580
903
 
581
904
  void ddog_Vec_Tag_drop(struct ddog_Vec_Tag);
@@ -602,4 +925,8 @@ struct ddog_Vec_Tag_PushResult ddog_Vec_Tag_push(struct ddog_Vec_Tag *vec,
602
925
  */
603
926
  DDOG_CHECK_RETURN struct ddog_Vec_Tag_ParseResult ddog_Vec_Tag_parse(ddog_CharSlice string);
604
927
 
928
+ #ifdef __cplusplus
929
+ } // extern "C"
930
+ #endif // __cplusplus
931
+
605
932
  #endif /* DDOG_COMMON_H */