@@ -2,17 +2,14 @@ import 'dart:async';
2
2
import 'dart:collection' ;
3
3
4
4
import 'package:meta/meta.dart' ;
5
- import 'metrics/metric.dart' ;
6
- import 'metrics/metrics_aggregator.dart' ;
7
- import 'metrics/metrics_api.dart' ;
8
- import 'profiling.dart' ;
9
- import 'propagation_context.dart' ;
10
- import 'transport/data_category.dart' ;
11
5
12
6
import '../sentry.dart' ;
13
7
import 'client_reports/discard_reason.dart' ;
8
+ import 'profiling.dart' ;
9
+ import 'propagation_context.dart' ;
14
10
import 'sentry_tracer.dart' ;
15
11
import 'sentry_traces_sampler.dart' ;
12
+ import 'transport/data_category.dart' ;
16
13
17
14
/// Configures the scope through the callback.
18
15
typedef ScopeCallback = FutureOr <void > Function (Scope );
@@ -41,16 +38,6 @@ class Hub {
41
38
42
39
late final _WeakMap _throwableToSpan;
43
40
44
- late final MetricsApi _metricsApi;
45
-
46
- @internal
47
- @Deprecated (
48
- 'Metrics will be deprecated and removed in the next major release. Sentry will reject all metrics sent after October 7, 2024. Learn more: https://sentry.zendesk.com/hc/en-us/articles/26369339769883-Upcoming-API-Changes-to-Metrics' )
49
- MetricsApi get metricsApi => _metricsApi;
50
-
51
- @internal
52
- MetricsAggregator ? get metricsAggregator => _peek ().client.metricsAggregator;
53
-
54
41
factory Hub (SentryOptions options) {
55
42
_validateOptions (options);
56
43
@@ -62,7 +49,6 @@ class Hub {
62
49
_stack.add (_StackItem (_getClient (_options), Scope (_options)));
63
50
_isEnabled = true ;
64
51
_throwableToSpan = _WeakMap (_options);
65
- _metricsApi = MetricsApi (hub: this );
66
52
}
67
53
68
54
static void _validateOptions (SentryOptions options) {
@@ -634,45 +620,6 @@ class Hub {
634
620
return sentryId;
635
621
}
636
622
637
- @internal
638
- Future <SentryId > captureMetrics (
639
- Map <int , Iterable <Metric >> metricsBuckets) async {
640
- var sentryId = SentryId .empty ();
641
-
642
- if (! _isEnabled) {
643
- _options.logger (
644
- SentryLevel .warning,
645
- "Instance is disabled and this 'captureMetrics' call is a no-op." ,
646
- );
647
- } else if (! _options.enableMetrics) {
648
- _options.logger (
649
- SentryLevel .info,
650
- "Metrics are disabled and this 'captureMetrics' call is a no-op." ,
651
- );
652
- } else if (metricsBuckets.isEmpty) {
653
- _options.logger (
654
- SentryLevel .info,
655
- "Metrics are empty and this 'captureMetrics' call is a no-op." ,
656
- );
657
- } else {
658
- final item = _peek ();
659
- try {
660
- sentryId = await item.client.captureMetrics (metricsBuckets);
661
- } catch (exception, stackTrace) {
662
- _options.logger (
663
- SentryLevel .error,
664
- 'Error while capturing metrics.' ,
665
- exception: exception,
666
- stackTrace: stackTrace,
667
- );
668
- if (_options.automatedTestMode) {
669
- rethrow ;
670
- }
671
- }
672
- }
673
- return sentryId;
674
- }
675
-
676
623
@internal
677
624
void setSpanContext (
678
625
dynamic throwable,
0 commit comments