Package org.hyperledger.fabric.traces
Interface TracesProvider
-
public interface TracesProviderInterface to be implemented to send traces on the chaincode to the 'backend-of-choice'. An instance of this will be created, and provided with the resources from which chaincode specific metrics can be collected. (via the no-argument constructor). The choice of when, where and what to collect etc are within the remit of the provider. This is the effective call sequence. MyTracesProvider mmp = new MyTracesProvider() mmp.initialize(props_from_environment); // short while later.... mmp.setTaskTracesCollector(taskService);
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default io.grpc.ClientInterceptorcreateInterceptor()Creates an interceptor of gRPC messages that can be injected in processing incoming messages to extract trace information.default io.opentelemetry.api.trace.SpancreateSpan(ChaincodeStub stub)Creates a span with metadata of the current chaincode execution, possibly linked to the execution arguments.default voidinitialize(java.util.Properties props)Initialize method that is called immediately after creation.
-
-
-
Method Detail
-
initialize
default void initialize(java.util.Properties props)
Initialize method that is called immediately after creation.- Parameters:
props-
-
createSpan
default io.opentelemetry.api.trace.Span createSpan(ChaincodeStub stub)
Creates a span with metadata of the current chaincode execution, possibly linked to the execution arguments.- Parameters:
stub- the context of the chaincode execution- Returns:
- a new span if traces are enabled, or null. The caller is responsible for closing explicitly the span.
-
createInterceptor
default io.grpc.ClientInterceptor createInterceptor()
Creates an interceptor of gRPC messages that can be injected in processing incoming messages to extract trace information.- Returns:
- a new client interceptor, or null if no interceptor is set.
-
-