Documentation
¶
Index ¶
- Constants
- Variables
- func CancelFunc(ctx context.Context) context.CancelCauseFunc
- func Emitter(ctx context.Context) dmetering.EventEmitter
- func GetEffectiveHeaderValues(ctx context.Context, headers http.Header, defaultParallelJobs uint64, ...) (parallelJobs uint64, parallelExecutors uint64)
- func GetSessionKey(ctx context.Context) (string, bool)
- func HasBackfillerRequest(ctx context.Context) bool
- func IsBackfillerRequest(ctx context.Context) bool
- func Logger(ctx context.Context) *zap.Logger
- func MaxStageLayerParallelExecutor(ctx context.Context) uint64
- func ModuleExecutionTracing(ctx context.Context) bool
- func OutputModuleHash(ctx context.Context) string
- func ReqStats(ctx context.Context) *metrics.Stats
- func Spkg(ctx context.Context) *pbsubstreams.Package
- func Tracer(ctx context.Context) ttrace.Tracer
- func WasmExtensionReqStats(ctx context.Context) metrics.WasmExtensionStats
- func WithBackfillerRequest(ctx context.Context) context.Context
- func WithCancelFunc(ctx context.Context, f context.CancelCauseFunc) context.Context
- func WithEmitter(ctx context.Context, emitter dmetering.EventEmitter) context.Context
- func WithModuleExecutionTracing(ctx context.Context) context.Context
- func WithOutputModuleHash(ctx context.Context, hash string) context.Context
- func WithReqStats(ctx context.Context, stats *metrics.Stats) context.Context
- func WithRequest(ctx context.Context, req *RequestDetails) context.Context
- func WithSessionKey(ctx context.Context, key string) context.Context
- func WithSpkg(ctx context.Context, pkg *pbsubstreams.Package) context.Context
- func WithTier2RequestParameters(ctx context.Context, parameters Tier2RequestParameters) context.Context
- func WithTracer(ctx context.Context, tracer ttrace.Tracer) context.Context
- func WithWasmExtensionReqStats(ctx context.Context, stats metrics.WasmExtensionStats) context.Context
- type ISpan
- type IsOutputModuleFunc
- type NoopSpan
- func (n *NoopSpan) AddEvent(string, ...ttrace.EventOption)
- func (n *NoopSpan) End(...ttrace.SpanEndOption)
- func (n *NoopSpan) EndWithErr(e *error)
- func (n *NoopSpan) IsRecording() bool
- func (n *NoopSpan) RecordError(error, ...ttrace.EventOption)
- func (n *NoopSpan) SetAttributes(...attribute.KeyValue)
- func (n *NoopSpan) SetError(bool)
- func (n *NoopSpan) SetName(string)
- func (n *NoopSpan) SetStatus(codes.Code, string)
- func (n *NoopSpan) SpanContext() ttrace.SpanContext
- func (n *NoopSpan) TracerProvider() ttrace.TracerProvider
- type RequestDetails
- func (d *RequestDetails) AssertProcessedBlocksLimit(requiredBlocksStore, requiredBlocksRange uint64) error
- func (d *RequestDetails) IsOutputModule(modName string) bool
- func (d *RequestDetails) ShouldReturnWrittenPartials(modName string) bool
- func (d *RequestDetails) ShouldStreamCachedOutputs() bool
- func (d *RequestDetails) UniqueIDString() string
- type Tier2RequestParameters
- type TracingConf
Constants ¶
const DefaultMaxStageLayerParallelExecutorCount = 2
const HeaderCacheTag = "x-substreams-cache-tag"
const HeaderParallelWorkers = "x-substreams-parallel-workers"
Variables ¶
var WithLogger = logging.WithLogger
Functions ¶
func CancelFunc ¶ added in v1.16.5
func CancelFunc(ctx context.Context) context.CancelCauseFunc
func GetEffectiveHeaderValues ¶ added in v1.16.4
func GetEffectiveHeaderValues(ctx context.Context, headers http.Header, defaultParallelJobs uint64, defaultParallelExecutors uint64) (parallelJobs uint64, parallelExecutors uint64)
GetEffectiveHeaderValues compares the request headers to the 'trusted headers' sent by the authentication layer. It contains some business logic:
- prevents overriding the numeric values to lower ones for parallel jobs and stage layer executors
func HasBackfillerRequest ¶ added in v1.10.1
func IsBackfillerRequest ¶ added in v1.10.1
func MaxStageLayerParallelExecutor ¶ added in v1.13.0
MaxStageLayerParallelExecutor returns the maximum number of parallel executors (e.g. go routines) that can be executed at the same time for a particular stage's layer as configured and accepted by the auth plugin.
If the request is in development mode, returns 1. If the value is not set, returns the default value which is 2.
func ModuleExecutionTracing ¶ added in v1.1.4
func OutputModuleHash ¶ added in v1.10.9
func WasmExtensionReqStats ¶ added in v1.13.0
func WasmExtensionReqStats(ctx context.Context) metrics.WasmExtensionStats
func WithBackfillerRequest ¶ added in v1.10.1
func WithCancelFunc ¶ added in v1.16.5
func WithEmitter ¶ added in v1.6.0
func WithModuleExecutionTracing ¶ added in v1.1.4
func WithOutputModuleHash ¶ added in v1.10.9
func WithRequest ¶
func WithRequest(ctx context.Context, req *RequestDetails) context.Context
func WithSessionKey ¶ added in v1.16.5
func WithTier2RequestParameters ¶ added in v1.5.0
func WithTier2RequestParameters(ctx context.Context, parameters Tier2RequestParameters) context.Context
func WithWasmExtensionReqStats ¶ added in v1.13.0
Types ¶
type ISpan ¶
type ISpan interface {
// End completes the Span. The Span is considered complete and ready to be
// delivered through the rest of the telemetry pipeline after this method
// is called. Therefore, updates to the Span are not allowed after this
// method has been called.
End(options ...ttrace.SpanEndOption)
// AddEvent adds an event with the provided name and options.
AddEvent(name string, options ...ttrace.EventOption)
// IsRecording returns the recording state of the Span. It will return
// true if the Span is active and events can be recorded.
IsRecording() bool
// RecordError will record err as an exception span event for this span. An
// additional call to SetStatus is required if the Status of the Span should
// be set to Error, as this method does not change the Span status. If this
// span is not being recorded or err is nil then this method does nothing.
RecordError(err error, options ...ttrace.EventOption)
// SpanContext returns the SpanContext of the Span. The returned SpanContext
// is usable even after the End method has been called for the Span.
SpanContext() ttrace.SpanContext
// SetStatus sets the status of the Span in the form of a code and a
// description, provided the status hasn't already been set to a higher
// value before (OK > Error > Unset). The description is only included in a
// status when the code is for an error.
SetStatus(code codes.Code, description string)
// SetName sets the Span name.
SetName(name string)
// SetAttributes sets kv as attributes of the Span. If a key from kv
// already exists for an attribute of the Span it will be overwritten with
// the value contained in kv.
SetAttributes(kv ...attribute.KeyValue)
// TracerProvider returns a TracerProvider that can be used to generate
// additional Spans on the same telemetry pipeline as the current Span.
TracerProvider() ttrace.TracerProvider
EndWithErr(e *error)
}
func WithModuleExecutionSpan ¶ added in v1.1.4
type IsOutputModuleFunc ¶ added in v0.1.0
type NoopSpan ¶ added in v1.3.6
type NoopSpan struct{}
NoopSpan is an implementation of span that preforms no operations.
func (*NoopSpan) AddEvent ¶ added in v1.3.6
func (n *NoopSpan) AddEvent(string, ...ttrace.EventOption)
AddEvent does nothing.
func (*NoopSpan) End ¶ added in v1.3.6
func (n *NoopSpan) End(...ttrace.SpanEndOption)
End does nothing.
func (*NoopSpan) EndWithErr ¶ added in v1.3.6
func (*NoopSpan) IsRecording ¶ added in v1.3.6
IsRecording always returns false.
func (*NoopSpan) RecordError ¶ added in v1.3.6
func (n *NoopSpan) RecordError(error, ...ttrace.EventOption)
RecordError does nothing.
func (*NoopSpan) SetAttributes ¶ added in v1.3.6
SetAttributes does nothing.
func (*NoopSpan) SpanContext ¶ added in v1.3.6
func (n *NoopSpan) SpanContext() ttrace.SpanContext
SpanContext returns an empty span context.
func (*NoopSpan) TracerProvider ¶ added in v1.3.6
func (n *NoopSpan) TracerProvider() ttrace.TracerProvider
TracerProvider returns a no-op TracerProvider.
type RequestDetails ¶ added in v0.1.0
type RequestDetails struct {
Modules *pbsubstreams.Modules
DebugInitialStoreSnapshotForModules []string
OutputModule string
// What the user requested, derived from either the Request.StartBlockNum or Request.Cursor
ResolvedStartBlockNum uint64
ResolvedCursor string
LinearHandoffBlockNum uint64
LinearGateBlockNum uint64
StopBlockNum uint64
MaxParallelJobs uint64
MaxStageLayerParallelExecutor uint64
LimitProcessedBlocks uint64
UpdateInterval time.Duration
UniqueID uint64
ProductionMode bool
IsTier2Request bool
IsStreamingTier2 bool // special mode where tier2 will stream the data back to tier1, for the first segment
Tier2Stage int
}
func Details ¶
func Details(ctx context.Context) *RequestDetails
func (*RequestDetails) AssertProcessedBlocksLimit ¶ added in v1.14.3
func (d *RequestDetails) AssertProcessedBlocksLimit(requiredBlocksStore, requiredBlocksRange uint64) error
func (*RequestDetails) IsOutputModule ¶ added in v0.1.0
func (d *RequestDetails) IsOutputModule(modName string) bool
func (*RequestDetails) ShouldReturnWrittenPartials ¶ added in v1.0.2
func (d *RequestDetails) ShouldReturnWrittenPartials(modName string) bool
func (*RequestDetails) ShouldStreamCachedOutputs ¶ added in v0.1.0
func (d *RequestDetails) ShouldStreamCachedOutputs() bool
func (*RequestDetails) UniqueIDString ¶ added in v1.1.4
func (d *RequestDetails) UniqueIDString() string
type Tier2RequestParameters ¶ added in v1.5.0
type Tier2RequestParameters struct {
MeteringConfig string
FirstStreamableBlock uint64
MergedBlockStoreURL string
StateStoreURL string
StateBundleSize uint64
StateStoreDefaultTag string
BlockType string
WASMModules map[string]string
FoundationalStoreEndpoints map[string]string
}
func GetTier2RequestParameters ¶ added in v1.5.0
func GetTier2RequestParameters(ctx context.Context) (Tier2RequestParameters, bool)
type TracingConf ¶ added in v1.1.4
type TracingConf struct {
ModuleExecution bool
}
func NewTracingConf ¶ added in v1.1.4
func NewTracingConf( moduleExecution bool, ) *TracingConf