Documentation ¶
Index ¶
- Constants
- Variables
- func IsSampled(span trace.Span) bool
- type LogTracer
- func (t *LogTracer) Done() <-chan struct{}
- func (t *LogTracer) Ready() <-chan struct{}
- func (t *LogTracer) RecordSpanFromParent(span trace.Span, operationName SpanName, duration time.Duration, ...)
- func (t *LogTracer) Start(ctx context.Context, spanName string, _ ...trace.SpanStartOption) (context.Context, trace.Span)
- func (t *LogTracer) StartBlockSpan(ctx context.Context, blockID flow.Identifier, spanName SpanName, ...) (trace.Span, context.Context, bool)
- func (t *LogTracer) StartCollectionSpan(ctx context.Context, collectionID flow.Identifier, spanName SpanName, ...) (trace.Span, context.Context, bool)
- func (t *LogTracer) StartSpanFromContext(ctx context.Context, operationName SpanName, opts ...trace.SpanStartOption) (trace.Span, context.Context)
- func (t *LogTracer) StartSpanFromParent(span trace.Span, operationName SpanName, opts ...trace.SpanStartOption) trace.Span
- func (t *LogTracer) StartTransactionSpan(ctx context.Context, transactionID flow.Identifier, spanName SpanName, ...) (trace.Span, context.Context, bool)
- func (t *LogTracer) WithSpanFromContext(ctx context.Context, operationName SpanName, f func(), ...)
- type NoopTracer
- func (t *NoopTracer) Done() <-chan struct{}
- func (t *NoopTracer) Ready() <-chan struct{}
- func (t *NoopTracer) RecordSpanFromParent(span trace.Span, operationName SpanName, duration time.Duration, ...)
- func (t *NoopTracer) StartBlockSpan(ctx context.Context, entityID flow.Identifier, spanName SpanName, ...) (trace.Span, context.Context, bool)
- func (t *NoopTracer) StartCollectionSpan(ctx context.Context, entityID flow.Identifier, spanName SpanName, ...) (trace.Span, context.Context, bool)
- func (t *NoopTracer) StartSpanFromContext(ctx context.Context, operationName SpanName, opts ...trace.SpanStartOption) (trace.Span, context.Context)
- func (t *NoopTracer) StartSpanFromParent(parentSpan trace.Span, operationName SpanName, opts ...trace.SpanStartOption) trace.Span
- func (t *NoopTracer) StartTransactionSpan(ctx context.Context, entityID flow.Identifier, spanName SpanName, ...) (trace.Span, context.Context, bool)
- func (t *NoopTracer) WithSpanFromContext(ctx context.Context, operationName SpanName, f func(), ...)
- type SpanName
- type Tracer
- func (t *Tracer) Done() <-chan struct{}
- func (t *Tracer) Ready() <-chan struct{}
- func (t *Tracer) RecordSpanFromParent(parentSpan trace.Span, operationName SpanName, duration time.Duration, ...)
- func (t *Tracer) StartBlockSpan(ctx context.Context, blockID flow.Identifier, spanName SpanName, ...) (trace.Span, context.Context, bool)
- func (t *Tracer) StartCollectionSpan(ctx context.Context, collectionID flow.Identifier, spanName SpanName, ...) (trace.Span, context.Context, bool)
- func (t *Tracer) StartSpanFromContext(ctx context.Context, operationName SpanName, opts ...trace.SpanStartOption) (trace.Span, context.Context)
- func (t *Tracer) StartSpanFromParent(parentSpan trace.Span, operationName SpanName, opts ...trace.SpanStartOption) trace.Span
- func (t *Tracer) StartTransactionSpan(ctx context.Context, transactionID flow.Identifier, spanName SpanName, ...) (trace.Span, context.Context, bool)
- func (t *Tracer) WithSpanFromContext(ctx context.Context, operationName SpanName, f func(), ...)
Constants ¶
const DefaultEntityCacheSize = 1000
const EntityTypeBlock = "Block"
const EntityTypeCollection = "Collection"
const EntityTypeTransaction = "Transaction"
const SensitivityCaptureAll = 0
Variables ¶
var (
NoopSpan trace.Span = trace.SpanFromContext(context.Background())
)
Functions ¶
Types ¶
type LogTracer ¶ added in v0.23.1
type LogTracer struct {
// contains filtered or unexported fields
}
LogTracer is the implementation of the Tracer interface which passes all the traces back to the passed logger and print them this is mostly useful for debugging and testing TODO(rbtz): make private
func NewLogTracer ¶ added in v0.23.1
NewLogTracer creates a new zerolog-based tracer. TODO: Consider switching to go.opentelemetry.io/otel/exporters/stdout/stdouttrace
func (*LogTracer) RecordSpanFromParent ¶ added in v0.23.1
func (*LogTracer) Start ¶ added in v0.27.0
func (t *LogTracer) Start(ctx context.Context, spanName string, _ ...trace.SpanStartOption) (context.Context, trace.Span)
Start implements trace.Tracer interface.
func (*LogTracer) StartBlockSpan ¶ added in v0.23.1
func (*LogTracer) StartCollectionSpan ¶ added in v0.23.1
func (*LogTracer) StartSpanFromContext ¶ added in v0.23.1
func (*LogTracer) StartSpanFromParent ¶ added in v0.23.1
func (*LogTracer) StartTransactionSpan ¶ added in v0.23.1
func (t *LogTracer) StartTransactionSpan( ctx context.Context, transactionID flow.Identifier, spanName SpanName, opts ...trace.SpanStartOption, ) (trace.Span, context.Context, bool)
StartTransactionSpan starts a span that will be aggregated under the given transaction. All spans for the same transaction will be aggregated under a root span
func (*LogTracer) WithSpanFromContext ¶ added in v0.23.1
func (t *LogTracer) WithSpanFromContext(ctx context.Context, operationName SpanName, f func(), opts ...trace.SpanStartOption, )
WithSpanFromContext encapsulates executing a function within an span, i.e., it starts a span with the specified SpanName from the context, executes the function f, and finishes the span once the function returns.
type NoopTracer ¶
type NoopTracer struct{}
NoopTracer is the implementation of the Tracer interface. TODO(rbtz): make private
func (*NoopTracer) Done ¶
func (t *NoopTracer) Done() <-chan struct{}
Done returns a channel that will close when shutdown is complete.
func (*NoopTracer) Ready ¶
func (t *NoopTracer) Ready() <-chan struct{}
Ready returns a channel that will close when the network stack is ready.
func (*NoopTracer) RecordSpanFromParent ¶ added in v0.14.5
func (t *NoopTracer) RecordSpanFromParent( span trace.Span, operationName SpanName, duration time.Duration, attrs []attribute.KeyValue, opts ...trace.SpanStartOption, )
func (*NoopTracer) StartBlockSpan ¶ added in v0.22.0
func (t *NoopTracer) StartBlockSpan( ctx context.Context, entityID flow.Identifier, spanName SpanName, opts ...trace.SpanStartOption, ) (trace.Span, context.Context, bool)
func (*NoopTracer) StartCollectionSpan ¶ added in v0.22.0
func (t *NoopTracer) StartCollectionSpan( ctx context.Context, entityID flow.Identifier, spanName SpanName, opts ...trace.SpanStartOption, ) (trace.Span, context.Context, bool)
func (*NoopTracer) StartSpanFromContext ¶
func (t *NoopTracer) StartSpanFromContext( ctx context.Context, operationName SpanName, opts ...trace.SpanStartOption, ) (trace.Span, context.Context)
func (*NoopTracer) StartSpanFromParent ¶
func (t *NoopTracer) StartSpanFromParent( parentSpan trace.Span, operationName SpanName, opts ...trace.SpanStartOption, ) trace.Span
func (*NoopTracer) StartTransactionSpan ¶ added in v0.22.0
func (t *NoopTracer) StartTransactionSpan( ctx context.Context, entityID flow.Identifier, spanName SpanName, opts ...trace.SpanStartOption, ) (trace.Span, context.Context, bool)
func (*NoopTracer) WithSpanFromContext ¶ added in v0.15.0
func (t *NoopTracer) WithSpanFromContext( ctx context.Context, operationName SpanName, f func(), opts ...trace.SpanStartOption, )
type SpanName ¶
type SpanName string
const ( // Extend ProtoStateMutatorExtend SpanName = "proto.state.mutator.extend" ProtoStateMutatorExtendCheckHeader SpanName = "proto.state.mutator.extend.checkHeader" ProtoStateMutatorExtendCheckGuarantees SpanName = "proto.state.mutator.extend.checkGuarantees" ProtoStateMutatorExtendCheckSeals SpanName = "proto.state.mutator.extend.checkSeals" ProtoStateMutatorExtendCheckReceipts SpanName = "proto.state.mutator.extend.checkReceipts" ProtoStateMutatorExtendDBInsert SpanName = "proto.state.mutator.extend.dbInsert" // HeaderExtend ProtoStateMutatorHeaderExtend SpanName = "proto.state.mutator.headerExtend" ProtoStateMutatorHeaderExtendGetLastSealed SpanName = "proto.state.mutator.headerExtend.lastSealed" // mutator.Finalize ProtoStateMutatorFinalize SpanName = "proto.state.mutator.finalize" // Builder CONBuilderBuildOn SpanName = "con.builder.buildOn" // Finalizer CONFinalizerFinalizeBlock SpanName = "con.finalizer.finalizeBlock" // Ingestion CONIngOnCollectionGuarantee SpanName = "con.ingestion.onCollectionGuarantee" // Compliance CONCompOnBlockProposal SpanName = "con.compliance.onBlockProposal" ConCompProcessBlockProposal SpanName = "con.compliance.processBlockProposal" CONCompOnBlockVote SpanName = "con.compliance.onBlockVote" // Matching CONMatchProcessReceipt SpanName = "con.matching.processReceipt" CONMatchProcessReceiptVal SpanName = "con.matching.processReceipt.validation" // Sealing CONSealingProcessFinalizedBlock SpanName = "con.sealing.processFinalizedBlock" CONSealingCheckForEmergencySealableBlocks SpanName = "con.sealing.processFinalizedBlock.checkEmergencySealing" CONSealingPruning SpanName = "con.sealing.processFinalizedBlock.pruning" CONSealingRequestingPendingApproval SpanName = "con.sealing.processFinalizedBlock.requestPendingApprovals" CONSealingProcessIncorporatedResult SpanName = "con.sealing.processIncorporatedResult" CONSealingProcessApproval SpanName = "con.sealing.processApproval" //Follower Engine FollowerOnBlockProposal SpanName = "follower.onBlockProposal" FollowerProcessBlockProposal SpanName = "follower.processBlockProposal" FollowerProcessPendingChildren SpanName = "follower.processPendingChildren" // Builder COLBuildOn SpanName = "col.builder" COLBuildOnSetup SpanName = "col.builder.setup" COLBuildOnUnfinalizedLookup SpanName = "col.builder.unfinalizedLookup" COLBuildOnFinalizedLookup SpanName = "col.builder.finalizedLookup" COLBuildOnCreatePayload SpanName = "col.builder.createPayload" COLBuildOnCreateHeader SpanName = "col.builder.createHeader" COLBuildOnDBInsert SpanName = "col.builder.dbInsert" // Cluster State COLClusterStateMutatorExtend SpanName = "col.state.mutator.extend" COLClusterStateMutatorExtendSetup SpanName = "col.state.mutator.extend.setup" COLClusterStateMutatorExtendCheckAncestry SpanName = "col.state.mutator.extend.ancestry" COLClusterStateMutatorExtendCheckTransactionsValid SpanName = "col.state.mutator.extend.transactions.validity" COLClusterStateMutatorExtendCheckTransactionsDupes SpanName = "col.state.mutator.extend.transactions.dupes" COLClusterStateMutatorExtendDBInsert SpanName = "col.state.mutator.extend.dbInsert" EXEHandleBlock SpanName = "exe.ingestion.handleBlock" EXEHandleCollection SpanName = "exe.ingestion.handleCollection" EXEHandleComputationResult SpanName = "exe.ingestion.handleComputationResult" EXEExecuteBlock SpanName = "exe.ingestion.executeBlock" EXESaveExecutionResults SpanName = "exe.ingestion.saveExecutionResults" EXEUploadCollections SpanName = "exe.manager.uploadCollections" EXEAddToExecutionDataService SpanName = "exe.manager.addToExecutionDataService" EXEBroadcastExecutionReceipt SpanName = "exe.provider.broadcastExecutionReceipt" EXEComputeBlock SpanName = "exe.computer.computeBlock" EXEComputeCollection SpanName = "exe.computer.computeCollection" EXEMergeCollectionView SpanName = "exe.computer.mergeCollectionView" EXEComputeSystemCollection SpanName = "exe.computer.computeSystemCollection" EXEComputeTransaction SpanName = "exe.computer.computeTransaction" EXERunTransaction SpanName = "exe.computer.runTransaction" EXEPostProcessTransaction SpanName = "exe.computer.postProcessTransaction" EXEMergeTransactionView SpanName = "exe.computer.mergeTransactionView" EXEStateSaveExecutionResults SpanName = "exe.state.saveExecutionResults" EXECommitDelta SpanName = "exe.state.commitDelta" EXEGetRegisters SpanName = "exe.state.getRegisters" EXEGetRegistersWithProofs SpanName = "exe.state.getRegistersWithProofs" EXEGetExecutionResultID SpanName = "exe.state.getExecutionResultID" EXEUpdateHighestExecutedBlockIfHigher SpanName = "exe.state.updateHighestExecutedBlockIfHigher" EXEHashEvents SpanName = "exe.state.hashEvents" // Verification node // // assigner engine VERProcessFinalizedBlock SpanName = "ver.processFinalizedBlock" // children of VERProcessFinalizedBlock VERAssignerHandleFinalizedBlock SpanName = "ver.assigner.handleFinalizedBlock" VERAssignerHandleExecutionReceipt SpanName = "ver.assigner.handleExecutionReceipt" VERAssignerChunkAssignment SpanName = "ver.assigner.chunkAssignment" VERAssignerProcessChunk SpanName = "ver.assigner.processChunk" // fetcher engine VERProcessAssignedChunk SpanName = "ver.processAssignedChunk" // children of VERProcessAssignedChunk VERFetcherHandleAssignedChunk SpanName = "ver.fetcher.handleAssignedChunk" VERFetcherHandleChunkDataPack SpanName = "ver.fetcher.handleChunkDataPack" VERFetcherValidateChunkDataPack SpanName = "ver.fetcher.validateChunkDataPack" VERFetcherPushToVerifier SpanName = "ver.fetcher.pushToVerifier" // requester engine VERProcessChunkDataPackRequest SpanName = "ver.processChunkDataPackRequest" // children of VERProcessChunkDataPackRequest VERRequesterHandleChunkDataRequest SpanName = "ver.requester.handleChunkDataRequest" VERRequesterHandleChunkDataResponse SpanName = "ver.requester.handleChunkDataResponse" VERRequesterDispatchChunkDataRequest SpanName = "ver.requester.dispatchChunkDataRequest" VERProcessExecutionReceipt SpanName = "ver.processExecutionReceipt" // children of VERProcessExecutionReceipt VERFindHandleExecutionReceipt SpanName = "ver.find.handleExecutionReceipt" VERFindOnFinalizedBlock SpanName = "ver.finder.OnFinalizedBlock" VERFindCheckCachedReceipts SpanName = "ver.finder.checkCachedReceipts" VERFindCheckPendingReceipts SpanName = "ver.finder.checkPendingReceipts" VERFindCheckReadyReceipts SpanName = "ver.finder.checkReadyReceipts" VERFindProcessResult SpanName = "ver.finder.processResult" VERFindOnResultProcessed SpanName = "ver.finder.onResultProcessed" VERProcessExecutionResult SpanName = "ver.processExecutionResult" // children of VERProcessExecutionResult VERMatchHandleExecutionResult SpanName = "ver.match.handleExecutionResult" VERMatchHandleChunkDataPack SpanName = "ver.match.handleChunkDataPack" VERMatchMyChunkAssignments SpanName = "ver.match.myChunkAssignments" VERVerVerifyWithMetrics SpanName = "ver.verify.verifyWithMetrics" VERVerChunkVerify SpanName = "ver.verify.ChunkVerifier.Verify" VERVerGenerateResultApproval SpanName = "ver.verify.GenerateResultApproval" // Flow Virtual Machine FVMVerifyTransaction SpanName = "fvm.verifyTransaction" FVMSeqNumCheckTransaction SpanName = "fvm.seqNumCheckTransaction" FVMExecuteTransaction SpanName = "fvm.executeTransaction" FVMDeductTransactionFees SpanName = "fvm.deductTransactionFees" FVMTransactionStorageUsedCheck SpanName = "fvm.env.transactionStorageUsedCheck" FVMInvokeContractFunction SpanName = "fvm.invokeContractFunction" FVMFrozenAccountCheckTransaction SpanName = "fvm.frozenAccountCheckTransaction" FVMEnvValueExists SpanName = "fvm.env.valueExists" FVMEnvGetValue SpanName = "fvm.env.getValue" FVMEnvSetValue SpanName = "fvm.env.setValue" FVMEnvAllocateStorageIndex SpanName = "fvm.env.allocateStorageIndex" FVMEnvGetAccount SpanName = "fvm.env.getAccount" FVMEnvGetStorageUsed SpanName = "fvm.env.getStorageUsed" FVMEnvGetStorageCapacity SpanName = "fvm.env.getStorageCapacity" FVMEnvGetAccountBalance SpanName = "fvm.env.getAccountBalance" FVMEnvGetAccountAvailableBalance SpanName = "fvm.env.getAccountAvailableBalance" FVMEnvResolveLocation SpanName = "fvm.env.resolveLocation" FVMEnvGetCode SpanName = "fvm.env.getCode" FVMEnvGetAccountContractNames SpanName = "fvm.env.getAccountContractNames" FVMEnvGetProgram SpanName = "fvm.env.getCachedProgram" FVMEnvSetProgram SpanName = "fvm.env.cacheProgram" FVMEnvProgramLog SpanName = "fvm.env.programLog" FVMEnvEmitEvent SpanName = "fvm.env.emitEvent" FVMEnvGenerateUUID SpanName = "fvm.env.generateUUID" FVMEnvDecodeArgument SpanName = "fvm.env.decodeArgument" FVMEnvHash SpanName = "fvm.env.Hash" FVMEnvVerifySignature SpanName = "fvm.env.verifySignature" FVMEnvValidatePublicKey SpanName = "fvm.env.validatePublicKey" FVMEnvBLSVerifyPOP SpanName = "fvm.env.blsVerifyPOP" FVMEnvBLSAggregateSignatures SpanName = "fvm.env.blsAggregateSignatures" FVMEnvBLSAggregatePublicKeys SpanName = "fvm.env.blsAggregatePublicKeys" FVMEnvGetCurrentBlockHeight SpanName = "fvm.env.getCurrentBlockHeight" FVMEnvGetBlockAtHeight SpanName = "fvm.env.getBlockAtHeight" FVMEnvUnsafeRandom SpanName = "fvm.env.unsafeRandom" FVMEnvCreateAccount SpanName = "fvm.env.createAccount" FVMEnvSetAccountFrozen SpanName = "fvm.env.setAccountFrozen" FVMEnvAddAccountKey SpanName = "fvm.env.addAccountKey" FVMEnvAddEncodedAccountKey SpanName = "fvm.env.addEncodedAccountKey" FVMEnvAccountKeysCount SpanName = "fvm.env.accountKeysCount" FVMEnvGetAccountKey SpanName = "fvm.env.getAccountKey" FVMEnvRevokeAccountKey SpanName = "fvm.env.revokeAccountKey" FVMEnvRevokeEncodedAccountKey SpanName = "fvm.env.revokeEncodedAccountKey" FVMEnvUpdateAccountContractCode SpanName = "fvm.env.updateAccountContractCode" FVMEnvGetAccountContractCode SpanName = "fvm.env.getAccountContractCode" FVMEnvRemoveAccountContractCode SpanName = "fvm.env.removeAccountContractCode" FVMEnvGetSigningAccounts SpanName = "fvm.env.getSigningAccounts" FVMCadenceTrace SpanName = "fvm.cadence.trace" )
Span names
type Tracer ¶ added in v0.27.0
type Tracer struct {
// contains filtered or unexported fields
}
Tracer is the implementation of the Tracer interface TODO(rbtz): make private
func NewTracer ¶
func NewTracer( log zerolog.Logger, serviceName string, chainID string, sensitivity uint, ) (*Tracer, error)
NewTracer creates a new OpenTelemetry-based tracer.
func (*Tracer) Done ¶ added in v0.27.0
func (t *Tracer) Done() <-chan struct{}
Done returns a channel that will close when shutdown is complete.
func (*Tracer) Ready ¶ added in v0.27.0
func (t *Tracer) Ready() <-chan struct{}
Ready returns a channel that will close when the network stack is ready.
func (*Tracer) RecordSpanFromParent ¶ added in v0.27.0
func (*Tracer) StartBlockSpan ¶ added in v0.27.0
func (*Tracer) StartCollectionSpan ¶ added in v0.27.0
func (*Tracer) StartSpanFromContext ¶ added in v0.27.0
func (*Tracer) StartSpanFromParent ¶ added in v0.27.0
func (*Tracer) StartTransactionSpan ¶ added in v0.27.0
func (t *Tracer) StartTransactionSpan( ctx context.Context, transactionID flow.Identifier, spanName SpanName, opts ...trace.SpanStartOption, ) (trace.Span, context.Context, bool)
StartTransactionSpan starts a span that will be aggregated under the given transaction. All spans for the same transaction will be aggregated under a root span
func (*Tracer) WithSpanFromContext ¶ added in v0.27.0
func (t *Tracer) WithSpanFromContext(ctx context.Context, operationName SpanName, f func(), opts ...trace.SpanStartOption, )
WithSpanFromContext encapsulates executing a function within an span, i.e., it starts a span with the specified SpanName from the context, executes the function f, and finishes the span once the function returns.