Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
1a4b78b
Add TelemetryProcessor for span and log buffering
buenaflor Jan 14, 2026
3897122
Remove SpanV2 and TraceLifecycle dependencies
buenaflor Jan 14, 2026
2c617bb
Remove span-related tests from sentry_client_test
buenaflor Jan 14, 2026
6ef8c3c
Remove span-related processor tests
buenaflor Jan 14, 2026
3ca4c08
Remove span import from Flutter mocks
buenaflor Jan 14, 2026
9b34042
Fix wiring up
buenaflor Jan 14, 2026
e0b564c
Update
buenaflor Jan 14, 2026
6da49c8
Update
buenaflor Jan 14, 2026
1b97198
Update CHANGELOG
buenaflor Jan 14, 2026
82a4374
Update
buenaflor Jan 14, 2026
1a48756
Update
buenaflor Jan 14, 2026
1081ca3
Update
buenaflor Jan 14, 2026
ffd9fc7
Update
buenaflor Jan 15, 2026
b56a272
Update
buenaflor Jan 15, 2026
586ae3d
Update
buenaflor Jan 15, 2026
26d0577
Merge branch 'main' into feat/metrics
buenaflor Jan 15, 2026
1f7ba8f
Merge branch 'main' into feat/metrics
buenaflor Jan 17, 2026
33f991f
feat: integrate telemetry metrics into Sentry options and core functi…
buenaflor Jan 17, 2026
b6bff0d
feat: implement SentryMetrics with Default and NoOp implementations
buenaflor Jan 17, 2026
95fb48d
Merge branch 'main' into feat/metrics
buenaflor Jan 19, 2026
435917d
feat: enhance telemetry metrics with MetricCapturePipeline and defaul…
buenaflor Jan 19, 2026
07b5051
Add more tests
buenaflor Jan 19, 2026
875ca84
feat: enhance metric capturing and logging in MetricCapturePipeline a…
buenaflor Jan 20, 2026
b5eee19
feat: enhance Sentry attribute formatting and replay integration
buenaflor Jan 20, 2026
61bb4bc
feat: include unit in DefaultSentryMetrics and update tests
buenaflor Jan 20, 2026
5b55d0a
fix: update metric logging to use processed metrics
buenaflor Jan 20, 2026
264f72b
Fix missing spec
buenaflor Jan 20, 2026
f49e371
Update CHANGELOG
buenaflor Jan 20, 2026
5cfeba6
Add examples
buenaflor Jan 20, 2026
ee01dbb
Merge branch 'main' into feat/metrics
buenaflor Jan 20, 2026
fbfcc74
Update doc
buenaflor Jan 20, 2026
c7ca90c
Update doc
buenaflor Jan 20, 2026
7f3b491
Update
buenaflor Jan 20, 2026
c4221aa
Update
buenaflor Jan 20, 2026
2a553a2
Update docs
buenaflor Jan 20, 2026
ba9930c
Add support for 'trace_metric' category in RateLimitParser and corres…
buenaflor Jan 20, 2026
e3e55a5
Update comments
buenaflor Jan 20, 2026
e92efaf
Add SentryMetricUnit constants
buenaflor Jan 20, 2026
d530afc
Fix compilation
buenaflor Jan 20, 2026
eb2cad9
Fix analyze
buenaflor Jan 20, 2026
3282f7a
Update
buenaflor Jan 20, 2026
71e67b7
Refactor SentryMetrics handling in SentryOptions to use a private var…
buenaflor Jan 20, 2026
cd836b5
Refactor SentryMetrics in SentryOptions to use a late variable for im…
buenaflor Jan 20, 2026
2648213
Add close
buenaflor Jan 20, 2026
98f48fd
Add close test
buenaflor Jan 20, 2026
756de8a
Refactor logging integration by replacing LogsEnricherIntegration wit…
buenaflor Jan 20, 2026
1f2dc29
Enhance logging tests by adding timestamp verification and attribute …
buenaflor Jan 20, 2026
25b0de7
Refactor SentryLog constructor to require traceId and adjust spanId i…
buenaflor Jan 20, 2026
747259d
Update SentryMetrics initialization in SentryOptions to use a constan…
buenaflor Jan 20, 2026
98bdb7a
Merge branch 'feat/metrics' into ref/log-capture-pipeline
buenaflor Jan 20, 2026
0919930
Refactor logger tests to improve readability by formatting logger.inf…
buenaflor Jan 20, 2026
5055a7e
Remove deprecated test for LogsEnricherIntegration from load_contexts…
buenaflor Jan 20, 2026
d253868
Remove unused import for LogsEnricherIntegration in load_contexts_int…
buenaflor Jan 20, 2026
6cc1513
Use unawaited
buenaflor Jan 21, 2026
f88caed
Merge branch 'feat/metrics' into ref/log-capture-pipeline
buenaflor Jan 21, 2026
f83fc08
Update comment
buenaflor Jan 21, 2026
f8bb409
Update test
buenaflor Jan 21, 2026
b4f5115
Update test
buenaflor Jan 21, 2026
7991bea
Update test
buenaflor Jan 21, 2026
ecc965e
Merge branch 'feat/metrics' into ref/log-capture-pipeline
buenaflor Jan 21, 2026
bbf6e40
Merge branch 'ref/log-capture-pipeline' of github.com:getsentry/sentr…
buenaflor Jan 21, 2026
8534d99
Remove logs enricher
buenaflor Jan 21, 2026
a2674f5
Update tests
buenaflor Jan 21, 2026
6a658cb
Update tests
buenaflor Jan 21, 2026
a786f9f
Update tests
buenaflor Jan 21, 2026
e25645b
Update
buenaflor Jan 21, 2026
b70eee8
Update
buenaflor Jan 21, 2026
7af466a
Update
buenaflor Jan 21, 2026
005a601
Update mocks
buenaflor Jan 21, 2026
647b792
Fix cursor review
buenaflor Jan 21, 2026
4c73da9
Update
buenaflor Jan 21, 2026
5a6123a
Update
buenaflor Jan 21, 2026
86220bd
Update
buenaflor Jan 21, 2026
7b61969
Update
buenaflor Jan 21, 2026
8c29471
Update
buenaflor Jan 21, 2026
58a9bf1
Update
buenaflor Jan 21, 2026
6bb8e65
Update
buenaflor Jan 21, 2026
d74fbc8
Merge branch 'feat/metrics' into ref/log-capture-pipeline
buenaflor Jan 21, 2026
7dc6a2b
Update
buenaflor Jan 21, 2026
813c902
Update
buenaflor Jan 22, 2026
0980050
Merge branch 'feat/metrics' into ref/log-capture-pipeline
buenaflor Jan 22, 2026
e554957
Use export barrel file
buenaflor Jan 22, 2026
e3b882b
Fix analyzer
buenaflor Jan 22, 2026
0d6b55d
Fix review
buenaflor Jan 22, 2026
b1a8690
Fix asserts
buenaflor Jan 22, 2026
b12493b
Merge branch 'feat/metrics' into ref/log-capture-pipeline
buenaflor Jan 22, 2026
87fd7a9
Merge branch 'main' into ref/log-capture-pipeline
buenaflor Jan 22, 2026
d2290ea
Fix analyze
buenaflor Jan 22, 2026
4fbe493
Update CHANGELOG
buenaflor Jan 22, 2026
36e26c0
Update test
buenaflor Jan 22, 2026
4e9efad
Update test
buenaflor Jan 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
- `Sentry.metrics.count(...)`
- `Sentry.metrics.distribution(...)`

