com.aliyun.openservices.shade.io.opentelemetry.api.metrics.DefaultMeterProvider Maven / Gradle / Ivy
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package com.aliyun.openservices.shade.com.aliyun.openservices.shade.io.opentelemetry.api.metrics;
/** A {@link MeterProvider} that does nothing. */
class DefaultMeterProvider implements MeterProvider {
@Override
public MeterBuilder meterBuilder(String instrumentationScopeName) {
return BUILDER_INSTANCE;
}
private static final DefaultMeterProvider INSTANCE = new DefaultMeterProvider();
private static final MeterBuilder BUILDER_INSTANCE = new NoopMeterBuilder();
static MeterProvider getInstance() {
return INSTANCE;
}
private DefaultMeterProvider() {}
private static class NoopMeterBuilder implements MeterBuilder {
@Override
public MeterBuilder setSchemaUrl(String schemaUrl) {
return this;
}
@Override
public MeterBuilder setInstrumentationVersion(String instrumentationScopeVersion) {
return this;
}
@Override
public Meter build() {
return DefaultMeter.getInstance();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy