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 11/* eslint-disable max-lines */
22import type {
33 Instrumenter ,
4+ Measurements ,
45 Primitive ,
56 Span as SpanInterface ,
67 SpanAttributeValue ,
@@ -115,6 +116,9 @@ export class Span implements SpanInterface {
115116 protected _endTime ?: number | undefined ;
116117 /** Internal keeper of the status */
117118 protected _status ?: SpanStatusType | string | undefined ;
119+ protected _exclusiveTime ?: number ;
120+
121+ protected _measurements : Measurements ;
118122
119123 private _logMessage ?: string ;
120124
@@ -159,6 +163,10 @@ export class Span implements SpanInterface {
159163 if ( spanContext . endTimestamp ) {
160164 this . _endTime = spanContext . endTimestamp ;
161165 }
166+ if ( spanContext . exclusiveTime ) {
167+ this . _exclusiveTime = spanContext . exclusiveTime ;
168+ }
169+ this . _measurements = spanContext . measurements ? { ...spanContext . measurements } : { } ;
162170 }
163171
164172 // This rule conflicts with another eslint rule :(
@@ -626,6 +634,8 @@ export class Span implements SpanInterface {
626634 trace_id : this . _traceId ,
627635 origin : this . _attributes [ SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN ] as SpanOrigin | undefined ,
628636 _metrics_summary : getMetricSummaryJsonForSpan ( this ) ,
637+ exclusive_time : this . _exclusiveTime ,
638+ measurements : Object . keys ( this . _measurements ) . length > 0 ? this . _measurements : undefined ,
629639 } ) ;
630640 }
631641
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import type {
33 Contexts ,
44 DynamicSamplingContext ,
55 MeasurementUnit ,
6- Measurements ,
76 SpanTimeInput ,
87 Transaction as TransactionInterface ,
98 TransactionContext ,
@@ -31,8 +30,6 @@ export class Transaction extends SpanClass implements TransactionInterface {
3130
3231 protected _name : string ;
3332
34- private _measurements : Measurements ;
35-
3633 private _contexts : Contexts ;
3734
3835 private _trimEnd ?: boolean | undefined ;
@@ -53,7 +50,6 @@ export class Transaction extends SpanClass implements TransactionInterface {
5350 */
5451 public constructor ( transactionContext : TransactionContext , hub ?: Hub ) {
5552 super ( transactionContext ) ;
56- this . _measurements = { } ;
5753 this . _contexts = { } ;
5854
5955 // eslint-disable-next-line deprecation/deprecation
Original file line number Diff line number Diff line change 11import type { TraceContext } from './context' ;
22import type { Instrumenter } from './instrumenter' ;
3+ import type { Measurements } from './measurement' ;
34import type { Primitive } from './misc' ;
45import type { HrTime } from './opentelemetry' ;
56import type { Transaction } from './transaction' ;
@@ -178,6 +179,16 @@ export interface SpanContext {
178179 * The origin of the span, giving context about what created the span.
179180 */
180181 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 ;
181192}
182193
183194/** Span holding trace_id, span_id */
You can’t perform that action at this time.
0 commit comments