libdatadog 2.0.0.1.0 → 7.0.0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/libdatadog/version.rb +1 -1
- data/lib/libdatadog.rb +40 -16
- data/vendor/libdatadog-7.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/LICENSE-3rdparty.yml +29615 -0
- data/vendor/libdatadog-7.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/bin/libdatadog-crashtracking-receiver +0 -0
- data/vendor/libdatadog-7.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/blazesym.h +895 -0
- data/vendor/{libdatadog-2.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-7.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu}/include/datadog/common.h +346 -122
- data/vendor/{libdatadog-2.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-7.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu}/include/datadog/profiling.h +159 -49
- data/vendor/libdatadog-7.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/include/datadog/telemetry.h +290 -0
- data/vendor/libdatadog-7.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
- data/vendor/{libdatadog-2.0.0 → libdatadog-7.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/lib/pkgconfig/datadog_profiling_with_rpath.pc +3 -5
- data/vendor/libdatadog-7.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/LICENSE-3rdparty.yml +29615 -0
- data/vendor/libdatadog-7.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/bin/libdatadog-crashtracking-receiver +0 -0
- data/vendor/libdatadog-7.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/blazesym.h +895 -0
- data/vendor/{libdatadog-2.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-7.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl}/include/datadog/common.h +346 -122
- data/vendor/{libdatadog-2.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl → libdatadog-7.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl}/include/datadog/profiling.h +159 -49
- data/vendor/libdatadog-7.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/include/datadog/telemetry.h +290 -0
- data/vendor/libdatadog-7.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
- data/vendor/{libdatadog-2.0.0 → libdatadog-7.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc +3 -5
- data/vendor/libdatadog-7.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/LICENSE-3rdparty.yml +29615 -0
- data/vendor/libdatadog-7.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/bin/libdatadog-crashtracking-receiver +0 -0
- data/vendor/libdatadog-7.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/blazesym.h +895 -0
- data/vendor/{libdatadog-2.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl → libdatadog-7.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu}/include/datadog/common.h +346 -122
- data/vendor/{libdatadog-2.0.0 → libdatadog-7.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/profiling.h +159 -49
- data/vendor/libdatadog-7.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/include/datadog/telemetry.h +290 -0
- data/vendor/libdatadog-7.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
- data/vendor/{libdatadog-2.0.0 → libdatadog-7.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/pkgconfig/datadog_profiling_with_rpath.pc +3 -5
- data/vendor/libdatadog-7.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/LICENSE-3rdparty.yml +29615 -0
- data/vendor/libdatadog-7.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/bin/libdatadog-crashtracking-receiver +0 -0
- data/vendor/libdatadog-7.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/blazesym.h +895 -0
- data/vendor/{libdatadog-2.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu → libdatadog-7.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/include/datadog/common.h +346 -122
- data/vendor/{libdatadog-2.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu → libdatadog-7.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl}/include/datadog/profiling.h +159 -49
- data/vendor/libdatadog-7.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/include/datadog/telemetry.h +290 -0
- data/vendor/libdatadog-7.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
- data/vendor/{libdatadog-2.0.0 → libdatadog-7.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc +3 -5
- metadata +45 -33
- data/vendor/libdatadog-2.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/LICENSE-3rdparty.yml +0 -1183
- data/vendor/libdatadog-2.0.0/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
- data/vendor/libdatadog-2.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/LICENSE-3rdparty.yml +0 -1183
- data/vendor/libdatadog-2.0.0/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
- data/vendor/libdatadog-2.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/LICENSE-3rdparty.yml +0 -1183
- data/vendor/libdatadog-2.0.0/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so +0 -0
- data/vendor/libdatadog-2.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/LICENSE-3rdparty.yml +0 -1183
- data/vendor/libdatadog-2.0.0/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/lib/libdatadog_profiling.so +0 -0
- /data/vendor/{libdatadog-2.0.0 → libdatadog-7.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/LICENSE +0 -0
- /data/vendor/{libdatadog-2.0.0 → libdatadog-7.0.0}/aarch64-linux/libdatadog-aarch64-unknown-linux-gnu/NOTICE +0 -0
- /data/vendor/{libdatadog-2.0.0 → libdatadog-7.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/LICENSE +0 -0
- /data/vendor/{libdatadog-2.0.0 → libdatadog-7.0.0}/aarch64-linux-musl/libdatadog-aarch64-alpine-linux-musl/NOTICE +0 -0
- /data/vendor/{libdatadog-2.0.0 → libdatadog-7.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/LICENSE +0 -0
- /data/vendor/{libdatadog-2.0.0 → libdatadog-7.0.0}/x86_64-linux/libdatadog-x86_64-unknown-linux-gnu/NOTICE +0 -0
- /data/vendor/{libdatadog-2.0.0 → libdatadog-7.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/LICENSE +0 -0
- /data/vendor/{libdatadog-2.0.0 → libdatadog-7.0.0}/x86_64-linux-musl/libdatadog-x86_64-alpine-linux-musl/NOTICE +0 -0
@@ -1,5 +1,6 @@
|
|
1
|
-
//
|
2
|
-
//
|
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
|
-
|
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
|
@@ -40,6 +39,8 @@
|
|
40
39
|
# define DDOG_CHECK_RETURN
|
41
40
|
#endif
|
42
41
|
|
42
|
+
typedef struct ddog_Endpoint ddog_Endpoint;
|
43
|
+
|
43
44
|
typedef struct ddog_Tag ddog_Tag;
|
44
45
|
|
45
46
|
/**
|
@@ -65,15 +66,21 @@ typedef struct ddog_Error {
|
|
65
66
|
struct ddog_Vec_U8 message;
|
66
67
|
} ddog_Error;
|
67
68
|
|
68
|
-
/**
|
69
|
-
* Remember, the data inside of each member is potentially coming from FFI,
|
70
|
-
* so every operation on it is unsafe!
|
71
|
-
*/
|
72
69
|
typedef struct ddog_Slice_CChar {
|
70
|
+
/**
|
71
|
+
* Must be non-null and suitably aligned for the underlying type.
|
72
|
+
*/
|
73
73
|
const char *ptr;
|
74
|
+
/**
|
75
|
+
* The number of elements (not bytes) that `.ptr` points to. Must be less
|
76
|
+
* than or equal to [isize::MAX].
|
77
|
+
*/
|
74
78
|
uintptr_t len;
|
75
79
|
} ddog_Slice_CChar;
|
76
80
|
|
81
|
+
/**
|
82
|
+
* Use to represent strings -- should be valid UTF-8.
|
83
|
+
*/
|
77
84
|
typedef struct ddog_Slice_CChar ddog_CharSlice;
|
78
85
|
|
79
86
|
/**
|
@@ -105,9 +112,38 @@ typedef struct ddog_Vec_Tag_ParseResult {
|
|
105
112
|
struct ddog_Error *error_message;
|
106
113
|
} ddog_Vec_Tag_ParseResult;
|
107
114
|
|
108
|
-
typedef
|
115
|
+
typedef enum ddog_prof_CrashtrackerResolveFrames {
|
116
|
+
DDOG_PROF_CRASHTRACKER_RESOLVE_FRAMES_NEVER,
|
117
|
+
/**
|
118
|
+
* Resolving frames in process is experimental, and can fail/crash
|
119
|
+
*/
|
120
|
+
DDOG_PROF_CRASHTRACKER_RESOLVE_FRAMES_EXPERIMENTAL_IN_PROCESS,
|
121
|
+
DDOG_PROF_CRASHTRACKER_RESOLVE_FRAMES_IN_RECEIVER,
|
122
|
+
} ddog_prof_CrashtrackerResolveFrames;
|
123
|
+
|
124
|
+
/**
|
125
|
+
* This enum represents operations a profiler might be engaged in.
|
126
|
+
* The idea is that if a crash consistently occurs while a particular operation
|
127
|
+
* is ongoing, its likely related.
|
128
|
+
*
|
129
|
+
* In the future, we might also track wall-clock time of operations
|
130
|
+
* (or some statistical sampling thereof) using the same enum.
|
131
|
+
*
|
132
|
+
* NOTE: This enum is known to be non-exhaustive. Feel free to add new types
|
133
|
+
* as needed.
|
134
|
+
*/
|
135
|
+
typedef enum ddog_prof_ProfilingOpTypes {
|
136
|
+
DDOG_PROF_PROFILING_OP_TYPES_NOT_PROFILING = 0,
|
137
|
+
DDOG_PROF_PROFILING_OP_TYPES_COLLECTING_SAMPLE,
|
138
|
+
DDOG_PROF_PROFILING_OP_TYPES_UNWINDING,
|
139
|
+
DDOG_PROF_PROFILING_OP_TYPES_SERIALIZING,
|
140
|
+
/**
|
141
|
+
* Dummy value to allow easier iteration
|
142
|
+
*/
|
143
|
+
DDOG_PROF_PROFILING_OP_TYPES_SIZE,
|
144
|
+
} ddog_prof_ProfilingOpTypes;
|
109
145
|
|
110
|
-
typedef struct
|
146
|
+
typedef struct ddog_CancellationToken ddog_CancellationToken;
|
111
147
|
|
112
148
|
typedef struct ddog_prof_Exporter ddog_prof_Exporter;
|
113
149
|
|
@@ -115,25 +151,119 @@ typedef struct ddog_prof_ProfiledEndpointsStats ddog_prof_ProfiledEndpointsStats
|
|
115
151
|
|
116
152
|
typedef struct ddog_prof_Exporter_Request ddog_prof_Exporter_Request;
|
117
153
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
154
|
+
/**
|
155
|
+
* A generic result type for when a profiling operation may fail, but there's
|
156
|
+
* nothing to return in the case of success.
|
157
|
+
*/
|
158
|
+
typedef enum ddog_prof_Profile_Result_Tag {
|
159
|
+
DDOG_PROF_PROFILE_RESULT_OK,
|
160
|
+
DDOG_PROF_PROFILE_RESULT_ERR,
|
161
|
+
} ddog_prof_Profile_Result_Tag;
|
122
162
|
|
123
|
-
typedef struct
|
163
|
+
typedef struct ddog_prof_Profile_Result {
|
164
|
+
ddog_prof_Profile_Result_Tag tag;
|
165
|
+
union {
|
166
|
+
struct {
|
167
|
+
/**
|
168
|
+
* Do not use the value of Ok. This value only exists to overcome
|
169
|
+
* Rust -> C code generation.
|
170
|
+
*/
|
171
|
+
bool ok;
|
172
|
+
};
|
173
|
+
struct {
|
174
|
+
struct ddog_Error err;
|
175
|
+
};
|
176
|
+
};
|
177
|
+
} ddog_prof_Profile_Result;
|
178
|
+
|
179
|
+
typedef enum ddog_prof_Endpoint_Tag {
|
180
|
+
DDOG_PROF_ENDPOINT_AGENT,
|
181
|
+
DDOG_PROF_ENDPOINT_AGENTLESS,
|
182
|
+
} ddog_prof_Endpoint_Tag;
|
183
|
+
|
184
|
+
typedef struct ddog_prof_Endpoint_ddog_prof_Agentless_Body {
|
124
185
|
ddog_CharSlice _0;
|
125
186
|
ddog_CharSlice _1;
|
126
|
-
}
|
187
|
+
} ddog_prof_Endpoint_ddog_prof_Agentless_Body;
|
127
188
|
|
128
|
-
typedef struct
|
129
|
-
|
189
|
+
typedef struct ddog_prof_Endpoint {
|
190
|
+
ddog_prof_Endpoint_Tag tag;
|
130
191
|
union {
|
131
192
|
struct {
|
132
193
|
ddog_CharSlice agent;
|
133
194
|
};
|
134
|
-
|
195
|
+
ddog_prof_Endpoint_ddog_prof_Agentless_Body AGENTLESS;
|
135
196
|
};
|
136
|
-
}
|
197
|
+
} ddog_prof_Endpoint;
|
198
|
+
|
199
|
+
typedef struct ddog_prof_CrashtrackerConfiguration {
|
200
|
+
/**
|
201
|
+
* Should the crashtracker attempt to collect a stacktrace for the crash
|
202
|
+
*/
|
203
|
+
bool collect_stacktrace;
|
204
|
+
bool create_alt_stack;
|
205
|
+
/**
|
206
|
+
* The endpoint to send the crash repor to (can be a file://)
|
207
|
+
*/
|
208
|
+
struct ddog_prof_Endpoint endpoint;
|
209
|
+
/**
|
210
|
+
* Optional filename to forward stderr to (useful for logging/debugging)
|
211
|
+
*/
|
212
|
+
ddog_CharSlice optional_stderr_filename;
|
213
|
+
/**
|
214
|
+
* Optional filename to forward stdout to (useful for logging/debugging)
|
215
|
+
*/
|
216
|
+
ddog_CharSlice optional_stdout_filename;
|
217
|
+
ddog_CharSlice path_to_receiver_binary;
|
218
|
+
/**
|
219
|
+
* Whether/when we should attempt to resolve frames
|
220
|
+
*/
|
221
|
+
enum ddog_prof_CrashtrackerResolveFrames resolve_frames;
|
222
|
+
} ddog_prof_CrashtrackerConfiguration;
|
223
|
+
|
224
|
+
typedef struct ddog_prof_CrashtrackerMetadata {
|
225
|
+
ddog_CharSlice profiling_library_name;
|
226
|
+
ddog_CharSlice profiling_library_version;
|
227
|
+
ddog_CharSlice family;
|
228
|
+
/**
|
229
|
+
* Should include "service", "environment", etc
|
230
|
+
*/
|
231
|
+
const struct ddog_Vec_Tag *tags;
|
232
|
+
} ddog_prof_CrashtrackerMetadata;
|
233
|
+
|
234
|
+
typedef struct ddog_Slice_U8 {
|
235
|
+
/**
|
236
|
+
* Must be non-null and suitably aligned for the underlying type.
|
237
|
+
*/
|
238
|
+
const uint8_t *ptr;
|
239
|
+
/**
|
240
|
+
* The number of elements (not bytes) that `.ptr` points to. Must be less
|
241
|
+
* than or equal to [isize::MAX].
|
242
|
+
*/
|
243
|
+
uintptr_t len;
|
244
|
+
} ddog_Slice_U8;
|
245
|
+
|
246
|
+
/**
|
247
|
+
* Use to represent bytes -- does not need to be valid UTF-8.
|
248
|
+
*/
|
249
|
+
typedef struct ddog_Slice_U8 ddog_ByteSlice;
|
250
|
+
|
251
|
+
typedef struct ddog_prof_Exporter_File {
|
252
|
+
ddog_CharSlice name;
|
253
|
+
ddog_ByteSlice file;
|
254
|
+
} ddog_prof_Exporter_File;
|
255
|
+
|
256
|
+
typedef struct ddog_prof_Exporter_Slice_File {
|
257
|
+
/**
|
258
|
+
* Must be non-null and suitably aligned for the underlying type.
|
259
|
+
*/
|
260
|
+
const struct ddog_prof_Exporter_File *ptr;
|
261
|
+
/**
|
262
|
+
* The number of elements (not bytes) that `.ptr` points to. Must be less
|
263
|
+
* than or equal to [isize::MAX].
|
264
|
+
*/
|
265
|
+
uintptr_t len;
|
266
|
+
} ddog_prof_Exporter_Slice_File;
|
137
267
|
|
138
268
|
typedef enum ddog_prof_Exporter_NewResult_Tag {
|
139
269
|
DDOG_PROF_EXPORTER_NEW_RESULT_OK,
|
@@ -177,34 +307,6 @@ typedef struct ddog_Timespec {
|
|
177
307
|
uint32_t nanoseconds;
|
178
308
|
} ddog_Timespec;
|
179
309
|
|
180
|
-
/**
|
181
|
-
* Remember, the data inside of each member is potentially coming from FFI,
|
182
|
-
* so every operation on it is unsafe!
|
183
|
-
*/
|
184
|
-
typedef struct ddog_Slice_U8 {
|
185
|
-
const uint8_t *ptr;
|
186
|
-
uintptr_t len;
|
187
|
-
} ddog_Slice_U8;
|
188
|
-
|
189
|
-
/**
|
190
|
-
* Use to represent bytes -- does not need to be valid UTF-8.
|
191
|
-
*/
|
192
|
-
typedef struct ddog_Slice_U8 ddog_ByteSlice;
|
193
|
-
|
194
|
-
typedef struct ddog_prof_Exporter_File {
|
195
|
-
ddog_CharSlice name;
|
196
|
-
ddog_ByteSlice file;
|
197
|
-
} ddog_prof_Exporter_File;
|
198
|
-
|
199
|
-
/**
|
200
|
-
* Remember, the data inside of each member is potentially coming from FFI,
|
201
|
-
* so every operation on it is unsafe!
|
202
|
-
*/
|
203
|
-
typedef struct ddog_prof_Exporter_Slice_File {
|
204
|
-
const struct ddog_prof_Exporter_File *ptr;
|
205
|
-
uintptr_t len;
|
206
|
-
} ddog_prof_Exporter_Slice_File;
|
207
|
-
|
208
310
|
typedef struct ddog_HttpStatus {
|
209
311
|
uint16_t code;
|
210
312
|
} ddog_HttpStatus;
|
@@ -226,17 +328,48 @@ typedef struct ddog_prof_Exporter_SendResult {
|
|
226
328
|
};
|
227
329
|
} ddog_prof_Exporter_SendResult;
|
228
330
|
|
331
|
+
/**
|
332
|
+
* Represents a profile. Do not access its member for any reason, only use
|
333
|
+
* the C API functions on this struct.
|
334
|
+
*/
|
335
|
+
typedef struct ddog_prof_Profile {
|
336
|
+
struct ddog_prof_Profile *inner;
|
337
|
+
} ddog_prof_Profile;
|
338
|
+
|
339
|
+
/**
|
340
|
+
* Returned by [ddog_prof_Profile_new].
|
341
|
+
*/
|
342
|
+
typedef enum ddog_prof_Profile_NewResult_Tag {
|
343
|
+
DDOG_PROF_PROFILE_NEW_RESULT_OK,
|
344
|
+
DDOG_PROF_PROFILE_NEW_RESULT_ERR,
|
345
|
+
} ddog_prof_Profile_NewResult_Tag;
|
346
|
+
|
347
|
+
typedef struct ddog_prof_Profile_NewResult {
|
348
|
+
ddog_prof_Profile_NewResult_Tag tag;
|
349
|
+
union {
|
350
|
+
struct {
|
351
|
+
struct ddog_prof_Profile ok;
|
352
|
+
};
|
353
|
+
struct {
|
354
|
+
struct ddog_Error err;
|
355
|
+
};
|
356
|
+
};
|
357
|
+
} ddog_prof_Profile_NewResult;
|
358
|
+
|
229
359
|
typedef struct ddog_prof_ValueType {
|
230
360
|
ddog_CharSlice type_;
|
231
361
|
ddog_CharSlice unit;
|
232
362
|
} ddog_prof_ValueType;
|
233
363
|
|
234
|
-
/**
|
235
|
-
* Remember, the data inside of each member is potentially coming from FFI,
|
236
|
-
* so every operation on it is unsafe!
|
237
|
-
*/
|
238
364
|
typedef struct ddog_prof_Slice_ValueType {
|
365
|
+
/**
|
366
|
+
* Must be non-null and suitably aligned for the underlying type.
|
367
|
+
*/
|
239
368
|
const struct ddog_prof_ValueType *ptr;
|
369
|
+
/**
|
370
|
+
* The number of elements (not bytes) that `.ptr` points to. Must be less
|
371
|
+
* than or equal to [isize::MAX].
|
372
|
+
*/
|
240
373
|
uintptr_t len;
|
241
374
|
} ddog_prof_Slice_ValueType;
|
242
375
|
|
@@ -245,23 +378,6 @@ typedef struct ddog_prof_Period {
|
|
245
378
|
int64_t value;
|
246
379
|
} ddog_prof_Period;
|
247
380
|
|
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;
|
252
|
-
|
253
|
-
typedef struct ddog_prof_Profile_AddResult {
|
254
|
-
ddog_prof_Profile_AddResult_Tag tag;
|
255
|
-
union {
|
256
|
-
struct {
|
257
|
-
uint64_t ok;
|
258
|
-
};
|
259
|
-
struct {
|
260
|
-
struct ddog_Error err;
|
261
|
-
};
|
262
|
-
};
|
263
|
-
} ddog_prof_Profile_AddResult;
|
264
|
-
|
265
381
|
typedef struct ddog_prof_Mapping {
|
266
382
|
/**
|
267
383
|
* Address at which the binary (or DLL) is loaded into memory.
|
@@ -309,31 +425,12 @@ typedef struct ddog_prof_Function {
|
|
309
425
|
int64_t start_line;
|
310
426
|
} ddog_prof_Function;
|
311
427
|
|
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
428
|
typedef struct ddog_prof_Location {
|
333
429
|
/**
|
334
430
|
* todo: how to handle unknown mapping?
|
335
431
|
*/
|
336
432
|
struct ddog_prof_Mapping mapping;
|
433
|
+
struct ddog_prof_Function function;
|
337
434
|
/**
|
338
435
|
* The instruction address for this location, if available. It
|
339
436
|
* should be within [Mapping.memory_start...Mapping.memory_limit]
|
@@ -342,41 +439,30 @@ typedef struct ddog_prof_Location {
|
|
342
439
|
* the beginning of the instruction if necessary.
|
343
440
|
*/
|
344
441
|
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;
|
442
|
+
int64_t line;
|
363
443
|
} ddog_prof_Location;
|
364
444
|
|
365
|
-
/**
|
366
|
-
* Remember, the data inside of each member is potentially coming from FFI,
|
367
|
-
* so every operation on it is unsafe!
|
368
|
-
*/
|
369
445
|
typedef struct ddog_prof_Slice_Location {
|
446
|
+
/**
|
447
|
+
* Must be non-null and suitably aligned for the underlying type.
|
448
|
+
*/
|
370
449
|
const struct ddog_prof_Location *ptr;
|
450
|
+
/**
|
451
|
+
* The number of elements (not bytes) that `.ptr` points to. Must be less
|
452
|
+
* than or equal to [isize::MAX].
|
453
|
+
*/
|
371
454
|
uintptr_t len;
|
372
455
|
} ddog_prof_Slice_Location;
|
373
456
|
|
374
|
-
/**
|
375
|
-
* Remember, the data inside of each member is potentially coming from FFI,
|
376
|
-
* so every operation on it is unsafe!
|
377
|
-
*/
|
378
457
|
typedef struct ddog_Slice_I64 {
|
458
|
+
/**
|
459
|
+
* Must be non-null and suitably aligned for the underlying type.
|
460
|
+
*/
|
379
461
|
const int64_t *ptr;
|
462
|
+
/**
|
463
|
+
* The number of elements (not bytes) that `.ptr` points to. Must be less
|
464
|
+
* than or equal to [isize::MAX].
|
465
|
+
*/
|
380
466
|
uintptr_t len;
|
381
467
|
} ddog_Slice_I64;
|
382
468
|
|
@@ -399,12 +485,15 @@ typedef struct ddog_prof_Label {
|
|
399
485
|
ddog_CharSlice num_unit;
|
400
486
|
} ddog_prof_Label;
|
401
487
|
|
402
|
-
/**
|
403
|
-
* Remember, the data inside of each member is potentially coming from FFI,
|
404
|
-
* so every operation on it is unsafe!
|
405
|
-
*/
|
406
488
|
typedef struct ddog_prof_Slice_Label {
|
489
|
+
/**
|
490
|
+
* Must be non-null and suitably aligned for the underlying type.
|
491
|
+
*/
|
407
492
|
const struct ddog_prof_Label *ptr;
|
493
|
+
/**
|
494
|
+
* The number of elements (not bytes) that `.ptr` points to. Must be less
|
495
|
+
* than or equal to [isize::MAX].
|
496
|
+
*/
|
408
497
|
uintptr_t len;
|
409
498
|
} ddog_prof_Slice_Label;
|
410
499
|
|
@@ -429,6 +518,18 @@ typedef struct ddog_prof_Sample {
|
|
429
518
|
struct ddog_prof_Slice_Label labels;
|
430
519
|
} ddog_prof_Sample;
|
431
520
|
|
521
|
+
typedef struct ddog_prof_Slice_Usize {
|
522
|
+
/**
|
523
|
+
* Must be non-null and suitably aligned for the underlying type.
|
524
|
+
*/
|
525
|
+
const uintptr_t *ptr;
|
526
|
+
/**
|
527
|
+
* The number of elements (not bytes) that `.ptr` points to. Must be less
|
528
|
+
* than or equal to [isize::MAX].
|
529
|
+
*/
|
530
|
+
uintptr_t len;
|
531
|
+
} ddog_prof_Slice_Usize;
|
532
|
+
|
432
533
|
typedef struct ddog_prof_EncodedProfile {
|
433
534
|
struct ddog_Timespec start;
|
434
535
|
struct ddog_Timespec end;
|
@@ -453,6 +554,114 @@ typedef struct ddog_prof_Profile_SerializeResult {
|
|
453
554
|
};
|
454
555
|
} ddog_prof_Profile_SerializeResult;
|
455
556
|
|
557
|
+
typedef enum ddog_ConfigurationOrigin {
|
558
|
+
DDOG_CONFIGURATION_ORIGIN_ENV_VAR,
|
559
|
+
DDOG_CONFIGURATION_ORIGIN_CODE,
|
560
|
+
DDOG_CONFIGURATION_ORIGIN_DD_CONFIG,
|
561
|
+
DDOG_CONFIGURATION_ORIGIN_REMOTE_CONFIG,
|
562
|
+
DDOG_CONFIGURATION_ORIGIN_DEFAULT,
|
563
|
+
} ddog_ConfigurationOrigin;
|
564
|
+
|
565
|
+
typedef enum ddog_LogLevel {
|
566
|
+
DDOG_LOG_LEVEL_ERROR,
|
567
|
+
DDOG_LOG_LEVEL_WARN,
|
568
|
+
DDOG_LOG_LEVEL_DEBUG,
|
569
|
+
} ddog_LogLevel;
|
570
|
+
|
571
|
+
typedef enum ddog_MetricNamespace {
|
572
|
+
DDOG_METRIC_NAMESPACE_TRACERS,
|
573
|
+
DDOG_METRIC_NAMESPACE_PROFILERS,
|
574
|
+
DDOG_METRIC_NAMESPACE_RUM,
|
575
|
+
DDOG_METRIC_NAMESPACE_APPSEC,
|
576
|
+
DDOG_METRIC_NAMESPACE_IDE_PLUGINS,
|
577
|
+
DDOG_METRIC_NAMESPACE_LIVE_DEBUGGER,
|
578
|
+
DDOG_METRIC_NAMESPACE_IAST,
|
579
|
+
DDOG_METRIC_NAMESPACE_GENERAL,
|
580
|
+
DDOG_METRIC_NAMESPACE_TELEMETRY,
|
581
|
+
DDOG_METRIC_NAMESPACE_APM,
|
582
|
+
DDOG_METRIC_NAMESPACE_SIDECAR,
|
583
|
+
} ddog_MetricNamespace;
|
584
|
+
|
585
|
+
typedef enum ddog_MetricType {
|
586
|
+
DDOG_METRIC_TYPE_GAUGE,
|
587
|
+
DDOG_METRIC_TYPE_COUNT,
|
588
|
+
DDOG_METRIC_TYPE_DISTRIBUTION,
|
589
|
+
} ddog_MetricType;
|
590
|
+
|
591
|
+
typedef enum ddog_TelemetryWorkerBuilderBoolProperty {
|
592
|
+
DDOG_TELEMETRY_WORKER_BUILDER_BOOL_PROPERTY_CONFIG_TELEMETRY_DEBUG_LOGGING_ENABLED,
|
593
|
+
} ddog_TelemetryWorkerBuilderBoolProperty;
|
594
|
+
|
595
|
+
typedef enum ddog_TelemetryWorkerBuilderEndpointProperty {
|
596
|
+
DDOG_TELEMETRY_WORKER_BUILDER_ENDPOINT_PROPERTY_CONFIG_ENDPOINT,
|
597
|
+
} ddog_TelemetryWorkerBuilderEndpointProperty;
|
598
|
+
|
599
|
+
typedef enum ddog_TelemetryWorkerBuilderStrProperty {
|
600
|
+
DDOG_TELEMETRY_WORKER_BUILDER_STR_PROPERTY_APPLICATION_SERVICE_VERSION,
|
601
|
+
DDOG_TELEMETRY_WORKER_BUILDER_STR_PROPERTY_APPLICATION_ENV,
|
602
|
+
DDOG_TELEMETRY_WORKER_BUILDER_STR_PROPERTY_APPLICATION_RUNTIME_NAME,
|
603
|
+
DDOG_TELEMETRY_WORKER_BUILDER_STR_PROPERTY_APPLICATION_RUNTIME_VERSION,
|
604
|
+
DDOG_TELEMETRY_WORKER_BUILDER_STR_PROPERTY_APPLICATION_RUNTIME_PATCHES,
|
605
|
+
DDOG_TELEMETRY_WORKER_BUILDER_STR_PROPERTY_HOST_CONTAINER_ID,
|
606
|
+
DDOG_TELEMETRY_WORKER_BUILDER_STR_PROPERTY_HOST_OS,
|
607
|
+
DDOG_TELEMETRY_WORKER_BUILDER_STR_PROPERTY_HOST_KERNEL_NAME,
|
608
|
+
DDOG_TELEMETRY_WORKER_BUILDER_STR_PROPERTY_HOST_KERNEL_RELEASE,
|
609
|
+
DDOG_TELEMETRY_WORKER_BUILDER_STR_PROPERTY_HOST_KERNEL_VERSION,
|
610
|
+
DDOG_TELEMETRY_WORKER_BUILDER_STR_PROPERTY_RUNTIME_ID,
|
611
|
+
} ddog_TelemetryWorkerBuilderStrProperty;
|
612
|
+
|
613
|
+
typedef struct ddog_TelemetryWorkerBuilder ddog_TelemetryWorkerBuilder;
|
614
|
+
|
615
|
+
/**
|
616
|
+
* TelemetryWorkerHandle is a handle which allows interactions with the telemetry worker.
|
617
|
+
* The handle is safe to use across threads.
|
618
|
+
*
|
619
|
+
* The worker won't send data to the agent until you call `TelemetryWorkerHandle::send_start`
|
620
|
+
*
|
621
|
+
* To stop the worker, call `TelemetryWorkerHandle::send_stop` which trigger flush aynchronously
|
622
|
+
* then `TelemetryWorkerHandle::wait_for_shutdown`
|
623
|
+
*/
|
624
|
+
typedef struct ddog_TelemetryWorkerHandle ddog_TelemetryWorkerHandle;
|
625
|
+
|
626
|
+
typedef enum ddog_Option_VecU8_Tag {
|
627
|
+
DDOG_OPTION_VEC_U8_SOME_VEC_U8,
|
628
|
+
DDOG_OPTION_VEC_U8_NONE_VEC_U8,
|
629
|
+
} ddog_Option_VecU8_Tag;
|
630
|
+
|
631
|
+
typedef struct ddog_Option_VecU8 {
|
632
|
+
ddog_Option_VecU8_Tag tag;
|
633
|
+
union {
|
634
|
+
struct {
|
635
|
+
struct ddog_Vec_U8 some;
|
636
|
+
};
|
637
|
+
};
|
638
|
+
} ddog_Option_VecU8;
|
639
|
+
|
640
|
+
typedef struct ddog_Option_VecU8 ddog_MaybeError;
|
641
|
+
|
642
|
+
typedef enum ddog_Option_Bool_Tag {
|
643
|
+
DDOG_OPTION_BOOL_SOME_BOOL,
|
644
|
+
DDOG_OPTION_BOOL_NONE_BOOL,
|
645
|
+
} ddog_Option_Bool_Tag;
|
646
|
+
|
647
|
+
typedef struct ddog_Option_Bool {
|
648
|
+
ddog_Option_Bool_Tag tag;
|
649
|
+
union {
|
650
|
+
struct {
|
651
|
+
bool some;
|
652
|
+
};
|
653
|
+
};
|
654
|
+
} ddog_Option_Bool;
|
655
|
+
|
656
|
+
typedef struct ddog_ContextKey {
|
657
|
+
uint32_t _0;
|
658
|
+
enum ddog_MetricType _1;
|
659
|
+
} ddog_ContextKey;
|
660
|
+
|
661
|
+
#ifdef __cplusplus
|
662
|
+
extern "C" {
|
663
|
+
#endif // __cplusplus
|
664
|
+
|
456
665
|
/**
|
457
666
|
* # Safety
|
458
667
|
* Only pass null or a valid reference to a `ddog_Error`.
|
@@ -467,6 +676,17 @@ void ddog_Error_drop(struct ddog_Error *error);
|
|
467
676
|
*/
|
468
677
|
ddog_CharSlice ddog_Error_message(const struct ddog_Error *error);
|
469
678
|
|
679
|
+
DDOG_CHECK_RETURN struct ddog_Endpoint *ddog_endpoint_from_url(ddog_CharSlice url);
|
680
|
+
|
681
|
+
DDOG_CHECK_RETURN struct ddog_Endpoint *ddog_endpoint_from_api_key(ddog_CharSlice api_key);
|
682
|
+
|
683
|
+
DDOG_CHECK_RETURN
|
684
|
+
struct ddog_Error *ddog_endpoint_from_api_key_and_site(ddog_CharSlice api_key,
|
685
|
+
ddog_CharSlice site,
|
686
|
+
struct ddog_Endpoint **endpoint);
|
687
|
+
|
688
|
+
void ddog_endpoint_drop(struct ddog_Endpoint*);
|
689
|
+
|
470
690
|
DDOG_CHECK_RETURN struct ddog_Vec_Tag ddog_Vec_Tag_new(void);
|
471
691
|
|
472
692
|
void ddog_Vec_Tag_drop(struct ddog_Vec_Tag);
|
@@ -493,4 +713,8 @@ struct ddog_Vec_Tag_PushResult ddog_Vec_Tag_push(struct ddog_Vec_Tag *vec,
|
|
493
713
|
*/
|
494
714
|
DDOG_CHECK_RETURN struct ddog_Vec_Tag_ParseResult ddog_Vec_Tag_parse(ddog_CharSlice string);
|
495
715
|
|
716
|
+
#ifdef __cplusplus
|
717
|
+
} // extern "C"
|
718
|
+
#endif // __cplusplus
|
719
|
+
|
496
720
|
#endif /* DDOG_COMMON_H */
|