Package com.google.bigtable.cassandra
Class OpenTelemetryCollectorConfiguration.Builder
java.lang.Object
com.google.bigtable.cassandra.OpenTelemetryCollectorConfiguration.Builder
- Enclosing class:
- OpenTelemetryCollectorConfiguration
Builder for
OpenTelemetryCollectorConfiguration.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract OpenTelemetryCollectorConfigurationbuild()Builds theOpenTelemetryCollectorConfiguration.Disables metrics collection.Disables tracing.enableMetrics(String endpoint) Enables metrics collection by setting the metrics endpoint.enableTracing(String endpoint, double sampleRatio) Enables tracing with the specified endpoint and sampling ratio.setHealthcheckEndpoint(String endpoint) Sets the healthcheck endpoint.protected abstract OpenTelemetryCollectorConfiguration.BuildersetHealthcheckEndpoint(Optional<String> endpoint) protected abstract OpenTelemetryCollectorConfiguration.BuildersetMetricsEndpoint(Optional<String> endpoint) setServiceName(String name) Sets the service name.protected abstract OpenTelemetryCollectorConfiguration.BuildersetTracesEndpoint(Optional<String> endpoint) protected abstract OpenTelemetryCollectorConfiguration.BuildersetTracesSamplingRatio(Optional<Double> ratio)
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setServiceName
Sets the service name.- Parameters:
name- The service name.- Returns:
- This
OpenTelemetryCollectorConfiguration.Builderinstance.
-
setHealthcheckEndpoint
protected abstract OpenTelemetryCollectorConfiguration.Builder setHealthcheckEndpoint(Optional<String> endpoint) -
setHealthcheckEndpoint
Sets the healthcheck endpoint. If not set, health checks will not be reported to the collector.- Parameters:
endpoint- The healthcheck endpoint.- Returns:
- This
OpenTelemetryCollectorConfiguration.Builderinstance.
-
setMetricsEndpoint
protected abstract OpenTelemetryCollectorConfiguration.Builder setMetricsEndpoint(Optional<String> endpoint) -
enableMetrics
Enables metrics collection by setting the metrics endpoint. If not set, metrics will not be reported to the collector.- Parameters:
endpoint- The host and port of the OpenTelemetry collector process (e.g., "localhost:4317").- Returns:
- This
OpenTelemetryCollectorConfiguration.Builderinstance.
-
disableMetrics
Disables metrics collection.- Returns:
- This
OpenTelemetryCollectorConfiguration.Builderinstance.
-
setTracesEndpoint
protected abstract OpenTelemetryCollectorConfiguration.Builder setTracesEndpoint(Optional<String> endpoint) -
setTracesSamplingRatio
protected abstract OpenTelemetryCollectorConfiguration.Builder setTracesSamplingRatio(Optional<Double> ratio) -
enableTracing
public OpenTelemetryCollectorConfiguration.Builder enableTracing(String endpoint, double sampleRatio) Enables tracing with the specified endpoint and sampling ratio. If not set, trace data will not be reported to the collector.- Parameters:
endpoint- The traces endpoint.sampleRatio- The sampling ratio (must be greater than 0, up to 1).- Returns:
- This
OpenTelemetryCollectorConfiguration.Builderinstance. - Throws:
IllegalArgumentException- if the sampleRatio is not greater than 0, or greater than 1
-
disableTracing
Disables tracing.- Returns:
- This
OpenTelemetryCollectorConfiguration.Builderinstance.
-
build
Builds theOpenTelemetryCollectorConfiguration.- Returns:
- The built
OpenTelemetryCollectorConfiguration.
-