@@ -56,18 +56,12 @@ export interface RemixInstrumentationConfig extends InstrumentationConfig {
5656 * @default { _action: "actionType" }
5757 */
5858 actionFormDataAttributes ?: Record < string , boolean | string > ;
59- /**
60- * Whether to emit errors in the form of span attributes, as well as in span exception events.
61- * Defaults to `false`, meaning that only span exception events are emitted.
62- */
63- legacyErrorAttributes ?: boolean ;
6459}
6560
6661const DEFAULT_CONFIG : RemixInstrumentationConfig = {
6762 actionFormDataAttributes : {
6863 _action : 'actionType' ,
6964 } ,
70- legacyErrorAttributes : false ,
7165} ;
7266
7367export class RemixInstrumentation extends InstrumentationBase {
@@ -347,10 +341,6 @@ export class RemixInstrumentation extends InstrumentationBase {
347341
348342 private _addErrorToSpan ( span : Span , error : Error ) : void {
349343 addErrorEventToSpan ( span , error ) ;
350-
351- if ( this . getConfig ( ) . legacyErrorAttributes || false ) {
352- addErrorAttributesToSpan ( span , error ) ;
353- }
354344 }
355345}
356346
@@ -383,13 +373,3 @@ const addErrorEventToSpan = (span: Span, error: Error): void => {
383373 span . recordException ( error ) ;
384374 span . setStatus ( { code : SpanStatusCode . ERROR , message : error . message } ) ;
385375} ;
386-
387- const addErrorAttributesToSpan = ( span : Span , error : Error ) : void => {
388- span . setAttribute ( 'error' , true ) ;
389- if ( error . message ) {
390- span . setAttribute ( SemanticAttributes . EXCEPTION_MESSAGE , error . message ) ;
391- }
392- if ( error . stack ) {
393- span . setAttribute ( SemanticAttributes . EXCEPTION_STACKTRACE , error . stack ) ;
394- }
395- } ;
0 commit comments