### Enhancements

- Refactor Logging API to be consistent with Metrics ([#3463](https://github.com/getsentry/sentry-dart/pull/3463))

### Dependencies

- Bump Android SDK from v8.28.0 to v8.30.0 ([#3451](https://github.com/getsentry/sentry-dart/pull/3451))
Expand Down
1 change: 0 additions & 1 deletion packages/dart/lib/sentry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export 'src/utils/tracing_utils.dart';
export 'src/utils/url_details.dart';
// ignore: invalid_export_of_internal_element
export 'src/utils/breadcrumb_log_level.dart';
export 'src/sentry_logger.dart';
export 'src/telemetry/telemetry.dart';
// ignore: invalid_export_of_internal_element
export 'src/utils/internal_logger.dart' show SentryInternalLogger;
37 changes: 0 additions & 37 deletions packages/dart/lib/src/logs_enricher_integration.dart

This file was deleted.

4 changes: 2 additions & 2 deletions packages/dart/lib/src/protocol.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ export 'protocol/span_status.dart';
export 'sentry_event_like.dart';
export 'protocol/sentry_feature_flag.dart';
export 'protocol/sentry_feature_flags.dart';
export 'protocol/sentry_log.dart';
export 'protocol/sentry_log_level.dart';
export 'telemetry/log/log.dart';
export 'telemetry/log/log_level.dart';
export 'protocol/sentry_attribute.dart';
4 changes: 2 additions & 2 deletions packages/dart/lib/src/sdk_lifecycle_hooks.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ class SdkLifecycleRegistry {
}

@internal
class OnBeforeCaptureLog extends SdkLifecycleEvent {
OnBeforeCaptureLog(this.log);
class OnProcessLog extends SdkLifecycleEvent {
OnProcessLog(this.log);

final SentryLog log;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/dart/lib/src/sentry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import 'tracing.dart';
import 'transport/data_category.dart';
import 'transport/task_queue.dart';
import 'feature_flags_integration.dart';
import 'sentry_logger.dart';
import 'logs_enricher_integration.dart';
import 'telemetry/log/logger.dart';
import 'telemetry/log/logger_setup_integration.dart';

/// Configuration options callback
typedef OptionsConfiguration = FutureOr<void> Function(SentryOptions);
Expand Down Expand Up @@ -113,8 +113,8 @@ class Sentry {
}

options.addIntegration(MetricsSetupIntegration());
options.addIntegration(LoggerSetupIntegration());
options.addIntegration(FeatureFlagsIntegration());
options.addIntegration(LogsEnricherIntegration());
options.addIntegration(InMemoryTelemetryProcessorIntegration());

options.addEventProcessor(EnricherEventProcessor(options));
Expand Down
107 changes: 12 additions & 95 deletions packages/dart/lib/src/sentry_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import 'sentry_exception_factory.dart';
import 'sentry_options.dart';
import 'sentry_stack_trace_factory.dart';
import 'sentry_trace_context_header.dart';
import 'telemetry/log/log_capture_pipeline.dart';
import 'telemetry/metric/metric.dart';
import 'telemetry/metric/metric_capture_pipeline.dart';
import 'transport/client_report_transport.dart';
Expand All @@ -44,6 +45,7 @@ String get defaultIpAddress => _defaultIpAddress;
class SentryClient {
final SentryOptions _options;
final Random? _random;
final LogCapturePipeline _logCapturePipeline;
final MetricCapturePipeline _metricCapturePipeline;

static final _emptySentryId = Future.value(SentryId.empty());
Expand All @@ -53,7 +55,8 @@ class SentryClient {

/// Instantiates a client using [SentryOptions]
factory SentryClient(SentryOptions options,
{MetricCapturePipeline? metricCapturePipeline}) {
{LogCapturePipeline? logCapturePipeline,
MetricCapturePipeline? metricCapturePipeline}) {
if (options.sendClientReports) {
options.recorder = ClientReportRecorder(options.clock);
}
Expand All @@ -79,11 +82,15 @@ class SentryClient {
options.transport = SpotlightHttpTransport(options, options.transport);
}
return SentryClient._(
options, metricCapturePipeline ?? MetricCapturePipeline(options));
options,
logCapturePipeline ?? LogCapturePipeline(options),
metricCapturePipeline ?? MetricCapturePipeline(options),
);
}

/// Instantiates a client using [SentryOptions]
SentryClient._(this._options, this._metricCapturePipeline)
SentryClient._(
this._options, this._logCapturePipeline, this._metricCapturePipeline)
: _random = _options.sampleRate == null ? null : Random();

/// Reports an [event] to Sentry.io.
Expand Down Expand Up @@ -495,98 +502,8 @@ class SentryClient {
}

@internal
FutureOr<void> captureLog(
SentryLog log, {
Scope? scope,
}) async {
if (!_options.enableLogs) {
return;
}

if (scope != null) {
final merged = Map.of(scope.attributes)..addAll(log.attributes);
log.attributes = merged;
}

log.attributes['sentry.sdk.name'] = SentryAttribute.string(
_options.sdk.name,
);
log.attributes['sentry.sdk.version'] = SentryAttribute.string(
_options.sdk.version,
);
final environment = _options.environment;
if (environment != null) {
log.attributes['sentry.environment'] = SentryAttribute.string(
environment,
);
}
final release = _options.release;
if (release != null) {
log.attributes['sentry.release'] = SentryAttribute.string(
release,
);
}

final propagationContext = scope?.propagationContext;
if (propagationContext != null) {
log.traceId = propagationContext.traceId;
}
final span = scope?.span;
if (span != null) {
log.attributes['sentry.trace.parent_span_id'] = SentryAttribute.string(
span.context.spanId.toString(),
);
}

final user = scope?.user;
final id = user?.id;
final email = user?.email;
final name = user?.name;
if (id != null) {
log.attributes['user.id'] = SentryAttribute.string(id);
}
if (name != null) {
log.attributes['user.name'] = SentryAttribute.string(name);
}
if (email != null) {
log.attributes['user.email'] = SentryAttribute.string(email);
}

final beforeSendLog = _options.beforeSendLog;
SentryLog? processedLog = log;
if (beforeSendLog != null) {
try {
final callbackResult = beforeSendLog(log);

if (callbackResult is Future<SentryLog?>) {
processedLog = await callbackResult;
} else {
processedLog = callbackResult;
}
} catch (exception, stackTrace) {
_options.log(
SentryLevel.error,
'The beforeSendLog callback threw an exception',
exception: exception,
stackTrace: stackTrace,
);
if (_options.automatedTestMode) {
rethrow;
}
}
}

if (processedLog != null) {
await _options.lifecycleRegistry
.dispatchCallback(OnBeforeCaptureLog(processedLog));
_options.telemetryProcessor.addLog(processedLog);
} else {
_options.recorder.recordLostEvent(
DiscardReason.beforeSend,
DataCategory.logItem,
);
}
}
FutureOr<void> captureLog(SentryLog log, {Scope? scope}) =>
_logCapturePipeline.captureLog(log, scope: scope);

Future<void> captureMetric(SentryMetric metric, {Scope? scope}) =>
_metricCapturePipeline.captureMetric(metric, scope: scope);
Expand Down
95 changes: 0 additions & 95 deletions packages/dart/lib/src/sentry_logger.dart

This file was deleted.

4 changes: 3 additions & 1 deletion packages/dart/lib/src/sentry_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'noop_client.dart';
import 'platform/platform.dart';
import 'sentry_exception_factory.dart';
import 'sentry_stack_trace_factory.dart';
import 'telemetry/log/noop_logger.dart';
import 'telemetry/metric/noop_metrics.dart';
import 'telemetry/processing/processor.dart';
import 'transport/noop_transport.dart';
Expand Down Expand Up @@ -560,7 +561,8 @@ class SentryOptions {
/// Enabling this option may change grouping.
bool includeModuleInStackTrace = false;

late final SentryLogger logger = SentryLogger(clock);
@internal
late SentryLogger logger = const NoOpSentryLogger();

@internal
late SentryMetrics metrics = const NoOpSentryMetrics();
Expand Down
Loading
Loading