dd-trace 5.70.0 → 5.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-3rdparty.csv +5 -0
- package/index.d.ts +110 -1
- package/initialize.mjs +7 -1
- package/package.json +21 -2
- package/packages/datadog-instrumentations/src/anthropic.js +115 -0
- package/packages/datadog-instrumentations/src/azure-event-hubs.js +37 -0
- package/packages/datadog-instrumentations/src/azure-functions.js +3 -0
- package/packages/datadog-instrumentations/src/cucumber.js +7 -7
- package/packages/datadog-instrumentations/src/helpers/hooks.js +2 -0
- package/packages/datadog-instrumentations/src/jest.js +29 -36
- package/packages/datadog-instrumentations/src/mocha/main.js +8 -9
- package/packages/datadog-instrumentations/src/mocha/utils.js +1 -1
- package/packages/datadog-instrumentations/src/mocha/worker.js +2 -2
- package/packages/datadog-instrumentations/src/pg.js +1 -1
- package/packages/datadog-instrumentations/src/playwright.js +5 -5
- package/packages/datadog-instrumentations/src/vitest.js +8 -8
- package/packages/datadog-plugin-anthropic/src/index.js +17 -0
- package/packages/datadog-plugin-anthropic/src/tracing.js +30 -0
- package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/utils.js +73 -27
- package/packages/datadog-plugin-azure-event-hubs/src/index.js +15 -0
- package/packages/datadog-plugin-azure-event-hubs/src/producer.js +82 -0
- package/packages/datadog-plugin-azure-functions/src/index.js +37 -0
- package/packages/datadog-plugin-cucumber/src/index.js +3 -3
- package/packages/datadog-plugin-cypress/src/cypress-plugin.js +9 -9
- package/packages/datadog-plugin-jest/src/util.js +10 -2
- package/packages/datadog-plugin-mocha/src/index.js +2 -2
- package/packages/datadog-plugin-playwright/src/index.js +2 -2
- package/packages/datadog-plugin-vitest/src/index.js +2 -2
- package/packages/datadog-plugin-ws/src/server.js +5 -3
- package/packages/dd-trace/src/appsec/reporter.js +70 -21
- package/packages/dd-trace/src/appsec/waf/waf_context_wrapper.js +1 -1
- package/packages/dd-trace/src/config.js +110 -26
- package/packages/dd-trace/src/config_defaults.js +14 -0
- package/packages/dd-trace/src/git_properties.js +90 -5
- package/packages/dd-trace/src/llmobs/plugins/anthropic.js +282 -0
- package/packages/dd-trace/src/llmobs/tagger.js +35 -0
- package/packages/dd-trace/src/noop/proxy.js +3 -0
- package/packages/dd-trace/src/openfeature/constants/constants.js +51 -0
- package/packages/dd-trace/src/openfeature/flagging_provider.js +45 -0
- package/packages/dd-trace/src/openfeature/index.js +77 -0
- package/packages/dd-trace/src/openfeature/noop.js +101 -0
- package/packages/dd-trace/src/openfeature/writers/base.js +181 -0
- package/packages/dd-trace/src/openfeature/writers/exposures.js +173 -0
- package/packages/dd-trace/src/openfeature/writers/util.js +43 -0
- package/packages/dd-trace/src/opentelemetry/logs/batch_log_processor.js +100 -0
- package/packages/dd-trace/src/opentelemetry/logs/index.js +87 -0
- package/packages/dd-trace/src/opentelemetry/logs/logger.js +77 -0
- package/packages/dd-trace/src/opentelemetry/logs/logger_provider.js +126 -0
- package/packages/dd-trace/src/opentelemetry/logs/otlp_http_log_exporter.js +173 -0
- package/packages/dd-trace/src/opentelemetry/logs/otlp_transformer.js +367 -0
- package/packages/dd-trace/src/opentelemetry/protos/common.proto +116 -0
- package/packages/dd-trace/src/opentelemetry/protos/logs.proto +226 -0
- package/packages/dd-trace/src/opentelemetry/protos/logs_service.proto +78 -0
- package/packages/dd-trace/src/opentelemetry/protos/protobuf_loader.js +48 -0
- package/packages/dd-trace/src/opentelemetry/protos/resource.proto +45 -0
- package/packages/dd-trace/src/plugins/ci_plugin.js +7 -6
- package/packages/dd-trace/src/plugins/index.js +2 -0
- package/packages/dd-trace/src/plugins/util/test.js +6 -5
- package/packages/dd-trace/src/profiling/config.js +21 -1
- package/packages/dd-trace/src/profiling/exporters/event_serializer.js +3 -2
- package/packages/dd-trace/src/profiling/profiler.js +44 -22
- package/packages/dd-trace/src/profiling/profilers/events.js +12 -3
- package/packages/dd-trace/src/profiling/profilers/space.js +35 -24
- package/packages/dd-trace/src/profiling/profilers/wall.js +14 -6
- package/packages/dd-trace/src/proxy.js +22 -1
- package/packages/dd-trace/src/remote_config/capabilities.js +2 -0
- package/packages/dd-trace/src/remote_config/index.js +3 -0
- package/packages/dd-trace/src/service-naming/schemas/v0/messaging.js +4 -0
- package/packages/dd-trace/src/service-naming/schemas/v1/messaging.js +8 -0
- package/packages/dd-trace/src/supported-configurations.json +18 -0
- package/packages/dd-trace/src/telemetry/telemetry.js +13 -1
- package/register.js +9 -1
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
// Vendored from: https://github.com/open-telemetry/opentelemetry-proto/blob/v1.7.0/opentelemetry/proto/logs/v1/logs.proto
|
|
2
|
+
// Copyright 2020, OpenTelemetry Authors
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
|
|
16
|
+
syntax = "proto3";
|
|
17
|
+
|
|
18
|
+
package opentelemetry.proto.logs.v1;
|
|
19
|
+
|
|
20
|
+
import "common.proto";
|
|
21
|
+
import "resource.proto";
|
|
22
|
+
|
|
23
|
+
option csharp_namespace = "OpenTelemetry.Proto.Logs.V1";
|
|
24
|
+
option java_multiple_files = true;
|
|
25
|
+
option java_package = "io.opentelemetry.proto.logs.v1";
|
|
26
|
+
option java_outer_classname = "LogsProto";
|
|
27
|
+
option go_package = "go.opentelemetry.io/proto/otlp/logs/v1";
|
|
28
|
+
|
|
29
|
+
// LogsData represents the logs data that can be stored in a persistent storage,
|
|
30
|
+
// OR can be embedded by other protocols that transfer OTLP logs data but do not
|
|
31
|
+
// implement the OTLP protocol.
|
|
32
|
+
//
|
|
33
|
+
// The main difference between this message and collector protocol is that
|
|
34
|
+
// in this message there will not be any "control" or "metadata" specific to
|
|
35
|
+
// OTLP protocol.
|
|
36
|
+
//
|
|
37
|
+
// When new fields are added into this message, the OTLP request MUST be updated
|
|
38
|
+
// as well.
|
|
39
|
+
message LogsData {
|
|
40
|
+
// An array of ResourceLogs.
|
|
41
|
+
// For data coming from a single resource this array will typically contain
|
|
42
|
+
// one element. Intermediary nodes that receive data from multiple origins
|
|
43
|
+
// typically batch the data before forwarding further and in that case this
|
|
44
|
+
// array will contain multiple elements.
|
|
45
|
+
repeated ResourceLogs resource_logs = 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// A collection of ScopeLogs from a Resource.
|
|
49
|
+
message ResourceLogs {
|
|
50
|
+
reserved 1000;
|
|
51
|
+
|
|
52
|
+
// The resource for the logs in this message.
|
|
53
|
+
// If this field is not set then resource info is unknown.
|
|
54
|
+
opentelemetry.proto.resource.v1.Resource resource = 1;
|
|
55
|
+
|
|
56
|
+
// A list of ScopeLogs that originate from a resource.
|
|
57
|
+
repeated ScopeLogs scope_logs = 2;
|
|
58
|
+
|
|
59
|
+
// The Schema URL, if known. This is the identifier of the Schema that the resource data
|
|
60
|
+
// is recorded in. Notably, the last part of the URL path is the version number of the
|
|
61
|
+
// schema: http[s]://server[:port]/path/<version>. To learn more about Schema URL see
|
|
62
|
+
// https://opentelemetry.io/docs/specs/otel/schemas/#schema-url
|
|
63
|
+
// This schema_url applies to the data in the "resource" field. It does not apply
|
|
64
|
+
// to the data in the "scope_logs" field which have their own schema_url field.
|
|
65
|
+
string schema_url = 3;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// A collection of Logs produced by a Scope.
|
|
69
|
+
message ScopeLogs {
|
|
70
|
+
// The instrumentation scope information for the logs in this message.
|
|
71
|
+
// Semantically when InstrumentationScope isn't set, it is equivalent with
|
|
72
|
+
// an empty instrumentation scope name (unknown).
|
|
73
|
+
opentelemetry.proto.common.v1.InstrumentationScope scope = 1;
|
|
74
|
+
|
|
75
|
+
// A list of log records.
|
|
76
|
+
repeated LogRecord log_records = 2;
|
|
77
|
+
|
|
78
|
+
// The Schema URL, if known. This is the identifier of the Schema that the log data
|
|
79
|
+
// is recorded in. Notably, the last part of the URL path is the version number of the
|
|
80
|
+
// schema: http[s]://server[:port]/path/<version>. To learn more about Schema URL see
|
|
81
|
+
// https://opentelemetry.io/docs/specs/otel/schemas/#schema-url
|
|
82
|
+
// This schema_url applies to all logs in the "logs" field.
|
|
83
|
+
string schema_url = 3;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Possible values for LogRecord.SeverityNumber.
|
|
87
|
+
enum SeverityNumber {
|
|
88
|
+
// UNSPECIFIED is the default SeverityNumber, it MUST NOT be used.
|
|
89
|
+
SEVERITY_NUMBER_UNSPECIFIED = 0;
|
|
90
|
+
SEVERITY_NUMBER_TRACE = 1;
|
|
91
|
+
SEVERITY_NUMBER_TRACE2 = 2;
|
|
92
|
+
SEVERITY_NUMBER_TRACE3 = 3;
|
|
93
|
+
SEVERITY_NUMBER_TRACE4 = 4;
|
|
94
|
+
SEVERITY_NUMBER_DEBUG = 5;
|
|
95
|
+
SEVERITY_NUMBER_DEBUG2 = 6;
|
|
96
|
+
SEVERITY_NUMBER_DEBUG3 = 7;
|
|
97
|
+
SEVERITY_NUMBER_DEBUG4 = 8;
|
|
98
|
+
SEVERITY_NUMBER_INFO = 9;
|
|
99
|
+
SEVERITY_NUMBER_INFO2 = 10;
|
|
100
|
+
SEVERITY_NUMBER_INFO3 = 11;
|
|
101
|
+
SEVERITY_NUMBER_INFO4 = 12;
|
|
102
|
+
SEVERITY_NUMBER_WARN = 13;
|
|
103
|
+
SEVERITY_NUMBER_WARN2 = 14;
|
|
104
|
+
SEVERITY_NUMBER_WARN3 = 15;
|
|
105
|
+
SEVERITY_NUMBER_WARN4 = 16;
|
|
106
|
+
SEVERITY_NUMBER_ERROR = 17;
|
|
107
|
+
SEVERITY_NUMBER_ERROR2 = 18;
|
|
108
|
+
SEVERITY_NUMBER_ERROR3 = 19;
|
|
109
|
+
SEVERITY_NUMBER_ERROR4 = 20;
|
|
110
|
+
SEVERITY_NUMBER_FATAL = 21;
|
|
111
|
+
SEVERITY_NUMBER_FATAL2 = 22;
|
|
112
|
+
SEVERITY_NUMBER_FATAL3 = 23;
|
|
113
|
+
SEVERITY_NUMBER_FATAL4 = 24;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// LogRecordFlags represents constants used to interpret the
|
|
117
|
+
// LogRecord.flags field, which is protobuf 'fixed32' type and is to
|
|
118
|
+
// be used as bit-fields. Each non-zero value defined in this enum is
|
|
119
|
+
// a bit-mask. To extract the bit-field, for example, use an
|
|
120
|
+
// expression like:
|
|
121
|
+
//
|
|
122
|
+
// (logRecord.flags & LOG_RECORD_FLAGS_TRACE_FLAGS_MASK)
|
|
123
|
+
//
|
|
124
|
+
enum LogRecordFlags {
|
|
125
|
+
// The zero value for the enum. Should not be used for comparisons.
|
|
126
|
+
// Instead use bitwise "and" with the appropriate mask as shown above.
|
|
127
|
+
LOG_RECORD_FLAGS_DO_NOT_USE = 0;
|
|
128
|
+
|
|
129
|
+
// Bits 0-7 are used for trace flags.
|
|
130
|
+
LOG_RECORD_FLAGS_TRACE_FLAGS_MASK = 0x000000FF;
|
|
131
|
+
|
|
132
|
+
// Bits 8-31 are reserved for future use.
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// A log record according to OpenTelemetry Log Data Model:
|
|
136
|
+
// https://github.com/open-telemetry/oteps/blob/main/text/logs/0097-log-data-model.md
|
|
137
|
+
message LogRecord {
|
|
138
|
+
reserved 4;
|
|
139
|
+
|
|
140
|
+
// time_unix_nano is the time when the event occurred.
|
|
141
|
+
// Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
|
|
142
|
+
// Value of 0 indicates unknown or missing timestamp.
|
|
143
|
+
fixed64 time_unix_nano = 1;
|
|
144
|
+
|
|
145
|
+
// Time when the event was observed by the collection system.
|
|
146
|
+
// For events that originate in OpenTelemetry (e.g. using OpenTelemetry Logging SDK)
|
|
147
|
+
// this timestamp is typically set at the generation time and is equal to Timestamp.
|
|
148
|
+
// For events originating externally and collected by OpenTelemetry (e.g. using
|
|
149
|
+
// Collector) this is the time when OpenTelemetry's code observed the event measured
|
|
150
|
+
// by the clock of the OpenTelemetry code. This field MUST be set once the event is
|
|
151
|
+
// observed by OpenTelemetry.
|
|
152
|
+
//
|
|
153
|
+
// For converting OpenTelemetry log data to formats that support only one timestamp or
|
|
154
|
+
// when receiving OpenTelemetry log data by recipients that support only one timestamp
|
|
155
|
+
// internally the following logic is recommended:
|
|
156
|
+
// - Use time_unix_nano if it is present, otherwise use observed_time_unix_nano.
|
|
157
|
+
//
|
|
158
|
+
// Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
|
|
159
|
+
// Value of 0 indicates unknown or missing timestamp.
|
|
160
|
+
fixed64 observed_time_unix_nano = 11;
|
|
161
|
+
|
|
162
|
+
// Numerical value of the severity, normalized to values described in Log Data Model.
|
|
163
|
+
// [Optional].
|
|
164
|
+
SeverityNumber severity_number = 2;
|
|
165
|
+
|
|
166
|
+
// The severity text (also known as log level). The original string representation as
|
|
167
|
+
// it is known at the source. [Optional].
|
|
168
|
+
string severity_text = 3;
|
|
169
|
+
|
|
170
|
+
// A value containing the body of the log record. Can be for example a human-readable
|
|
171
|
+
// string message (including multi-line) describing the event in a free form or it can
|
|
172
|
+
// be a structured data composed of arrays and maps of other values. [Optional].
|
|
173
|
+
opentelemetry.proto.common.v1.AnyValue body = 5;
|
|
174
|
+
|
|
175
|
+
// Additional attributes that describe the specific event occurrence. [Optional].
|
|
176
|
+
// Attribute keys MUST be unique (it is not allowed to have more than one
|
|
177
|
+
// attribute with the same key).
|
|
178
|
+
repeated opentelemetry.proto.common.v1.KeyValue attributes = 6;
|
|
179
|
+
uint32 dropped_attributes_count = 7;
|
|
180
|
+
|
|
181
|
+
// Flags, a bit field. 8 least significant bits are the trace flags as
|
|
182
|
+
// defined in W3C Trace Context specification. 24 most significant bits are reserved
|
|
183
|
+
// and must be set to 0. Readers must not assume that 24 most significant bits
|
|
184
|
+
// will be zero and must correctly mask the bits when reading 8-bit trace flag (use
|
|
185
|
+
// flags & LOG_RECORD_FLAGS_TRACE_FLAGS_MASK). [Optional].
|
|
186
|
+
fixed32 flags = 8;
|
|
187
|
+
|
|
188
|
+
// A unique identifier for a trace. All logs from the same trace share
|
|
189
|
+
// the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes OR
|
|
190
|
+
// of length other than 16 bytes is considered invalid (empty string in OTLP/JSON
|
|
191
|
+
// is zero-length and thus is also invalid).
|
|
192
|
+
//
|
|
193
|
+
// This field is optional.
|
|
194
|
+
//
|
|
195
|
+
// The receivers SHOULD assume that the log record is not associated with a
|
|
196
|
+
// trace if any of the following is true:
|
|
197
|
+
// - the field is not present,
|
|
198
|
+
// - the field contains an invalid value.
|
|
199
|
+
bytes trace_id = 9;
|
|
200
|
+
|
|
201
|
+
// A unique identifier for a span within a trace, assigned when the span
|
|
202
|
+
// is created. The ID is an 8-byte array. An ID with all zeroes OR of length
|
|
203
|
+
// other than 8 bytes is considered invalid (empty string in OTLP/JSON
|
|
204
|
+
// is zero-length and thus is also invalid).
|
|
205
|
+
//
|
|
206
|
+
// This field is optional. If the sender specifies a valid span_id then it SHOULD also
|
|
207
|
+
// specify a valid trace_id.
|
|
208
|
+
//
|
|
209
|
+
// The receivers SHOULD assume that the log record is not associated with a
|
|
210
|
+
// span if any of the following is true:
|
|
211
|
+
// - the field is not present,
|
|
212
|
+
// - the field contains an invalid value.
|
|
213
|
+
bytes span_id = 10;
|
|
214
|
+
|
|
215
|
+
// A unique identifier of event category/type.
|
|
216
|
+
// All events with the same event_name are expected to conform to the same
|
|
217
|
+
// schema for both their attributes and their body.
|
|
218
|
+
//
|
|
219
|
+
// Recommended to be fully qualified and short (no longer than 256 characters).
|
|
220
|
+
//
|
|
221
|
+
// Presence of event_name on the log record identifies this record
|
|
222
|
+
// as an event.
|
|
223
|
+
//
|
|
224
|
+
// [Optional].
|
|
225
|
+
string event_name = 12;
|
|
226
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Vendored from: https://github.com/open-telemetry/opentelemetry-proto/blob/v1.7.0/opentelemetry/proto/collector/logs/v1/logs_service.proto
|
|
2
|
+
// Copyright 2020, OpenTelemetry Authors
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
|
|
16
|
+
syntax = "proto3";
|
|
17
|
+
|
|
18
|
+
package opentelemetry.proto.collector.logs.v1;
|
|
19
|
+
|
|
20
|
+
import "logs.proto";
|
|
21
|
+
|
|
22
|
+
option csharp_namespace = "OpenTelemetry.Proto.Collector.Logs.V1";
|
|
23
|
+
option java_multiple_files = true;
|
|
24
|
+
option java_package = "io.opentelemetry.proto.collector.logs.v1";
|
|
25
|
+
option java_outer_classname = "LogsServiceProto";
|
|
26
|
+
option go_package = "go.opentelemetry.io/proto/otlp/collector/logs/v1";
|
|
27
|
+
|
|
28
|
+
// Service that can be used to push logs between one Application instrumented with
|
|
29
|
+
// OpenTelemetry and an collector, or between an collector and a central collector (in this
|
|
30
|
+
// case logs are sent/received to/from multiple Applications).
|
|
31
|
+
service LogsService {
|
|
32
|
+
rpc Export(ExportLogsServiceRequest) returns (ExportLogsServiceResponse) {}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message ExportLogsServiceRequest {
|
|
36
|
+
// An array of ResourceLogs.
|
|
37
|
+
// For data coming from a single resource this array will typically contain one
|
|
38
|
+
// element. Intermediary nodes (such as OpenTelemetry Collector) that receive
|
|
39
|
+
// data from multiple origins typically batch the data before forwarding further and
|
|
40
|
+
// in that case this array will contain multiple elements.
|
|
41
|
+
repeated opentelemetry.proto.logs.v1.ResourceLogs resource_logs = 1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
message ExportLogsServiceResponse {
|
|
45
|
+
// The details of a partially successful export request.
|
|
46
|
+
//
|
|
47
|
+
// If the request is only partially accepted
|
|
48
|
+
// (i.e. when the server accepts only parts of the data and rejects the rest)
|
|
49
|
+
// the server MUST initialize the `partial_success` field and MUST
|
|
50
|
+
// set the `rejected_<signal>` with the number of items it rejected.
|
|
51
|
+
//
|
|
52
|
+
// Servers MAY also make use of the `partial_success` field to convey
|
|
53
|
+
// warnings/suggestions to senders even when the request was fully accepted.
|
|
54
|
+
// In such cases, the `rejected_<signal>` MUST have a value of `0` and
|
|
55
|
+
// the `error_message` MUST be non-empty.
|
|
56
|
+
//
|
|
57
|
+
// A `partial_success` message with an empty value (rejected_<signal> = 0 and
|
|
58
|
+
// `error_message` = "") is equivalent to it not being set/present. Senders
|
|
59
|
+
// SHOULD interpret it the same way as in the full success case.
|
|
60
|
+
ExportLogsPartialSuccess partial_success = 1;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
message ExportLogsPartialSuccess {
|
|
64
|
+
// The number of rejected log records.
|
|
65
|
+
//
|
|
66
|
+
// A `rejected_<signal>` field holding a `0` value indicates that the
|
|
67
|
+
// request was fully accepted.
|
|
68
|
+
int64 rejected_log_records = 1;
|
|
69
|
+
|
|
70
|
+
// A developer-facing human-readable message in English. It should be used
|
|
71
|
+
// either to explain why the server rejected parts of the data during a partial
|
|
72
|
+
// success or to convey warnings/suggestions during a full success. The message
|
|
73
|
+
// should offer guidance on how users can address such issues.
|
|
74
|
+
//
|
|
75
|
+
// error_message is an optional field. An error_message with an empty value
|
|
76
|
+
// is equivalent to it not being set.
|
|
77
|
+
string error_message = 2;
|
|
78
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Protobuf Loader for OpenTelemetry Logs
|
|
5
|
+
*
|
|
6
|
+
* This module loads protobuf definitions for OpenTelemetry logs.
|
|
7
|
+
*
|
|
8
|
+
* VERSION SUPPORT:
|
|
9
|
+
* - OTLP Protocol: v1.7.0
|
|
10
|
+
* - Protobuf Definitions: v1.7.0 (vendored from opentelemetry-proto)
|
|
11
|
+
* - Other versions are not supported
|
|
12
|
+
*
|
|
13
|
+
* Reference:
|
|
14
|
+
* - https://github.com/open-telemetry/opentelemetry-proto (v1.7.0)
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const protobuf = require('protobufjs')
|
|
18
|
+
const path = require('path')
|
|
19
|
+
|
|
20
|
+
let _root = null
|
|
21
|
+
let protoLogsService = null
|
|
22
|
+
let protoSeverityNumber = null
|
|
23
|
+
|
|
24
|
+
function getProtobufTypes () {
|
|
25
|
+
if (_root) {
|
|
26
|
+
return { protoLogsService, protoSeverityNumber }
|
|
27
|
+
}
|
|
28
|
+
// Load the proto files
|
|
29
|
+
const protoDir = __dirname
|
|
30
|
+
const protoFiles = [
|
|
31
|
+
'common.proto',
|
|
32
|
+
'resource.proto',
|
|
33
|
+
'logs.proto',
|
|
34
|
+
'logs_service.proto'
|
|
35
|
+
].map(file => path.join(protoDir, file))
|
|
36
|
+
|
|
37
|
+
_root = protobuf.loadSync(protoFiles)
|
|
38
|
+
|
|
39
|
+
// Get the message types
|
|
40
|
+
protoLogsService = _root.lookupType('opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest')
|
|
41
|
+
protoSeverityNumber = _root.lookupEnum('opentelemetry.proto.logs.v1.SeverityNumber')
|
|
42
|
+
|
|
43
|
+
return { protoLogsService, protoSeverityNumber }
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
module.exports = {
|
|
47
|
+
getProtobufTypes,
|
|
48
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Vendored from: https://github.com/open-telemetry/opentelemetry-proto/blob/v1.7.0/opentelemetry/proto/resource/v1/resource.proto
|
|
2
|
+
// Copyright 2019, OpenTelemetry Authors
|
|
3
|
+
//
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// you may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
// See the License for the specific language governing permissions and
|
|
14
|
+
// limitations under the License.
|
|
15
|
+
|
|
16
|
+
syntax = "proto3";
|
|
17
|
+
|
|
18
|
+
package opentelemetry.proto.resource.v1;
|
|
19
|
+
|
|
20
|
+
import "common.proto";
|
|
21
|
+
|
|
22
|
+
option csharp_namespace = "OpenTelemetry.Proto.Resource.V1";
|
|
23
|
+
option java_multiple_files = true;
|
|
24
|
+
option java_package = "io.opentelemetry.proto.resource.v1";
|
|
25
|
+
option java_outer_classname = "ResourceProto";
|
|
26
|
+
option go_package = "go.opentelemetry.io/proto/otlp/resource/v1";
|
|
27
|
+
|
|
28
|
+
// Resource information.
|
|
29
|
+
message Resource {
|
|
30
|
+
// Set of attributes that describe the resource.
|
|
31
|
+
// Attribute keys MUST be unique (it is not allowed to have more than one
|
|
32
|
+
// attribute with the same key).
|
|
33
|
+
repeated opentelemetry.proto.common.v1.KeyValue attributes = 1;
|
|
34
|
+
|
|
35
|
+
// dropped_attributes_count is the number of dropped attributes. If the value is 0, then
|
|
36
|
+
// no attributes were dropped.
|
|
37
|
+
uint32 dropped_attributes_count = 2;
|
|
38
|
+
|
|
39
|
+
// Set of entities that participate in this Resource.
|
|
40
|
+
//
|
|
41
|
+
// Note: keys in the references MUST exist in attributes of this message.
|
|
42
|
+
//
|
|
43
|
+
// Status: [Development]
|
|
44
|
+
repeated opentelemetry.proto.common.v1.EntityRef entity_refs = 3;
|
|
45
|
+
}
|
|
@@ -33,7 +33,7 @@ const {
|
|
|
33
33
|
DI_DEBUG_ERROR_LINE_SUFFIX,
|
|
34
34
|
getLibraryCapabilitiesTags,
|
|
35
35
|
getPullRequestDiff,
|
|
36
|
-
|
|
36
|
+
getModifiedFilesFromDiff,
|
|
37
37
|
getPullRequestBaseBranch
|
|
38
38
|
} = require('./util/test')
|
|
39
39
|
const { getRepositoryRoot } = require('./util/git')
|
|
@@ -275,11 +275,11 @@ module.exports = class CiPlugin extends Plugin {
|
|
|
275
275
|
})
|
|
276
276
|
})
|
|
277
277
|
|
|
278
|
-
this.addBind(`ci:${this.constructor.id}:modified-
|
|
278
|
+
this.addBind(`ci:${this.constructor.id}:modified-files`, (ctx) => {
|
|
279
279
|
return ctx.currentStore
|
|
280
280
|
})
|
|
281
281
|
|
|
282
|
-
this.addSub(`ci:${this.constructor.id}:modified-
|
|
282
|
+
this.addSub(`ci:${this.constructor.id}:modified-files`, ({ onDone }) => {
|
|
283
283
|
const {
|
|
284
284
|
[GIT_PULL_REQUEST_BASE_BRANCH]: pullRequestBaseBranch,
|
|
285
285
|
[GIT_PULL_REQUEST_BASE_BRANCH_SHA]: pullRequestBaseBranchSha,
|
|
@@ -290,9 +290,10 @@ module.exports = class CiPlugin extends Plugin {
|
|
|
290
290
|
|
|
291
291
|
if (baseBranchSha) {
|
|
292
292
|
const diff = getPullRequestDiff(baseBranchSha, commitHeadSha)
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
|
|
293
|
+
const modifiedFiles = getModifiedFilesFromDiff(diff)
|
|
294
|
+
|
|
295
|
+
if (modifiedFiles) {
|
|
296
|
+
return onDone({ err: null, modifiedFiles })
|
|
296
297
|
}
|
|
297
298
|
}
|
|
298
299
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
+
get '@anthropic-ai/sdk' () { return require('../../../datadog-plugin-anthropic/src') },
|
|
4
5
|
get '@apollo/gateway' () { return require('../../../datadog-plugin-apollo/src') },
|
|
5
6
|
get '@aws-sdk/smithy-client' () { return require('../../../datadog-plugin-aws-sdk/src') },
|
|
7
|
+
get '@azure/event-hubs' () { return require('../../../datadog-plugin-azure-event-hubs/src') },
|
|
6
8
|
get '@azure/functions' () { return require('../../../datadog-plugin-azure-functions/src') },
|
|
7
9
|
get '@azure/service-bus' () { return require('../../../datadog-plugin-azure-service-bus/src') },
|
|
8
10
|
get '@cucumber/cucumber' () { return require('../../../datadog-plugin-cucumber/src') },
|
|
@@ -301,7 +301,7 @@ module.exports = {
|
|
|
301
301
|
checkShaDiscrepancies,
|
|
302
302
|
getPullRequestDiff,
|
|
303
303
|
getPullRequestBaseBranch,
|
|
304
|
-
|
|
304
|
+
getModifiedFilesFromDiff,
|
|
305
305
|
isModifiedTest,
|
|
306
306
|
POSSIBLE_BASE_BRANCHES
|
|
307
307
|
}
|
|
@@ -1069,7 +1069,7 @@ function getPullRequestDiff (baseCommit, targetCommit) {
|
|
|
1069
1069
|
return getGitDiff(baseCommit, targetCommit)
|
|
1070
1070
|
}
|
|
1071
1071
|
|
|
1072
|
-
function
|
|
1072
|
+
function getModifiedFilesFromDiff (diff) {
|
|
1073
1073
|
if (!diff) return null
|
|
1074
1074
|
const result = {}
|
|
1075
1075
|
|
|
@@ -1110,12 +1110,13 @@ function getModifiedTestsFromDiff (diff) {
|
|
|
1110
1110
|
return result
|
|
1111
1111
|
}
|
|
1112
1112
|
|
|
1113
|
-
function isModifiedTest (testPath, testStartLine, testEndLine,
|
|
1114
|
-
if (
|
|
1113
|
+
function isModifiedTest (testPath, testStartLine, testEndLine, modifiedFiles, testFramework) {
|
|
1114
|
+
if (modifiedFiles === undefined) {
|
|
1115
1115
|
return false
|
|
1116
1116
|
}
|
|
1117
1117
|
|
|
1118
|
-
const lines =
|
|
1118
|
+
const lines = modifiedFiles[testPath]
|
|
1119
|
+
|
|
1119
1120
|
if (!lines) {
|
|
1120
1121
|
return false
|
|
1121
1122
|
}
|
|
@@ -25,6 +25,7 @@ class Config {
|
|
|
25
25
|
DD_AGENT_HOST,
|
|
26
26
|
DD_ENV,
|
|
27
27
|
DD_INTERNAL_PROFILING_TIMELINE_SAMPLING_ENABLED, // used for testing
|
|
28
|
+
DD_PROFILING_ASYNC_CONTEXT_FRAME_ENABLED,
|
|
28
29
|
DD_PROFILING_CODEHOTSPOTS_ENABLED,
|
|
29
30
|
DD_PROFILING_CPU_ENABLED,
|
|
30
31
|
DD_PROFILING_DEBUG_SOURCE_MAPS,
|
|
@@ -42,7 +43,6 @@ class Config {
|
|
|
42
43
|
DD_PROFILING_TIMELINE_ENABLED,
|
|
43
44
|
DD_PROFILING_UPLOAD_PERIOD,
|
|
44
45
|
DD_PROFILING_UPLOAD_TIMEOUT,
|
|
45
|
-
DD_PROFILING_ASYNC_CONTEXT_FRAME_ENABLED,
|
|
46
46
|
DD_PROFILING_V8_PROFILER_BUG_WORKAROUND,
|
|
47
47
|
DD_PROFILING_WALLTIME_ENABLED,
|
|
48
48
|
DD_SERVICE,
|
|
@@ -242,6 +242,26 @@ class Config {
|
|
|
242
242
|
|
|
243
243
|
this.profilers = ensureProfilers(profilers, this)
|
|
244
244
|
}
|
|
245
|
+
|
|
246
|
+
get systemInfoReport () {
|
|
247
|
+
const report = {
|
|
248
|
+
asyncContextFrameEnabled: this.asyncContextFrameEnabled,
|
|
249
|
+
codeHotspotsEnabled: this.codeHotspotsEnabled,
|
|
250
|
+
cpuProfilingEnabled: this.cpuProfilingEnabled,
|
|
251
|
+
debugSourceMaps: this.debugSourceMaps,
|
|
252
|
+
endpointCollectionEnabled: this.endpointCollectionEnabled,
|
|
253
|
+
heapSamplingInterval: this.heapSamplingInterval,
|
|
254
|
+
oomMonitoring: { ...this.oomMonitoring },
|
|
255
|
+
profilerTypes: this.profilers.map(p => p.type),
|
|
256
|
+
sourceMap: this.sourceMap,
|
|
257
|
+
timelineEnabled: this.timelineEnabled,
|
|
258
|
+
timelineSamplingEnabled: this.timelineSamplingEnabled,
|
|
259
|
+
uploadCompression: { ...this.uploadCompression },
|
|
260
|
+
v8ProfilerBugWorkaroundEnabled: this.v8ProfilerBugWorkaroundEnabled
|
|
261
|
+
}
|
|
262
|
+
delete report.oomMonitoring.exportCommand
|
|
263
|
+
return report
|
|
264
|
+
}
|
|
245
265
|
}
|
|
246
266
|
|
|
247
267
|
module.exports = { Config }
|
|
@@ -21,7 +21,7 @@ class EventSerializer {
|
|
|
21
21
|
return `${type}.pprof`
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
getEventJSON ({ profiles, start, end, tags = {}, endpointCounts }) {
|
|
24
|
+
getEventJSON ({ profiles, infos, start, end, tags = {}, endpointCounts }) {
|
|
25
25
|
return JSON.stringify({
|
|
26
26
|
attachments: Object.keys(profiles).map(t => this.typeToFile(t)),
|
|
27
27
|
start: start.toISOString(),
|
|
@@ -58,7 +58,8 @@ class EventSerializer {
|
|
|
58
58
|
ssi: {
|
|
59
59
|
mechanism: this._libraryInjected ? 'injected_agent' : 'none'
|
|
60
60
|
},
|
|
61
|
-
version
|
|
61
|
+
version,
|
|
62
|
+
...infos
|
|
62
63
|
},
|
|
63
64
|
runtime: {
|
|
64
65
|
available_processors: availableParallelism(),
|