Search in sources :

Example 1 with CloudWatchMeterRegistryProvider

use of com.amazon.dataprepper.pipeline.server.CloudWatchMeterRegistryProvider in project data-prepper by opensearch-project.

the class MetricsConfigTest method testGivenConfigWithCloudWatchMeterRegistryThenNoMeterRegistryCreated.

@Test
public void testGivenConfigWithCloudWatchMeterRegistryThenNoMeterRegistryCreated() {
    final CloudWatchMeterRegistryProvider provider = mock(CloudWatchMeterRegistryProvider.class);
    final CloudWatchMeterRegistry expected = mock(CloudWatchMeterRegistry.class);
    final MeterRegistry.Config config = mock(MeterRegistry.Config.class);
    final DataPrepperConfiguration dataPrepperConfiguration = mock(DataPrepperConfiguration.class);
    when(provider.getCloudWatchMeterRegistry()).thenReturn(expected);
    when(expected.config()).thenReturn(config);
    when(dataPrepperConfiguration.getMetricRegistryTypes()).thenReturn(Collections.singletonList(MetricRegistryType.CloudWatch));
    final MeterRegistry meterRegistry = metricsConfig.cloudWatchMeterRegistry(dataPrepperConfiguration, provider);
    assertThat(meterRegistry, is(expected));
}
Also used : CloudWatchMeterRegistryProvider(com.amazon.dataprepper.pipeline.server.CloudWatchMeterRegistryProvider) CloudWatchMeterRegistry(io.micrometer.cloudwatch2.CloudWatchMeterRegistry) DataPrepperConfiguration(com.amazon.dataprepper.parser.model.DataPrepperConfiguration) CompositeMeterRegistry(io.micrometer.core.instrument.composite.CompositeMeterRegistry) EMFLoggingMeterRegistry(com.amazon.dataprepper.meter.EMFLoggingMeterRegistry) MeterRegistry(io.micrometer.core.instrument.MeterRegistry) PrometheusMeterRegistry(io.micrometer.prometheus.PrometheusMeterRegistry) CloudWatchMeterRegistry(io.micrometer.cloudwatch2.CloudWatchMeterRegistry) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Example 2 with CloudWatchMeterRegistryProvider

use of com.amazon.dataprepper.pipeline.server.CloudWatchMeterRegistryProvider in project data-prepper by opensearch-project.

the class CloudWatchMeterRegistryProviderTest method testCreateCloudWatchMeterRegistry.

@Test
public void testCreateCloudWatchMeterRegistry() {
    final CloudWatchMeterRegistryProvider cloudWatchMeterRegistryProvider = new CloudWatchMeterRegistryProvider(TEST_CLOUDWATCH_PROPERTIES, cloudWatchAsyncClient);
    final CloudWatchMeterRegistry cloudWatchMeterRegistry = cloudWatchMeterRegistryProvider.getCloudWatchMeterRegistry();
    assertThat(cloudWatchMeterRegistry, notNullValue());
}
Also used : CloudWatchMeterRegistryProvider(com.amazon.dataprepper.pipeline.server.CloudWatchMeterRegistryProvider) CloudWatchMeterRegistry(io.micrometer.cloudwatch2.CloudWatchMeterRegistry) Test(org.junit.Test)

Aggregations

CloudWatchMeterRegistryProvider (com.amazon.dataprepper.pipeline.server.CloudWatchMeterRegistryProvider)2 CloudWatchMeterRegistry (io.micrometer.cloudwatch2.CloudWatchMeterRegistry)2 EMFLoggingMeterRegistry (com.amazon.dataprepper.meter.EMFLoggingMeterRegistry)1 DataPrepperConfiguration (com.amazon.dataprepper.parser.model.DataPrepperConfiguration)1 MeterRegistry (io.micrometer.core.instrument.MeterRegistry)1 CompositeMeterRegistry (io.micrometer.core.instrument.composite.CompositeMeterRegistry)1 PrometheusMeterRegistry (io.micrometer.prometheus.PrometheusMeterRegistry)1 Test (org.junit.Test)1 Test (org.junit.jupiter.api.Test)1 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1