Class GrpcTelemetryBuilder
java.lang.Object
io.opentelemetry.instrumentation.grpc.v1_6.GrpcTelemetryBuilder
A builder of
GrpcTelemetry.-
Method Summary
Modifier and TypeMethodDescriptionaddAttributeExtractor(io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<? super GrpcRequest, ? super io.grpc.Status> attributesExtractor) Adds an additionalAttributesExtractorto invoke to set attributes to instrumented items.addClientAttributeExtractor(io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<? super GrpcRequest, ? super io.grpc.Status> attributesExtractor) Adds an extra client-onlyAttributesExtractorto invoke to set attributes to instrumented items.addServerAttributeExtractor(io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<? super GrpcRequest, ? super io.grpc.Status> attributesExtractor) Adds an extra server-onlyAttributesExtractorto invoke to set attributes to instrumented items.build()Returns a newGrpcTelemetrywith the settings of thisGrpcTelemetryBuilder.setCapturedClientRequestMetadata(List<String> capturedClientRequestMetadata) Sets which metadata request values should be captured as span attributes on client spans.setCapturedServerRequestMetadata(List<String> capturedServerRequestMetadata) Sets which metadata request values should be captured as span attributes on server spans.setCaptureExperimentalSpanAttributes(boolean captureExperimentalSpanAttributes) Sets whether experimental attributes should be set to spans.setClientSpanNameExtractor(Function<io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<GrpcRequest>, ? extends io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<? super GrpcRequest>> clientSpanNameExtractor) Sets custom clientSpanNameExtractorvia transform function.setPeerService(String peerService) Sets thepeer.serviceattribute for http client spans.setServerSpanNameExtractor(Function<io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<GrpcRequest>, ? extends io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<? super GrpcRequest>> serverSpanNameExtractor) Sets custom serverSpanNameExtractorvia transform function.
-
Method Details
-
addAttributeExtractor
@CanIgnoreReturnValue public GrpcTelemetryBuilder addAttributeExtractor(io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<? super GrpcRequest, ? super io.grpc.Status> attributesExtractor) Adds an additionalAttributesExtractorto invoke to set attributes to instrumented items. TheAttributesExtractorwill be executed after all default extractors. -
addClientAttributeExtractor
@CanIgnoreReturnValue public GrpcTelemetryBuilder addClientAttributeExtractor(io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<? super GrpcRequest, ? super io.grpc.Status> attributesExtractor) Adds an extra client-onlyAttributesExtractorto invoke to set attributes to instrumented items. TheAttributesExtractorwill be executed after all default extractors. -
addServerAttributeExtractor
@CanIgnoreReturnValue public GrpcTelemetryBuilder addServerAttributeExtractor(io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<? super GrpcRequest, ? super io.grpc.Status> attributesExtractor) Adds an extra server-onlyAttributesExtractorto invoke to set attributes to instrumented items. TheAttributesExtractorwill be executed after all default extractors. -
setClientSpanNameExtractor
@CanIgnoreReturnValue public GrpcTelemetryBuilder setClientSpanNameExtractor(Function<io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<GrpcRequest>, ? extends io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<? super GrpcRequest>> clientSpanNameExtractor) Sets custom clientSpanNameExtractorvia transform function. -
setServerSpanNameExtractor
@CanIgnoreReturnValue public GrpcTelemetryBuilder setServerSpanNameExtractor(Function<io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<GrpcRequest>, ? extends io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<? super GrpcRequest>> serverSpanNameExtractor) Sets custom serverSpanNameExtractorvia transform function. -
setPeerService
Sets thepeer.serviceattribute for http client spans. -
setCaptureExperimentalSpanAttributes
@CanIgnoreReturnValue public GrpcTelemetryBuilder setCaptureExperimentalSpanAttributes(boolean captureExperimentalSpanAttributes) Sets whether experimental attributes should be set to spans. These attributes may be changed or removed in the future, so only enable this if you know you do not require attributes filled by this instrumentation to be stable across versions -
setCapturedClientRequestMetadata
@CanIgnoreReturnValue public GrpcTelemetryBuilder setCapturedClientRequestMetadata(List<String> capturedClientRequestMetadata) Sets which metadata request values should be captured as span attributes on client spans. -
setCapturedServerRequestMetadata
@CanIgnoreReturnValue public GrpcTelemetryBuilder setCapturedServerRequestMetadata(List<String> capturedServerRequestMetadata) Sets which metadata request values should be captured as span attributes on server spans. -
build
Returns a newGrpcTelemetrywith the settings of thisGrpcTelemetryBuilder.
-