libdatadog 2.0.0.1.0-x86_64-linux → 4.0.0.1.0-x86_64-linux

Sign up to get free protection for your applications and to get access to all the features.
Files changed (21) hide show
  1. checksums.yaml +4 -4
  2. data/lib/libdatadog/version.rb +1 -1
  3. data/vendor/libdatadog-4.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/LICENSE-3rdparty.yml +17721 -0
  4. data/vendor/{libdatadog-2.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-4.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu}/include/datadog/common.h +48 -48
  5. data/vendor/{libdatadog-2.0.0 → libdatadog-4.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/profiling.h +87 -22
  6. data/vendor/libdatadog-4.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
  7. data/vendor/{libdatadog-2.0.0 → libdatadog-4.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  8. data/vendor/libdatadog-4.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/LICENSE-3rdparty.yml +17721 -0
  9. data/vendor/{libdatadog-2.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-4.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/include/datadog/common.h +48 -48
  10. data/vendor/{libdatadog-2.0.0 → libdatadog-4.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/profiling.h +87 -22
  11. data/vendor/libdatadog-4.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
  12. data/vendor/{libdatadog-2.0.0 → libdatadog-4.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  13. metadata +19 -19
  14. data/vendor/libdatadog-2.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/LICENSE-3rdparty.yml +0 -1183
  15. data/vendor/libdatadog-2.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
  16. data/vendor/libdatadog-2.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/LICENSE-3rdparty.yml +0 -1183
  17. data/vendor/libdatadog-2.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
  18. /data/vendor/{libdatadog-2.0.0 → libdatadog-4.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/LICENSE +0 -0
  19. /data/vendor/{libdatadog-2.0.0 → libdatadog-4.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/NOTICE +0 -0
  20. /data/vendor/{libdatadog-2.0.0 → libdatadog-4.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/LICENSE +0 -0
  21. /data/vendor/{libdatadog-2.0.0 → libdatadog-4.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/NOTICE +0 -0
@@ -40,6 +40,8 @@
40
40
  # define DDOG_CHECK_RETURN
41
41
  #endif
42
42
 
43
+ typedef struct ddog_Endpoint ddog_Endpoint;
44
+
43
45
  typedef struct ddog_Tag ddog_Tag;
44
46
 
45
47
  /**
@@ -107,8 +109,6 @@ typedef struct ddog_Vec_Tag_ParseResult {
107
109
 
108
110
  typedef struct ddog_CancellationToken ddog_CancellationToken;
109
111
 
110
- typedef struct ddog_prof_Profile ddog_prof_Profile;
111
-
112
112
  typedef struct ddog_prof_Exporter ddog_prof_Exporter;
113
113
 
114
114
  typedef struct ddog_prof_ProfiledEndpointsStats ddog_prof_ProfiledEndpointsStats;
@@ -226,6 +226,14 @@ typedef struct ddog_prof_Exporter_SendResult {
226
226
  };
227
227
  } ddog_prof_Exporter_SendResult;
228
228
 
229
+ /**
230
+ * Represents a profile. Do not access its member for any reason, only use
231
+ * the C API functions on this struct.
232
+ */
233
+ typedef struct ddog_prof_Profile {
234
+ struct ddog_prof_Profile *inner;
235
+ } ddog_prof_Profile;
236
+
229
237
  typedef struct ddog_prof_ValueType {
230
238
  ddog_CharSlice type_;
231
239
  ddog_CharSlice unit;
@@ -245,22 +253,30 @@ typedef struct ddog_prof_Period {
245
253
  int64_t value;
246
254
  } ddog_prof_Period;
247
255
 
248
- typedef enum ddog_prof_Profile_AddResult_Tag {
249
- DDOG_PROF_PROFILE_ADD_RESULT_OK,
250
- DDOG_PROF_PROFILE_ADD_RESULT_ERR,
251
- } ddog_prof_Profile_AddResult_Tag;
256
+ /**
257
+ * A generic result type for when a profiling operation may fail, but there's
258
+ * nothing to return in the case of success.
259
+ */
260
+ typedef enum ddog_prof_Profile_Result_Tag {
261
+ DDOG_PROF_PROFILE_RESULT_OK,
262
+ DDOG_PROF_PROFILE_RESULT_ERR,
263
+ } ddog_prof_Profile_Result_Tag;
252
264
 
253
- typedef struct ddog_prof_Profile_AddResult {
254
- ddog_prof_Profile_AddResult_Tag tag;
265
+ typedef struct ddog_prof_Profile_Result {
266
+ ddog_prof_Profile_Result_Tag tag;
255
267
  union {
256
268
  struct {
257
- uint64_t ok;
269
+ /**
270
+ * Do not use the value of Ok. This value only exists to overcome
271
+ * Rust -> C code generation.
272
+ */
273
+ bool ok;
258
274
  };
259
275
  struct {
260
276
  struct ddog_Error err;
261
277
  };
262
278
  };
263
- } ddog_prof_Profile_AddResult;
279
+ } ddog_prof_Profile_Result;
264
280
 
265
281
  typedef struct ddog_prof_Mapping {
266
282
  /**
@@ -309,31 +325,12 @@ typedef struct ddog_prof_Function {
309
325
  int64_t start_line;
310
326
  } ddog_prof_Function;
311
327
 
312
- typedef struct ddog_prof_Line {
313
- /**
314
- * The corresponding profile.Function for this line.
315
- */
316
- struct ddog_prof_Function function;
317
- /**
318
- * Line number in source code.
319
- */
320
- int64_t line;
321
- } ddog_prof_Line;
322
-
323
- /**
324
- * Remember, the data inside of each member is potentially coming from FFI,
325
- * so every operation on it is unsafe!
326
- */
327
- typedef struct ddog_prof_Slice_Line {
328
- const struct ddog_prof_Line *ptr;
329
- uintptr_t len;
330
- } ddog_prof_Slice_Line;
331
-
332
328
  typedef struct ddog_prof_Location {
333
329
  /**
334
330
  * todo: how to handle unknown mapping?
335
331
  */
336
332
  struct ddog_prof_Mapping mapping;
333
+ struct ddog_prof_Function function;
337
334
  /**
338
335
  * The instruction address for this location, if available. It
339
336
  * should be within [Mapping.memory_start...Mapping.memory_limit]
@@ -342,24 +339,7 @@ typedef struct ddog_prof_Location {
342
339
  * the beginning of the instruction if necessary.
343
340
  */
344
341
  uint64_t address;
345
- /**
346
- * Multiple line indicates this location has inlined functions,
347
- * where the last entry represents the caller into which the
348
- * preceding entries were inlined.
349
- *
350
- * E.g., if memcpy() is inlined into printf:
351
- * line[0].function_name == "memcpy"
352
- * line[1].function_name == "printf"
353
- */
354
- struct ddog_prof_Slice_Line lines;
355
- /**
356
- * Provides an indication that multiple symbols map to this location's
357
- * address, for example due to identical code folding by the linker. In that
358
- * case the line information above represents one of the multiple
359
- * symbols. This field must be recomputed when the symbolization state of the
360
- * profile changes.
361
- */
362
- bool is_folded;
342
+ int64_t line;
363
343
  } ddog_prof_Location;
364
344
 
365
345
  /**
@@ -429,6 +409,15 @@ typedef struct ddog_prof_Sample {
429
409
  struct ddog_prof_Slice_Label labels;
430
410
  } ddog_prof_Sample;
431
411
 
412
+ /**
413
+ * Remember, the data inside of each member is potentially coming from FFI,
414
+ * so every operation on it is unsafe!
415
+ */
416
+ typedef struct ddog_prof_Slice_Usize {
417
+ const uintptr_t *ptr;
418
+ uintptr_t len;
419
+ } ddog_prof_Slice_Usize;
420
+
432
421
  typedef struct ddog_prof_EncodedProfile {
433
422
  struct ddog_Timespec start;
434
423
  struct ddog_Timespec end;
@@ -467,6 +456,17 @@ void ddog_Error_drop(struct ddog_Error *error);
467
456
  */
468
457
  ddog_CharSlice ddog_Error_message(const struct ddog_Error *error);
469
458
 
459
+ DDOG_CHECK_RETURN struct ddog_Endpoint *ddog_endpoint_from_url(ddog_CharSlice url);
460
+
461
+ DDOG_CHECK_RETURN struct ddog_Endpoint *ddog_endpoint_from_api_key(ddog_CharSlice api_key);
462
+
463
+ DDOG_CHECK_RETURN
464
+ struct ddog_Error *ddog_endpoint_from_api_key_and_site(ddog_CharSlice api_key,
465
+ ddog_CharSlice site,
466
+ struct ddog_Endpoint **endpoint);
467
+
468
+ void ddog_endpoint_drop(struct ddog_Endpoint*);
469
+
470
470
  DDOG_CHECK_RETURN struct ddog_Vec_Tag ddog_Vec_Tag_new(void);
471
471
 
472
472
  void ddog_Vec_Tag_drop(struct ddog_Vec_Tag);
@@ -59,17 +59,25 @@ void ddog_prof_Exporter_drop(struct ddog_prof_Exporter *exporter);
59
59
  * If successful, builds a `ddog_prof_Exporter_Request` object based on the
60
60
  * profile data supplied. If unsuccessful, it returns an error message.
61
61
  *
62
+ * For details on the `optional_internal_metadata_json`, please reference the Datadog-internal
63
+ * "RFC: Attaching internal metadata to pprof profiles".
64
+ * If you use this parameter, please update the RFC with your use-case, so we can keep track of how this
65
+ * is getting used.
66
+ *
62
67
  * # Safety
63
- * The `exporter`, `additional_stats`, and `endpoint_stats` args should be
64
- * valid objects created by this module, except NULL is allowed.
68
+ * The `exporter`, `optional_additional_stats`, and `optional_endpoint_stats` args should be
69
+ * valid objects created by this module.
70
+ * NULL is allowed for `optional_additional_tags`, `optional_endpoints_stats` and
71
+ * `optional_internal_metadata_json`.
65
72
  */
66
73
  DDOG_CHECK_RETURN
67
74
  struct ddog_prof_Exporter_Request_BuildResult ddog_prof_Exporter_Request_build(struct ddog_prof_Exporter *exporter,
68
75
  struct ddog_Timespec start,
69
76
  struct ddog_Timespec end,
70
77
  struct ddog_prof_Exporter_Slice_File files,
71
- const struct ddog_Vec_Tag *additional_tags,
72
- const struct ddog_prof_ProfiledEndpointsStats *endpoints_stats,
78
+ const struct ddog_Vec_Tag *optional_additional_tags,
79
+ const struct ddog_prof_ProfiledEndpointsStats *optional_endpoints_stats,
80
+ const ddog_CharSlice *optional_internal_metadata_json,
73
81
  uint64_t timeout_ms);
74
82
 
75
83
  /**
@@ -162,14 +170,14 @@ void ddog_CancellationToken_drop(struct ddog_CancellationToken *token);
162
170
  * and must have the correct number of elements for the slice.
163
171
  */
164
172
  DDOG_CHECK_RETURN
165
- struct ddog_prof_Profile *ddog_prof_Profile_new(struct ddog_prof_Slice_ValueType sample_types,
166
- const struct ddog_prof_Period *period,
167
- const struct ddog_Timespec *start_time);
173
+ struct ddog_prof_Profile ddog_prof_Profile_new(struct ddog_prof_Slice_ValueType sample_types,
174
+ const struct ddog_prof_Period *period,
175
+ const struct ddog_Timespec *start_time);
168
176
 
169
177
  /**
170
178
  * # Safety
171
- * The `profile` can be null, but if non-null it must point to a valid object
172
- * created by the Rust Global allocator.
179
+ * The `profile` can be null, but if non-null it must point to a Profile
180
+ * made by this module, which has not previously been dropped.
173
181
  */
174
182
  void ddog_prof_Profile_drop(struct ddog_prof_Profile *profile);
175
183
 
@@ -179,8 +187,8 @@ void ddog_prof_Profile_drop(struct ddog_prof_Profile *profile);
179
187
  * module. All pointers inside the `sample` need to be valid for the duration
180
188
  * of this call.
181
189
  *
182
- * If successful, it returns the internal id of the sample (> 0) in the Ok
183
- * variant. On error, it holds an error message in the error variant.
190
+ * If successful, it returns the Ok variant.
191
+ * On error, it holds an error message in the error variant.
184
192
  *
185
193
  * # Safety
186
194
  * The `profile` ptr must point to a valid Profile object created by this
@@ -188,8 +196,8 @@ void ddog_prof_Profile_drop(struct ddog_prof_Profile *profile);
188
196
  * This call is _NOT_ thread-safe.
189
197
  */
190
198
  DDOG_CHECK_RETURN
191
- struct ddog_prof_Profile_AddResult ddog_prof_Profile_add(struct ddog_prof_Profile *profile,
192
- struct ddog_prof_Sample sample);
199
+ struct ddog_prof_Profile_Result ddog_prof_Profile_add(struct ddog_prof_Profile *profile,
200
+ struct ddog_prof_Sample sample);
193
201
 
194
202
  /**
195
203
  * Associate an endpoint to a given local root span id.
@@ -209,9 +217,10 @@ struct ddog_prof_Profile_AddResult ddog_prof_Profile_add(struct ddog_prof_Profil
209
217
  * module.
210
218
  * This call is _NOT_ thread-safe.
211
219
  */
212
- void ddog_prof_Profile_set_endpoint(struct ddog_prof_Profile *profile,
213
- uint64_t local_root_span_id,
214
- ddog_CharSlice endpoint);
220
+ DDOG_CHECK_RETURN
221
+ struct ddog_prof_Profile_Result ddog_prof_Profile_set_endpoint(struct ddog_prof_Profile *profile,
222
+ uint64_t local_root_span_id,
223
+ ddog_CharSlice endpoint);
215
224
 
216
225
  /**
217
226
  * Count the number of times an endpoint has been seen.
@@ -225,9 +234,64 @@ void ddog_prof_Profile_set_endpoint(struct ddog_prof_Profile *profile,
225
234
  * module.
226
235
  * This call is _NOT_ thread-safe.
227
236
  */
228
- void ddog_prof_Profile_add_endpoint_count(struct ddog_prof_Profile *profile,
229
- ddog_CharSlice endpoint,
230
- int64_t value);
237
+ DDOG_CHECK_RETURN
238
+ struct ddog_prof_Profile_Result ddog_prof_Profile_add_endpoint_count(struct ddog_prof_Profile *profile,
239
+ ddog_CharSlice endpoint,
240
+ int64_t value);
241
+
242
+ /**
243
+ * Add a poisson-based upscaling rule which will be use to adjust values and make them
244
+ * closer to reality.
245
+ *
246
+ * # Arguments
247
+ * * `profile` - a reference to the profile that will contain the samples.
248
+ * * `offset_values` - offset of the values
249
+ * * `label_name` - name of the label used to identify sample(s)
250
+ * * `label_value` - value of the label used to identify sample(s)
251
+ * * `sum_value_offset` - offset of the value used as a sum (compute the average with `count_value_offset`)
252
+ * * `count_value_offset` - offset of the value used as a count (compute the average with `sum_value_offset`)
253
+ * * `sampling_distance` - this is the threshold for this sampling window. This value must not be equal to 0
254
+ *
255
+ * # Safety
256
+ * This function must be called before serialize and must not be called after.
257
+ * The `profile` ptr must point to a valid Profile object created by this
258
+ * module.
259
+ * This call is _NOT_ thread-safe.
260
+ */
261
+ DDOG_CHECK_RETURN
262
+ struct ddog_prof_Profile_Result ddog_prof_Profile_add_upscaling_rule_poisson(struct ddog_prof_Profile *profile,
263
+ struct ddog_prof_Slice_Usize offset_values,
264
+ ddog_CharSlice label_name,
265
+ ddog_CharSlice label_value,
266
+ uintptr_t sum_value_offset,
267
+ uintptr_t count_value_offset,
268
+ uint64_t sampling_distance);
269
+
270
+ /**
271
+ * Add a proportional-based upscaling rule which will be use to adjust values and make them
272
+ * closer to reality.
273
+ *
274
+ * # Arguments
275
+ * * `profile` - a reference to the profile that will contain the samples.
276
+ * * `offset_values` - offset of the values
277
+ * * `label_name` - name of the label used to identify sample(s)
278
+ * * `label_value` - value of the label used to identify sample(s)
279
+ * * `total_sampled` - number of sampled event (found in the pprof). This value must not be equal to 0
280
+ * * `total_real` - number of events the profiler actually witnessed. This value must not be equal to 0
281
+ *
282
+ * # Safety
283
+ * This function must be called before serialize and must not be called after.
284
+ * The `profile` ptr must point to a valid Profile object created by this
285
+ * module.
286
+ * This call is _NOT_ thread-safe.
287
+ */
288
+ DDOG_CHECK_RETURN
289
+ struct ddog_prof_Profile_Result ddog_prof_Profile_add_upscaling_rule_proportional(struct ddog_prof_Profile *profile,
290
+ struct ddog_prof_Slice_Usize offset_values,
291
+ ddog_CharSlice label_name,
292
+ ddog_CharSlice label_value,
293
+ uint64_t total_sampled,
294
+ uint64_t total_real);
231
295
 
232
296
  /**
233
297
  * # Safety
@@ -259,7 +323,7 @@ void ddog_prof_EncodedProfile_drop(struct ddog_prof_EncodedProfile *profile);
259
323
  * The `duration_nanos` must be null or otherwise point to a valid i64.
260
324
  */
261
325
  DDOG_CHECK_RETURN
262
- struct ddog_prof_Profile_SerializeResult ddog_prof_Profile_serialize(const struct ddog_prof_Profile *profile,
326
+ struct ddog_prof_Profile_SerializeResult ddog_prof_Profile_serialize(struct ddog_prof_Profile *profile,
263
327
  const struct ddog_Timespec *end_time,
264
328
  const int64_t *duration_nanos);
265
329
 
@@ -279,7 +343,8 @@ DDOG_CHECK_RETURN struct ddog_Slice_U8 ddog_Vec_U8_as_slice(const struct ddog_Ve
279
343
  * can be called across an FFI boundary, the compiler cannot enforce this.
280
344
  * If `time` is not null, it must point to a valid Timespec object.
281
345
  */
282
- bool ddog_prof_Profile_reset(struct ddog_prof_Profile *profile,
283
- const struct ddog_Timespec *start_time);
346
+ DDOG_CHECK_RETURN
347
+ struct ddog_prof_Profile_Result ddog_prof_Profile_reset(struct ddog_prof_Profile *profile,
348
+ const struct ddog_Timespec *start_time);
284
349
 
285
350
  #endif /* DDOG_PROFILING_H */
@@ -10,7 +10,7 @@ includedir=${prefix}/include
10
10
 
11
11
  Name: datadog_profiling
12
12
  Description: Contains common code used to implement Datadog's Continuous Profilers. (Dynamic linking variant, sets rpath)
13
- Version: 2.0.0
13
+ Version: 4.0.0
14
14
  Requires:
15
15
  Libs: -L${libdir} -ldatadog_profiling -Wl,-rpath,${libdir}
16
16
  Libs.private: