trace

package
v0.20.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2021 License: AGPL-3.0 Imports: 13 Imported by: 17

Documentation

Index

Constants

View Source
const (
	EXEParseDurationTag         = "runtime.parseTransactionDuration"
	EXECheckDurationTag         = "runtime.checkTransactionDuration"
	EXEInterpretDurationTag     = "runtime.interpretTransactionDuration"
	EXEValueEncodingDurationTag = "runtime.encodingValueDuration"
	EXEValueDecodingDurationTag = "runtime.decodingValueDuration"
)

Tag names

Variables

This section is empty.

Functions

This section is empty.

Types

type InternalTracer

type InternalTracer struct {
	// contains filtered or unexported fields
}

func (*InternalTracer) Extract

func (t *InternalTracer) Extract(format interface{}, carrier interface{}) (opentracing.SpanContext, error)

func (*InternalTracer) Inject

func (t *InternalTracer) Inject(sm opentracing.SpanContext, format interface{}, carrier interface{}) error

func (*InternalTracer) StartSpan

func (t *InternalTracer) StartSpan(operationName string, opts ...opentracing.StartSpanOption) opentracing.Span

type NoopSpan

type NoopSpan struct {
	// contains filtered or unexported fields
}

func (*NoopSpan) BaggageItem

func (s *NoopSpan) BaggageItem(restrictedKey string) string

func (*NoopSpan) Context

func (s *NoopSpan) Context() opentracing.SpanContext

func (*NoopSpan) Finish

func (s *NoopSpan) Finish()

func (*NoopSpan) FinishWithOptions

func (s *NoopSpan) FinishWithOptions(opts opentracing.FinishOptions)

func (*NoopSpan) Log

func (s *NoopSpan) Log(data opentracing.LogData)

func (*NoopSpan) LogEvent

func (s *NoopSpan) LogEvent(event string)

func (*NoopSpan) LogEventWithPayload

func (s *NoopSpan) LogEventWithPayload(event string, payload interface{})

func (*NoopSpan) LogFields

func (s *NoopSpan) LogFields(fields ...log.Field)

func (*NoopSpan) LogKV

func (s *NoopSpan) LogKV(alternatingKeyValues ...interface{})

func (*NoopSpan) SetBaggageItem

func (s *NoopSpan) SetBaggageItem(restrictedKey, value string) opentracing.Span

func (*NoopSpan) SetOperationName

func (s *NoopSpan) SetOperationName(operationName string) opentracing.Span

func (*NoopSpan) SetTag

func (s *NoopSpan) SetTag(key string, value interface{}) opentracing.Span

func (*NoopSpan) Tracer

func (s *NoopSpan) Tracer() opentracing.Tracer

type NoopSpanContext

type NoopSpanContext struct{}

func (*NoopSpanContext) ForeachBaggageItem

func (c *NoopSpanContext) ForeachBaggageItem(handler func(k, v string) bool)

type NoopTracer

type NoopTracer struct {
	// contains filtered or unexported fields
}

NoopTracer is the implementation of the Tracer interface

func NewNoopTracer

func NewNoopTracer() *NoopTracer

NewTracer creates a new tracer.

func (*NoopTracer) Done

func (t *NoopTracer) Done() <-chan struct{}

Done returns a channel that will close when shutdown is complete.

func (*NoopTracer) FinishSpan

func (t *NoopTracer) FinishSpan(entityID flow.Identifier, spanName SpanName)

FinishSpan finishes a span started with the passed in flow identifier

func (*NoopTracer) GetSpan

func (t *NoopTracer) GetSpan(entityID flow.Identifier, spanName SpanName) (opentracing.Span, bool)

GetSpan will get the span started with the passed in flow identifier

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 opentracing.Span,
	operationName SpanName,
	duration time.Duration,
	logs []opentracing.LogRecord,
	opts ...opentracing.StartSpanOption,
)

func (*NoopTracer) StartSpan

func (t *NoopTracer) StartSpan(entityID flow.Identifier, spanName SpanName, opts ...opentracing.StartSpanOption,
) opentracing.Span

StartSpan starts a span using the flow identifier as a key into the span map

func (*NoopTracer) StartSpanFromContext

func (t *NoopTracer) StartSpanFromContext(
	ctx context.Context,
	operationName SpanName,
	opts ...opentracing.StartSpanOption,
) (opentracing.Span, context.Context)

func (*NoopTracer) StartSpanFromParent

func (t *NoopTracer) StartSpanFromParent(
	span opentracing.Span,
	operationName SpanName,
	opts ...opentracing.StartSpanOption,
) opentracing.Span

func (*NoopTracer) WithSpanFromContext added in v0.15.0

func (t *NoopTracer) WithSpanFromContext(ctx context.Context,
	operationName SpanName,
	f func(),
	opts ...opentracing.StartSpanOption)

type OpenTracer

type OpenTracer struct {
	opentracing.Tracer
	// contains filtered or unexported fields
}

OpenTracer is the implementation of the Tracer interface

func NewTracer

func NewTracer(log zerolog.Logger, serviceName string) (*OpenTracer, error)

NewTracer creates a new tracer.

func (*OpenTracer) Done

func (t *OpenTracer) Done() <-chan struct{}

Done returns a channel that will close when shutdown is complete.

func (*OpenTracer) FinishSpan

func (t *OpenTracer) FinishSpan(entityID flow.Identifier, spanName SpanName)

FinishSpan finishes a span started with the passed in flow identifier

func (*OpenTracer) GetSpan

func (t *OpenTracer) GetSpan(entityID flow.Identifier, spanName SpanName) (opentracing.Span, bool)

GetSpan will get the span started with the passed in flow identifier

func (*OpenTracer) Ready

func (t *OpenTracer) Ready() <-chan struct{}

Ready returns a channel that will close when the network stack is ready.

func (*OpenTracer) RecordSpanFromParent added in v0.14.5

func (t *OpenTracer) RecordSpanFromParent(
	span opentracing.Span,
	operationName SpanName,
	duration time.Duration,
	logs []opentracing.LogRecord,
	opts ...opentracing.StartSpanOption,
)

func (*OpenTracer) StartSpan

func (t *OpenTracer) StartSpan(entityID flow.Identifier, spanName SpanName, opts ...opentracing.StartSpanOption) opentracing.Span

StartSpan starts a span using the flow identifier as a key into the span map

func (*OpenTracer) StartSpanFromContext

func (t *OpenTracer) StartSpanFromContext(
	ctx context.Context,
	operationName SpanName,
	opts ...opentracing.StartSpanOption,
) (opentracing.Span, context.Context)

func (*OpenTracer) StartSpanFromParent

func (t *OpenTracer) StartSpanFromParent(
	span opentracing.Span,
	operationName SpanName,
	opts ...opentracing.StartSpanOption,
) opentracing.Span

func (*OpenTracer) WithSpanFromContext added in v0.15.0

func (t *OpenTracer) WithSpanFromContext(ctx context.Context,
	operationName SpanName,
	f func(),
	opts ...opentracing.StartSpanOption)

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 SpanName

