@sentry/opentelemetry 8.0.0-beta.3 → 8.0.0-beta.5
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/cjs/index.js +21 -15
- package/cjs/index.js.map +1 -1
- package/esm/index.js +21 -15
- package/esm/index.js.map +1 -1
- package/package.json +4 -4
- package/types/instrumentation.d.ts +1 -1
- package/types/instrumentation.d.ts.map +1 -1
- package/types/sampler.d.ts.map +1 -1
- package/types/setupEventContextTrace.d.ts.map +1 -1
- package/types/utils/parseSpanDescription.d.ts.map +1 -1
- package/types-ts3.8/instrumentation.d.ts +1 -1
package/esm/index.js
CHANGED
|
@@ -286,7 +286,10 @@ function parseSpanDescription(span) {
|
|
|
286
286
|
const name = spanHasName(span) ? span.name : '<unknown>';
|
|
287
287
|
|
|
288
288
|
// if http.method exists, this is an http request span
|
|
289
|
-
|
|
289
|
+
//
|
|
290
|
+
// TODO: Referencing `http.request.method` is a temporary workaround until the semantic
|
|
291
|
+
// conventions export an attribute key for it.
|
|
292
|
+
const httpMethod = attributes['http.request.method'] || attributes[SEMATTRS_HTTP_METHOD];
|
|
290
293
|
if (httpMethod) {
|
|
291
294
|
return descriptionForHttpMethod({ attributes, name, kind: getSpanKind(span) }, httpMethod);
|
|
292
295
|
}
|
|
@@ -1115,10 +1118,7 @@ function setupEventContextTrace(client) {
|
|
|
1115
1118
|
...event.sdkProcessingMetadata,
|
|
1116
1119
|
};
|
|
1117
1120
|
|
|
1118
|
-
|
|
1119
|
-
if (transactionName && !event.transaction) {
|
|
1120
|
-
event.transaction = transactionName;
|
|
1121
|
-
}
|
|
1121
|
+
return event;
|
|
1122
1122
|
});
|
|
1123
1123
|
}
|
|
1124
1124
|
|
|
@@ -1547,7 +1547,7 @@ function maybeSend(spans) {
|
|
|
1547
1547
|
transactionEvent.spans = spans;
|
|
1548
1548
|
|
|
1549
1549
|
const measurements = timedEventsToMeasurements(span.events);
|
|
1550
|
-
if (
|
|
1550
|
+
if (measurements) {
|
|
1551
1551
|
transactionEvent.measurements = measurements;
|
|
1552
1552
|
}
|
|
1553
1553
|
|
|
@@ -1685,6 +1685,7 @@ function createAndFinishSpanForOtelSpan(node, spans, remaining) {
|
|
|
1685
1685
|
op,
|
|
1686
1686
|
origin,
|
|
1687
1687
|
_metrics_summary: getMetricSummaryJsonForSpan(span ),
|
|
1688
|
+
measurements: timedEventsToMeasurements(span.events),
|
|
1688
1689
|
});
|
|
1689
1690
|
|
|
1690
1691
|
spans.push(spanJSON);
|
|
@@ -1889,11 +1890,18 @@ class SentrySampler {
|
|
|
1889
1890
|
|
|
1890
1891
|
const parentSampled = parentSpan ? getParentSampled(parentSpan, traceId, spanName) : undefined;
|
|
1891
1892
|
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1893
|
+
const mutableSamplingDecision = { decision: true };
|
|
1894
|
+
this._client.emit(
|
|
1895
|
+
'beforeSampling',
|
|
1896
|
+
{
|
|
1897
|
+
spanAttributes: spanAttributes,
|
|
1898
|
+
spanName: spanName,
|
|
1899
|
+
parentSampled: parentSampled,
|
|
1900
|
+
parentContext: parentContext,
|
|
1901
|
+
},
|
|
1902
|
+
mutableSamplingDecision,
|
|
1903
|
+
);
|
|
1904
|
+
if (!mutableSamplingDecision.decision) {
|
|
1897
1905
|
return { decision: SamplingDecision.NOT_RECORD, traceState: traceState };
|
|
1898
1906
|
}
|
|
1899
1907
|
|
|
@@ -1975,11 +1983,9 @@ function getParentSampled(parentSpan, traceId, spanName) {
|
|
|
1975
1983
|
* This method takes an OpenTelemetry instrumentation or
|
|
1976
1984
|
* array of instrumentations and registers them with OpenTelemetry.
|
|
1977
1985
|
*/
|
|
1978
|
-
function addOpenTelemetryInstrumentation(
|
|
1979
|
-
instrumentation,
|
|
1980
|
-
) {
|
|
1986
|
+
function addOpenTelemetryInstrumentation(...instrumentations) {
|
|
1981
1987
|
registerInstrumentations({
|
|
1982
|
-
instrumentations
|
|
1988
|
+
instrumentations,
|
|
1983
1989
|
});
|
|
1984
1990
|
}
|
|
1985
1991
|
|