File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 1
1
/* eslint-disable max-lines */
2
2
import type {
3
3
Instrumenter ,
4
+ Measurements ,
4
5
Primitive ,
5
6
Span as SpanInterface ,
6
7
SpanAttributeValue ,
@@ -115,6 +116,9 @@ export class Span implements SpanInterface {
115
116
protected _endTime ?: number | undefined ;
116
117
/** Internal keeper of the status */
117
118
protected _status ?: SpanStatusType | string | undefined ;
119
+ protected _exclusiveTime ?: number ;
120
+
121
+ protected _measurements : Measurements ;
118
122
119
123
private _logMessage ?: string ;
120
124
@@ -159,6 +163,10 @@ export class Span implements SpanInterface {
159
163
if ( spanContext . endTimestamp ) {
160
164
this . _endTime = spanContext . endTimestamp ;
161
165
}
166
+ if ( spanContext . exclusiveTime ) {
167
+ this . _exclusiveTime = spanContext . exclusiveTime ;
168
+ }
169
+ this . _measurements = spanContext . measurements ? { ...spanContext . measurements } : { } ;
162
170
}
163
171
164
172
// This rule conflicts with another eslint rule :(
@@ -626,6 +634,8 @@ export class Span implements SpanInterface {
626
634
trace_id : this . _traceId ,
627
635
origin : this . _attributes [ SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN ] as SpanOrigin | undefined ,
628
636
_metrics_summary : getMetricSummaryJsonForSpan ( this ) ,
637
+ exclusive_time : this . _exclusiveTime ,
638
+ measurements : Object . keys ( this . _measurements ) . length > 0 ? this . _measurements : undefined ,
629
639
} ) ;
630
640
}
631
641
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import type {
3
3
Contexts ,
4
4
DynamicSamplingContext ,
5
5
MeasurementUnit ,
6
- Measurements ,
7
6
SpanTimeInput ,
8
7
Transaction as TransactionInterface ,
9
8
TransactionContext ,
@@ -31,8 +30,6 @@ export class Transaction extends SpanClass implements TransactionInterface {
31
30
32
31
protected _name : string ;
33
32
34
- private _measurements : Measurements ;
35
-
36
33
private _contexts : Contexts ;
37
34
38
35
private _trimEnd ?: boolean | undefined ;
@@ -53,7 +50,6 @@ export class Transaction extends SpanClass implements TransactionInterface {
53
50
*/
54
51
public constructor ( transactionContext : TransactionContext , hub ?: Hub ) {
55
52
super ( transactionContext ) ;
56
- this . _measurements = { } ;
57
53
this . _contexts = { } ;
58
54
59
55
// eslint-disable-next-line deprecation/deprecation
Original file line number Diff line number Diff line change 1
1
import type { TraceContext } from './context' ;
2
2
import type { Instrumenter } from './instrumenter' ;
3
+ import type { Measurements } from './measurement' ;
3
4
import type { Primitive } from './misc' ;
4
5
import type { HrTime } from './opentelemetry' ;
5
6
import type { Transaction } from './transaction' ;
@@ -178,6 +179,16 @@ export interface SpanContext {
178
179
* The origin of the span, giving context about what created the span.
179
180
*/
180
181
origin ?: SpanOrigin | undefined ;
182
+
183
+ /**
184
+ * Exclusive time in milliseconds.
185
+ */
186
+ exclusiveTime ?: number ;
187
+
188
+ /**
189
+ * Measurements of the Span.
190
+ */
191
+ measurements ?: Measurements ;
181
192
}
182
193
183
194
/** Span holding trace_id, span_id */
You can’t perform that action at this time.
0 commit comments