@@ -63,13 +63,10 @@ import { parseSampleRate } from './utils/parseSampleRate';
6363import { prepareEvent } from './utils/prepareEvent' ;
6464import { showSpanDropWarning , spanToTraceContext } from './utils/spanUtils' ;
6565import { convertSpanJsonToTransactionEvent , convertTransactionEventToSpanJson } from './utils/transactionEvent' ;
66- import type { Log , SerializedOtelLog } from './types-hoist/log' ;
67- import { SEVERITY_TEXT_TO_SEVERITY_NUMBER , createOtelLogEnvelope , logAttributeToSerializedLogAttribute } from './log' ;
6866import { _getSpanForScope } from './utils/spanOnScope' ;
6967
7068const ALREADY_SEEN_ERROR = "Not capturing exception because it's already been captured." ;
7169const MISSING_RELEASE_FOR_SESSION_ERROR = 'Discarded session because of missing or non-string release' ;
72- const MAX_LOG_BUFFER_SIZE = 100 ;
7370
7471/**
7572 * Base implementation for all JavaScript SDK clients.
@@ -125,8 +122,6 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
125122 // eslint-disable-next-line @typescript-eslint/ban-types
126123 private _hooks : Record < string , Function [ ] > ;
127124
128- private _logsBuffer : Array < SerializedOtelLog > ;
129-
130125 /**
131126 * Initializes this client instance.
132127 *
@@ -139,7 +134,6 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
139134 this . _outcomes = { } ;
140135 this . _hooks = { } ;
141136 this . _eventProcessors = [ ] ;
142- this . _logsBuffer = [ ] ;
143137
144138 if ( options . dsn ) {
145139 this . _dsn = makeDsn ( options . dsn ) ;
@@ -267,58 +261,6 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
267261 */
268262 public captureCheckIn ?( checkIn : CheckIn , monitorConfig ?: MonitorConfig , scope ?: Scope ) : string ;
269263
270- /**
271- * Captures a log event and sends it to Sentry.
272- *
273- * @param log The log event to capture.
274- *
275- * @experimental This method will experience breaking changes. This is not yet part of
276- * the stable Sentry SDK API and can be changed or removed without warning.
277- */
278- public captureLog ( { level, message, attributes, severityNumber } : Log , currentScope = getCurrentScope ( ) ) : void {
279- const { _experiments, release, environment } = this . getOptions ( ) ;
280- if ( ! _experiments ?. enableLogs ) {
281- DEBUG_BUILD && logger . warn ( 'logging option not enabled, log will not be captured.' ) ;
282- return ;
283- }
284-
285- const [ , traceContext ] = _getTraceInfoFromScope ( this , currentScope ) ;
286-
287- const logAttributes = {
288- ...attributes ,
289- } ;
290-
291- if ( release ) {
292- logAttributes . release = release ;
293- }
294-
295- if ( environment ) {
296- logAttributes . environment = environment ;
297- }
298-
299- const span = _getSpanForScope ( currentScope ) ;
300- if ( span ) {
301- // Add the parent span ID to the log attributes for trace context
302- logAttributes [ 'sentry.trace.parent_span_id' ] = span . spanContext ( ) . spanId ;
303- }
304-
305- const serializedLog : SerializedOtelLog = {
306- severityText : level ,
307- body : {
308- stringValue : message ,
309- } ,
310- attributes : Object . entries ( logAttributes ) . map ( ( [ key , value ] ) => logAttributeToSerializedLogAttribute ( key , value ) ) ,
311- timeUnixNano : `${ new Date ( ) . getTime ( ) . toString ( ) } 000000` ,
312- traceId : traceContext ?. trace_id ,
313- severityNumber : severityNumber ?? SEVERITY_TEXT_TO_SEVERITY_NUMBER [ level ] ,
314- } ;
315-
316- this . _logsBuffer . push ( serializedLog ) ;
317- if ( this . _logsBuffer . length > MAX_LOG_BUFFER_SIZE ) {
318- this . _flushLogsBuffer ( ) ;
319- }
320- }
321-
322264 /**
323265 * Get the current Dsn.
324266 */
@@ -358,7 +300,6 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
358300 * still events in the queue when the timeout is reached.
359301 */
360302 public flush ( timeout ?: number ) : PromiseLike < boolean > {
361- this . _flushLogsBuffer ( ) ;
362303 const transport = this . _transport ;
363304 if ( transport ) {
364305 this . emit ( 'flush' ) ;
@@ -1200,21 +1141,6 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
12001141 this . sendEnvelope ( envelope ) ;
12011142 }
12021143
1203- /**
1204- * Flushes the logs buffer to Sentry.
1205- */
1206- protected _flushLogsBuffer ( ) : void {
1207- if ( this . _logsBuffer . length === 0 ) {
1208- return ;
1209- }
1210-
1211- const envelope = createOtelLogEnvelope ( this . _logsBuffer , this . _options . _metadata , this . _options . tunnel , this . _dsn ) ;
1212- this . _logsBuffer = [ ] ;
1213- // sendEnvelope should not throw
1214- // eslint-disable-next-line @typescript-eslint/no-floating-promises
1215- this . sendEnvelope ( envelope ) ;
1216- }
1217-
12181144 /**
12191145 * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.
12201146 */
0 commit comments