@@ -116,19 +116,17 @@ public OtlpMeterRegistry(OtlpConfig config, Clock clock) {
116
116
* @since 1.14.0
117
117
*/
118
118
public OtlpMeterRegistry (OtlpConfig config , Clock clock , ThreadFactory threadFactory ) {
119
- this (config , clock , threadFactory , new OtlpHttpMetricsSender (new HttpUrlConnectionSender ()),
120
- HistogramFlavorPerMeterLookup .DEFAULT , MaxBucketsPerMeterLookup .DEFAULT );
119
+ this (config , clock , threadFactory , new OtlpHttpMetricsSender (new HttpUrlConnectionSender ()));
121
120
}
122
121
123
122
private OtlpMeterRegistry (OtlpConfig config , Clock clock , ThreadFactory threadFactory ,
124
- OtlpMetricsSender metricsSender , HistogramFlavorPerMeterLookup histogramFlavorPerMeterLookup ,
125
- MaxBucketsPerMeterLookup maxBucketsPerMeterLookup ) {
123
+ OtlpMetricsSender metricsSender ) {
126
124
super (config , clock );
127
125
this .config = config ;
128
126
this .baseTimeUnit = config .baseTimeUnit ();
129
127
this .metricsSender = metricsSender ;
130
- this .histogramFlavorPerMeterLookup = histogramFlavorPerMeterLookup ;
131
- this .maxBucketsPerMeterLookup = maxBucketsPerMeterLookup ;
128
+ this .histogramFlavorPerMeterLookup = HistogramFlavorPerMeterLookup . DEFAULT ;
129
+ this .maxBucketsPerMeterLookup = MaxBucketsPerMeterLookup . DEFAULT ;
132
130
this .resource = Resource .newBuilder ().addAllAttributes (getResourceAttributes ()).build ();
133
131
this .aggregationTemporality = config .aggregationTemporality ();
134
132
config ().namingConvention (NamingConvention .dot );
@@ -510,11 +508,10 @@ static double[] getSloWithPositiveInf(DistributionStatisticConfig distributionSt
510
508
511
509
/**
512
510
* Overridable lookup mechanism for {@link HistogramFlavor}.
513
- *
514
- * @since 1.15.0
515
511
*/
512
+ // VisibleForTesting
516
513
@ FunctionalInterface
517
- public interface HistogramFlavorPerMeterLookup {
514
+ interface HistogramFlavorPerMeterLookup {
518
515
519
516
/**
520
517
* Default implementation.
@@ -542,11 +539,10 @@ public interface HistogramFlavorPerMeterLookup {
542
539
/**
543
540
* Overridable lookup mechanism for max bucket count. This has no effect on a meter if
544
541
* it does not have an exponential bucket histogram configured.
545
- *
546
- * @since 1.15.0
547
542
*/
543
+ // VisibleForTesting
548
544
@ FunctionalInterface
549
- public interface MaxBucketsPerMeterLookup {
545
+ interface MaxBucketsPerMeterLookup {
550
546
551
547
/**
552
548
* Default implementation.
@@ -610,15 +606,9 @@ public static class Builder {
610
606
611
607
private OtlpMetricsSender metricsSender ;
612
608
613
- private HistogramFlavorPerMeterLookup histogramFlavorPerMeterLookup ;
614
-
615
- private MaxBucketsPerMeterLookup maxBucketsPerMeterLookup ;
616
-
617
609
private Builder (OtlpConfig otlpConfig ) {
618
610
this .otlpConfig = otlpConfig ;
619
611
this .metricsSender = new OtlpHttpMetricsSender (new HttpUrlConnectionSender ());
620
- this .histogramFlavorPerMeterLookup = HistogramFlavorPerMeterLookup .DEFAULT ;
621
- this .maxBucketsPerMeterLookup = MaxBucketsPerMeterLookup .DEFAULT ;
622
612
}
623
613
624
614
/** Override the default clock. */
@@ -644,43 +634,8 @@ public Builder metricsSender(OtlpMetricsSender metricsSender) {
644
634
return this ;
645
635
}
646
636
647
- /**
648
- * Override the default matching behavior to use with
649
- * {@link OtlpConfig#histogramFlavorPerMeter()}. The default behavior is longest
650
- * dot-separated match wins. For example, if
651
- * {@link OtlpConfig#histogramFlavorPerMeter()} has keys {@literal http} and
652
- * {@literal http.server}, an ID with a name {@literal http.server.requests} would
653
- * match with the entry having key {@literal http.server}, whereas an ID with name
654
- * {@literal http.client.requests} would match with the entry having the key
655
- * {@literal http}.
656
- *
657
- * @see OtlpConfig#histogramFlavorPerMeter()
658
- */
659
- public Builder histogramFlavorPerMeterLookup (HistogramFlavorPerMeterLookup histogramFlavorPerMeterLookup ) {
660
- this .histogramFlavorPerMeterLookup = histogramFlavorPerMeterLookup ;
661
- return this ;
662
- }
663
-
664
- /**
665
- * Override the default matching behavior to use with
666
- * {@link OtlpConfig#maxBucketsPerMeter()}. The default behavior is longest
667
- * dot-separated match wins. For example, if
668
- * {@link OtlpConfig#maxBucketsPerMeter()} has keys {@literal http} and
669
- * {@literal http.server}, an ID with a name {@literal http.server.requests} would
670
- * match with the entry having key {@literal http.server}, whereas an ID with name
671
- * {@literal http.client.requests} would match with the entry having the key
672
- * {@literal http}.
673
- *
674
- * @see OtlpConfig#maxBucketsPerMeter()
675
- */
676
- public Builder maxBucketsPerMeterLookup (MaxBucketsPerMeterLookup maxBucketsPerMeterLookup ) {
677
- this .maxBucketsPerMeterLookup = maxBucketsPerMeterLookup ;
678
- return this ;
679
- }
680
-
681
637
public OtlpMeterRegistry build () {
682
- return new OtlpMeterRegistry (otlpConfig , clock , threadFactory , metricsSender , histogramFlavorPerMeterLookup ,
683
- maxBucketsPerMeterLookup );
638
+ return new OtlpMeterRegistry (otlpConfig , clock , threadFactory , metricsSender );
684
639
}
685
640
686
641
}
0 commit comments