|
|
|
@ -137,6 +137,24 @@ class OtlpMetricsPropertiesConfigAdapterTests { |
|
|
|
HistogramFlavor.BASE2_EXPONENTIAL_BUCKET_HISTOGRAM); |
|
|
|
HistogramFlavor.BASE2_EXPONENTIAL_BUCKET_HISTOGRAM); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
void useDefaultPublishMaxGaugeForHistogramsWhenNotSet() { |
|
|
|
|
|
|
|
assertThat(this.properties.getPublishMaxGaugeForHistograms()).isNull(); |
|
|
|
|
|
|
|
assertThat(createAdapter().publishMaxGaugeForHistograms()).isTrue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
void whenDefaultPublishMaxGaugeForHistogramsIsSetAdapterUsesIt() { |
|
|
|
|
|
|
|
this.properties.setPublishMaxGaugeForHistograms(false); |
|
|
|
|
|
|
|
assertThat(createAdapter().publishMaxGaugeForHistograms()).isFalse(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
void whenAggregationTemporalityIsSetToDeltaThenPublishMaxGaugeForHistogramsDefaultChanges() { |
|
|
|
|
|
|
|
this.properties.setAggregationTemporality(AggregationTemporality.DELTA); |
|
|
|
|
|
|
|
assertThat(createAdapter().publishMaxGaugeForHistograms()).isFalse(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
void whenPropertiesMaxScaleIsNotSetAdapterMaxScaleReturns20() { |
|
|
|
void whenPropertiesMaxScaleIsNotSetAdapterMaxScaleReturns20() { |
|
|
|
assertThat(createAdapter().maxScale()).isEqualTo(20); |
|
|
|
assertThat(createAdapter().maxScale()).isEqualTo(20); |
|
|
|
@ -219,24 +237,6 @@ class OtlpMetricsPropertiesConfigAdapterTests { |
|
|
|
assertThat(createAdapter().resourceAttributes()).doesNotContainKey("service.namespace"); |
|
|
|
assertThat(createAdapter().resourceAttributes()).doesNotContainKey("service.namespace"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
void useDefaultPublishMaxGaugeForHistogramsWhenNotSet() { |
|
|
|
|
|
|
|
assertThat(this.properties.getPublishMaxGaugeForHistograms()).isNull(); |
|
|
|
|
|
|
|
assertThat(createAdapter().publishMaxGaugeForHistograms()).isTrue(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
void whenDefaultPublishMaxGaugeForHistogramsIsSetAdapterUsesIt() { |
|
|
|
|
|
|
|
this.properties.setPublishMaxGaugeForHistograms(false); |
|
|
|
|
|
|
|
assertThat(createAdapter().publishMaxGaugeForHistograms()).isFalse(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
void whenAggregationTemporalityIsSetToDeltaThenPublishMaxGaugeForHistogramsDefaultChanges() { |
|
|
|
|
|
|
|
this.properties.setAggregationTemporality(AggregationTemporality.DELTA); |
|
|
|
|
|
|
|
assertThat(createAdapter().publishMaxGaugeForHistograms()).isFalse(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private OtlpMetricsPropertiesConfigAdapter createAdapter() { |
|
|
|
private OtlpMetricsPropertiesConfigAdapter createAdapter() { |
|
|
|
return new OtlpMetricsPropertiesConfigAdapter(this.properties, this.openTelemetryProperties, |
|
|
|
return new OtlpMetricsPropertiesConfigAdapter(this.properties, this.openTelemetryProperties, |
|
|
|
this.connectionDetails, this.environment); |
|
|
|
this.connectionDetails, this.environment); |
|
|
|
|