extension

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FetchResult

type FetchResult struct {
	// A JSON-serializable object used to persist the parameters of this fetch,
	// such as the extension trace ID.
	Identifier any
	// The spans in the extension trace.
	//
	// Orphan spans (with no or invalid parent reference) are treated as root spans.
	Spans []*model.Span
}

type Provider

type Provider interface {
	// Kind of this extension provider, same as the one from `ProviderFactory.Kind()`
	Kind() string

	// The raw JSON config buffer used to configure this provider.
	RawConfig() []byte

	// Maximum wall time to execute all fetch calls.
	// Only successuful queries before this timestamp will be included in the output.
	TotalTimeout() time.Duration
	// Maximum concurrent fetch calls to execute for the same trace.
	MaxConcurrency() int

	// Searches for spans associated with an object.
	//
	// This method is invoked during the first time a main trace is loaded.
	// Subsequent invocations will call `LoadCache` instead.
	//
	// Returned traces are attached as subtrees under the object pseudospan.
	//
	// `tags` contains the tags in the object pseudospan in the main trace.
	FetchForObject(
		ctx context.Context,
		object utilobject.VersionedKey,
		tags model.KeyValues,
		start, end time.Time,
	) (*FetchResult, error)

	// Searches for spans associated with an object version.
	//
	// This method is invoked during the first time a main trace is loaded.
	// Subsequent invocations will call `LoadCache` instead.
	//
	// Returned traces are attached as subtrees under the audit span.
	//
	// `tags` contains the tags in the object pseudospan in the main trace.
	FetchForVersion(
		ctx context.Context,
		object utilobject.VersionedKey,
		resourceVersion string,
		tags model.KeyValues,
		start, end time.Time,
	) (*FetchResult, error)

	// Restores the FetchResult from the identifier
	// persisted from the result of a previous call to `Fetch`.
	LoadCache(ctx context.Context, identifier []byte) ([]*model.Span, error)
}

An instance of extension provider as specified in the config. Loads spans from a specific source, typically from one specific component.

type ProviderFactory

type ProviderFactory interface {
	manager.IndexedListImpl

	Configure(jsonBuf []byte) (Provider, error)
}

Produces new extension providers based on the configuration.

This interface is used for manager.List.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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