Class GrpcOpenTelemetry.Builder

    • Method Detail

      • sdk

        public GrpcOpenTelemetry.Builder sdk​(io.opentelemetry.api.OpenTelemetry sdk)
        Sets the OpenTelemetry entrypoint to use. This can be used to configure OpenTelemetry by returning the instance created by a io.opentelemetry.sdk.OpenTelemetrySdkBuilder.
      • addOptionalLabel

        public GrpcOpenTelemetry.Builder addOptionalLabel​(String optionalLabelKey)
        Adds optionalLabelKey to all the metrics that can provide value for the optionalLabelKey.
      • enableMetrics

        public GrpcOpenTelemetry.Builder enableMetrics​(Collection<String> enableMetrics)
        Enables the specified metrics for collection and export. By default, only a subset of metrics are enabled.
      • disableAllMetrics

        public GrpcOpenTelemetry.Builder disableAllMetrics()
        Disable all metrics. If set to true all metrics must be explicitly enabled.
      • targetAttributeFilter

        @ExperimentalApi("https://github.com/grpc/grpc-java/issues/12595")
        @IgnoreJRERequirement
        public GrpcOpenTelemetry.Builder targetAttributeFilter​(@Nullable
                                                               Predicate<String> filter)
        Sets an optional filter to control recording of the grpc.target metric attribute.

        If the predicate returns true, the original target is recorded. Otherwise, the target is recorded as "other" to limit metric cardinality.

        If unset, all targets are recorded as-is.