type SpanName string
const (

	// State
	// mutator.Extend - full payload check
	ProtoStateMutatorExtend                SpanName = "common.state.proto.mutator.extend"
	ProtoStateMutatorExtendCheckHeader     SpanName = "common.state.proto.mutator.extend.checkHeader"
	ProtoStateMutatorExtendCheckGuarantees SpanName = "common.state.proto.mutator.extend.checkGuarantees"
	ProtoStateMutatorExtendCheckSeals      SpanName = "common.state.proto.mutator.extend.checkSeals"
	ProtoStateMutatorExtendCheckReceipts   SpanName = "common.state.proto.mutator.extend.checkReceipts"
	ProtoStateMutatorExtendDBInsert        SpanName = "common.state.proto.mutator.extend.dbInsert"

	// mutator.HeaderExtend - header-only check
	ProtoStateMutatorHeaderExtend              SpanName = "common.state.proto.mutator.headerExtend"
	ProtoStateMutatorHeaderExtendGetLastSealed SpanName = "common.state.proto.mutator.headerExtend.lastSealed"

	// mutator.Finalize
	ProtoStateMutatorFinalize SpanName = "common.state.proto.mutator.finalize"

	CONProcessCollection SpanName = "con.processCollection"
	CONProcessBlock      SpanName = "con.processBlock"

	// Hotstuff
	CONHotFinalizeCollection SpanName = "con.hotstuff.finalizeCollection"
	CONHotFinalizeBlock      SpanName = "con.hotstuff.finalizeBlock"

	// Ingestion
	CONIngOnCollectionGuarantee SpanName = "con.ingestion.onCollectionGuarantee"

	// Propagation
	CONPropOnGuarantee SpanName = "con.propagation.onGuarantee"

	// Provider
	CONProvOnBlockProposal SpanName = "con.provider.onBlockProposal"

	// Compliance
	CONCompBroadcastProposalWithDelay      SpanName = "con.compliance.BroadcastProposalWithDelay"
	CONCompOnBlockProposal                 SpanName = "con.compliance.onBlockProposal"
	CONCompOnBlockProposalProcessRecursive SpanName = "con.compliance.onBlockProposal.processBlockProposal.recursive"
	CONCompOnBlockProposalProcessSingle    SpanName = "con.compliance.onBlockProposal.processBlockProposal.single"

	// Matching
	CONMatchRequestPendingReceipts SpanName = "con.matching.requestPendingReceipts"
	CONMatchProcessReceiptVal      SpanName = "con.matching.processReceipt.validation"
	CONMatchProcessReceipt         SpanName = "con.matching.processReceipt"

	// 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"

	// Builder
	CONBuildOn                        SpanName = "con.builder"
	CONBuildOnCreatePayloadGuarantees SpanName = "con.builder.createPayload.guarantees"
	CONBuildOnCreatePayloadSeals      SpanName = "con.builder.createPayload.seals"
	CONBuildOnCreatePayloadReceipts   SpanName = "con.builder.createPayload.receipts"
	CONBuildOnCreateHeader            SpanName = "con.builder.createHeader"
	CONBuildOnDBInsert                SpanName = "con.builder.dbInsert"

	// 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"

	EXEExecuteBlock           SpanName = "exe.ingestion.executeBlock"
	EXESaveExecutionResults   SpanName = "exe.ingestion.saveExecutionResults"
	EXESaveExecutionReceipt   SpanName = "exe.ingestion.saveExecutionReceipt"
	EXESaveTransactionResults SpanName = "exe.ingestion.saveTransactionResults"
	EXESaveTransactionEvents  SpanName = "exe.ingestion.saveTransactionEvents"

	EXEBroadcastExecutionReceipt SpanName = "exe.provider.broadcastExecutionReceipt"

	EXEComputeBlock            SpanName = "exe.computer.computeBlock"
	EXEComputeCollection       SpanName = "exe.computer.computeCollection"
	EXEComputeSystemCollection SpanName = "exe.computer.computeSystemCollection"
	EXEComputeTransaction      SpanName = "exe.computer.computeTransaction"
	EXEMergeTransactionView    SpanName = "exe.computer.mergeTransactionView"

	EXECommitDelta                        SpanName = "exe.state.commitDelta"
	EXEGenerateChunkDataPacks             SpanName = "exe.state.generateChunkDataPacks"
	EXEGetRegisters                       SpanName = "exe.state.getRegisters"
	EXEGetRegistersWithProofs             SpanName = "exe.state.getRegistersWithProofs"
	EXEPersistStateCommitment             SpanName = "exe.state.persistStateCommitment"
	EXEPersistEvents                      SpanName = "exe.state.persistEvents"
	EXEPersistChunkDataPack               SpanName = "exe.state.persistChunkDataPack"
	EXEGetExecutionResultID               SpanName = "exe.state.getExecutionResultID"
	EXEPersistExecutionResult             SpanName = "exe.state.persistExecutionResult"
	EXEUpdateHighestExecutedBlockIfHigher SpanName = "exe.state.updateHighestExecutedBlockIfHigher"
	EXEGetHighestExecutedBlockID          SpanName = "exe.state.getHighestExecutedBlockID"
	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"
	FVMInvokeContractFunction        SpanName = "fvm.invokeContractFunction"
	FVMFrozenAccountCheckTransaction SpanName = "fvm.frozenAccountCheckTransaction"

	FVMEnvHash                      SpanName = "fvm.env.Hash"
	FVMEnvValueExists               SpanName = "fvm.env.valueExists"
	FVMEnvGetValue                  SpanName = "fvm.env.getValue"
	FVMEnvSetValue                  SpanName = "fvm.env.setValue"
	FVMEnvGetStorageUsed            SpanName = "fvm.env.getStorageUsed"
	FVMEnvGetStorageCapacity        SpanName = "fvm.env.getStorageCapacity"
	FVMEnvGetAccountBalance         SpanName = "fvm.env.getAccountBalance"
	FVMEnvResolveLocation           SpanName = "fvm.env.resolveLocation"
	FVMEnvGetCode                   SpanName = "fvm.env.getCode"
	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"
	FVMEnvVerifySignature           SpanName = "fvm.env.verifySignature"
	FVMEnvGetCurrentBlockHeight     SpanName = "fvm.env.getCurrentBlockHeight"
	FVMEnvUnsafeRandom              SpanName = "fvm.env.unsafeRandom"
	FVMEnvGetBlockAtHeight          SpanName = "fvm.env.getBlockAtHeight"
	FVMEnvCreateAccount             SpanName = "fvm.env.createAccount"
	FVMEnvAddAccountKey             SpanName = "fvm.env.addAccountKey"
	FVMEnvGetAccountKey             SpanName = "fvm.env.getAccountKey"
	FVMEnvRemoveAccountKey          SpanName = "fvm.env.removeAccountKey"
	FVMEnvUpdateAccountContractCode SpanName = "fvm.env.updateAccountContractCode"
	FVMEnvGetAccountContractCode    SpanName = "fvm.env.getAccountContractCode"
	FVMEnvRemoveAccountContractCode SpanName = "fvm.env.removeAccountContractCode"
	FVMEnvGetSigningAccounts        SpanName = "fvm.env.getSigningAccounts"

	FVMCadenceParseProgram     SpanName = "fvm.cadence.parseProgram"
	FVMCadenceCheckProgram     SpanName = "fvm.cadence.checkProgram"
	FVMCadenceInterpretProgram SpanName = "fvm.cadence.interpretProgram"
	FVMCadenceEncodeValue      SpanName = "fvm.cadence.encodeValue"
	FVMCadenceDecodeValue      SpanName = "fvm.cadence.decodeValue"
)

Span names

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL