@@ -386,22 +386,24 @@ def get_trace_state(span):
386386 options = client .options or {}
387387
388388 trace_state = trace_state .update (
389- Baggage .SENTRY_PREFIX + "trace_id" , format_trace_id (span_context .trace_id )
389+ Baggage .SENTRY_PREFIX + "trace_id" ,
390+ quote (format_trace_id (span_context .trace_id )),
390391 )
391392
392393 if options .get ("environment" ):
393394 trace_state = trace_state .update (
394- Baggage .SENTRY_PREFIX + "environment" , options ["environment" ]
395+ Baggage .SENTRY_PREFIX + "environment" , quote ( options ["environment" ])
395396 )
396397
397398 if options .get ("release" ):
398399 trace_state = trace_state .update (
399- Baggage .SENTRY_PREFIX + "release" , options ["release" ]
400+ Baggage .SENTRY_PREFIX + "release" , quote ( options ["release" ])
400401 )
401402
402403 if options .get ("dsn" ):
403404 trace_state = trace_state .update (
404- Baggage .SENTRY_PREFIX + "public_key" , Dsn (options ["dsn" ]).public_key
405+ Baggage .SENTRY_PREFIX + "public_key" ,
406+ quote (Dsn (options ["dsn" ]).public_key ),
405407 )
406408
407409 root_span = get_sentry_meta (span , "root_span" )
@@ -415,7 +417,7 @@ def get_trace_state(span):
415417 and transaction_source not in LOW_QUALITY_TRANSACTION_SOURCES
416418 ):
417419 trace_state = trace_state .update (
418- Baggage .SENTRY_PREFIX + "transaction" , transaction_name
420+ Baggage .SENTRY_PREFIX + "transaction" , quote ( transaction_name )
419421 )
420422
421423 return trace_state
0 commit comments