Class OpenTelemetryMetricsCollector.Builder
java.lang.Object
com.soklet.otel.OpenTelemetryMetricsCollector.Builder
- Enclosing class:
OpenTelemetryMetricsCollector
Builder used to construct instances of
OpenTelemetryMetricsCollector.- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the collector.instrumentationName(@NonNull String instrumentationName) Sets the instrumentation scope name to use when constructing a meter.instrumentationVersion(@Nullable String instrumentationVersion) Sets an optional instrumentation scope version to use when constructing a meter.Sets a specific meter to use for metric instruments.metricNamingStrategy(@NonNull OpenTelemetryMetricsCollector.MetricNamingStrategy metricNamingStrategy) Sets the naming strategy for HTTP metrics.openTelemetry(@NonNull OpenTelemetry openTelemetry) Sets the OpenTelemetry API object used to construct a meter ifmeter(Meter)is not set.
-
Method Details
-
meter
Sets a specific meter to use for metric instruments.- Parameters:
meter- the meter to use- Returns:
- this builder
-
openTelemetry
public @NonNull OpenTelemetryMetricsCollector.Builder openTelemetry(@NonNull OpenTelemetry openTelemetry) Sets the OpenTelemetry API object used to construct a meter ifmeter(Meter)is not set.- Parameters:
openTelemetry- the OpenTelemetry instance- Returns:
- this builder
-
metricNamingStrategy
public @NonNull OpenTelemetryMetricsCollector.Builder metricNamingStrategy(@NonNull OpenTelemetryMetricsCollector.MetricNamingStrategy metricNamingStrategy) Sets the naming strategy for HTTP metrics.- Parameters:
metricNamingStrategy- the naming strategy- Returns:
- this builder
-
instrumentationName
public @NonNull OpenTelemetryMetricsCollector.Builder instrumentationName(@NonNull String instrumentationName) Sets the instrumentation scope name to use when constructing a meter.- Parameters:
instrumentationName- the instrumentation scope name- Returns:
- this builder
-
instrumentationVersion
public @NonNull OpenTelemetryMetricsCollector.Builder instrumentationVersion(@Nullable String instrumentationVersion) Sets an optional instrumentation scope version to use when constructing a meter.- Parameters:
instrumentationVersion- the instrumentation scope version, ornull- Returns:
- this builder
-
build
Builds the collector.- Returns:
- the collector instance
-