io.micrometer.core.instrument.step.StepRegistryConfig Java Examples

The following examples show how to use io.micrometer.core.instrument.step.StepRegistryConfig. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ElasticConfig.java    From micrometer with Apache License 2.0 6 votes vote down vote up
@Override
default Validated<?> validate() {
    return checkAll(this,
            c -> StepRegistryConfig.validate(c),
            checkRequired("host", ElasticConfig::host),
            checkRequired("index", ElasticConfig::index),
            checkRequired("timestampFieldName", ElasticConfig::timestampFieldName),
            checkRequired("indexDateFormat", ElasticConfig::indexDateFormat)
                    .andThen(v -> v.invalidateWhen(format -> {
                        if (format == null) {
                            return true;
                        }

                        try {
                            DateTimeFormatter.ofPattern(format);
                            return false;
                        } catch (IllegalArgumentException ignored) {
                            return true;
                        }
                    }, "invalid date format", InvalidReason.MALFORMED)),
            checkRequired("indexDateSeparator", ElasticConfig::indexDateSeparator),
            checkRequired("documentType", ElasticConfig::documentType)
    );
}
 
Example #2
Source File: CompositeMeterRegistryTest.java    From micrometer with Apache License 2.0 6 votes vote down vote up
public CountingMeterRegistry() {
    super(new StepRegistryConfig() {
        @Override
        public String prefix() {
            return "test";
        }

        @Override
        public String get(String key) {
            return null;
        }

        @Override
        public boolean enabled() {
            return false;
        }
    }, Clock.SYSTEM);
}
 
Example #3
Source File: KairosConfig.java    From micrometer with Apache License 2.0 5 votes vote down vote up
@Override
default Validated<?> validate() {
    return checkAll(this,
            c -> StepRegistryConfig.validate(c),
            checkRequired("uri", KairosConfig::uri)
    );
}
 
Example #4
Source File: StackdriverConfig.java    From micrometer with Apache License 2.0 5 votes vote down vote up
@Override
default Validated<?> validate() {
    return checkAll(this,
            c -> StepRegistryConfig.validate(c),
            checkRequired("projectId", StackdriverConfig::projectId),
            checkRequired("resourceLabels", StackdriverConfig::resourceLabels),
            checkRequired("resourceType", StackdriverConfig::resourceType),
            checkRequired("credentials", StackdriverConfig::credentials)
    );
}
 
Example #5
Source File: CloudWatchConfig.java    From micrometer with Apache License 2.0 5 votes vote down vote up
@Override
default Validated<?> validate() {
    return checkAll(this,
            (CloudWatchConfig c) -> StepRegistryConfig.validate(c),
            checkRequired("namespace", CloudWatchConfig::namespace),
            check("batchSize", CloudWatchConfig::batchSize)
                    .andThen(v -> v.invalidateWhen(b -> b > MAX_BATCH_SIZE, "cannot be greater than " + MAX_BATCH_SIZE,
                            InvalidReason.MALFORMED))
    );
}
 
Example #6
Source File: DatadogConfig.java    From micrometer with Apache License 2.0 5 votes vote down vote up
@Override
default Validated<?> validate() {
    return checkAll(this,
            c -> StepRegistryConfig.validate(c),
            checkRequired("apiKey", DatadogConfig::apiKey),
            checkRequired("uri", DatadogConfig::uri)
    );
}
 
Example #7
Source File: InfluxConfig.java    From micrometer with Apache License 2.0 5 votes vote down vote up
@Override
default Validated<?> validate() {
    return checkAll(this,
            c -> StepRegistryConfig.validate(c),
            checkRequired("db", InfluxConfig::db),
            checkRequired("consistency", InfluxConfig::consistency),
            checkRequired("uri", InfluxConfig::uri)
    );
}
 
Example #8
Source File: GangliaConfig.java    From micrometer with Apache License 2.0 5 votes vote down vote up
@Override
default Validated<?> validate() {
    return checkAll(this,
            c -> StepRegistryConfig.validate(c),
            checkRequired("host", GangliaConfig::host),
            check("port", GangliaConfig::port),
            checkRequired("ttl", GangliaConfig::ttl),
            checkRequired("durationUnits", GangliaConfig::durationUnits),
            checkRequired("addressingMode", GangliaConfig::addressingMode)
    );
}
 
Example #9
Source File: SignalFxConfig.java    From micrometer with Apache License 2.0 5 votes vote down vote up
@Override
default Validated<?> validate() {
    return checkAll(this,
            c -> StepRegistryConfig.validate(c),
            checkRequired("accessToken", SignalFxConfig::accessToken),
            checkRequired("uri", SignalFxConfig::uri),
            checkRequired("source", SignalFxConfig::source)
    );
}
 
Example #10
Source File: DynatraceConfig.java    From micrometer with Apache License 2.0 5 votes vote down vote up
@Override
default Validated<?> validate() {
    return checkAll(this,
            c -> StepRegistryConfig.validate(c),
            checkRequired("apiToken", DynatraceConfig::apiToken),
            checkRequired("uri", DynatraceConfig::uri),
            checkRequired("deviceId", DynatraceConfig::deviceId),
            check("technologyType", DynatraceConfig::technologyType).andThen(Validated::nonBlank)
    );
}
 
Example #11
Source File: AppOpticsConfig.java    From micrometer with Apache License 2.0 5 votes vote down vote up
@Override
default Validated<?> validate() {
    return checkAll(this,
            c -> StepRegistryConfig.validate(c),
            checkRequired("apiToken", AppOpticsConfig::apiToken),
            checkRequired("uri", AppOpticsConfig::uri),
            check("batchSize", AppOpticsConfig::batchSize)
                    .andThen(v -> v.invalidateWhen(b -> b > MAX_BATCH_SIZE, "cannot be greater than " + MAX_BATCH_SIZE,
                            InvalidReason.MALFORMED))
    );
}
 
Example #12
Source File: AzureMonitorConfig.java    From micrometer with Apache License 2.0 5 votes vote down vote up
@Override
default Validated<?> validate() {
    return checkAll(this,
            c -> StepRegistryConfig.validate(c),
            check("instrumentationKey", AzureMonitorConfig::instrumentationKey)
    );
}
 
Example #13
Source File: NewRelicConfig.java    From micrometer with Apache License 2.0 5 votes vote down vote up
@Override
default Validated<?> validate() {
    return checkAll(this,
            c -> StepRegistryConfig.validate(c),
            check("eventType", NewRelicConfig::eventType)
                    .andThen(v -> v.invalidateWhen(type -> isBlank(type) && !meterNameEventTypeEnabled(),
                            "event type is required when not using the meter name as the event type",
                            InvalidReason.MISSING)),
            checkRequired("clientProviderType", NewRelicConfig::clientProviderType)
    );
}
 
Example #14
Source File: HumioConfig.java    From micrometer with Apache License 2.0 5 votes vote down vote up
@Override
default Validated<?> validate() {
    return checkAll(this,
            c -> StepRegistryConfig.validate(c),
            checkRequired("uri", HumioConfig::uri)
    );
}
 
Example #15
Source File: PushMeterRegistryTest.java    From micrometer with Apache License 2.0 4 votes vote down vote up
public ThrowingPushMeterRegistry(StepRegistryConfig config, CountDownLatch countDownLatch) {
    super(config, new MockClock());
    this.countDownLatch = countDownLatch;
}
 
Example #16
Source File: StepRegistryPropertiesConfigAdapter.java    From foremast with Apache License 2.0 4 votes vote down vote up
@Override
public int batchSize() {
    return get(T::getBatchSize, StepRegistryConfig.super::batchSize);
}
 
Example #17
Source File: StepRegistryPropertiesConfigAdapter.java    From foremast with Apache License 2.0 4 votes vote down vote up
@Override
public int numThreads() {
    return get(T::getNumThreads, StepRegistryConfig.super::numThreads);
}
 
Example #18
Source File: StepRegistryPropertiesConfigAdapter.java    From foremast with Apache License 2.0 4 votes vote down vote up
@Override
public Duration readTimeout() {
    return get(T::getReadTimeout, StepRegistryConfig.super::readTimeout);
}
 
Example #19
Source File: StepRegistryPropertiesConfigAdapter.java    From foremast with Apache License 2.0 4 votes vote down vote up
@Override
public Duration connectTimeout() {
    return get(T::getConnectTimeout, StepRegistryConfig.super::connectTimeout);
}
 
Example #20
Source File: StepRegistryPropertiesConfigAdapter.java    From foremast with Apache License 2.0 4 votes vote down vote up
@Override
public boolean enabled() {
    return get(T::isEnabled, StepRegistryConfig.super::enabled);
}
 
Example #21
Source File: StepRegistryPropertiesConfigAdapter.java    From foremast with Apache License 2.0 4 votes vote down vote up
@Override
public Duration step() {
    return get(T::getStep, StepRegistryConfig.super::step);
}
 
Example #22
Source File: StepRegistryPropertiesConfigAdapter.java    From foremast with Apache License 2.0 4 votes vote down vote up
@Override
public int batchSize() {
    return get(T::getBatchSize, StepRegistryConfig.super::batchSize);
}
 
Example #23
Source File: StepRegistryPropertiesConfigAdapter.java    From foremast with Apache License 2.0 4 votes vote down vote up
@Override
public int numThreads() {
    return get(T::getNumThreads, StepRegistryConfig.super::numThreads);
}
 
Example #24
Source File: StepRegistryPropertiesConfigAdapter.java    From foremast with Apache License 2.0 4 votes vote down vote up
@Override
public Duration readTimeout() {
    return get(T::getReadTimeout, StepRegistryConfig.super::readTimeout);
}
 
Example #25
Source File: StepRegistryPropertiesConfigAdapter.java    From foremast with Apache License 2.0 4 votes vote down vote up
@Override
public Duration connectTimeout() {
    return get(T::getConnectTimeout, StepRegistryConfig.super::connectTimeout);
}
 
Example #26
Source File: StepRegistryPropertiesConfigAdapter.java    From foremast with Apache License 2.0 4 votes vote down vote up
@Override
public boolean enabled() {
    return get(T::isEnabled, StepRegistryConfig.super::enabled);
}
 
Example #27
Source File: StepRegistryPropertiesConfigAdapter.java    From foremast with Apache License 2.0 4 votes vote down vote up
@Override
public Duration step() {
    return get(T::getStep, StepRegistryConfig.super::step);
}