Help us shape the future of Go! Take the 2026 Go Developer Survey

metrics

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Recorder

type Recorder interface {
	Meter() otelmetric.Meter

	Provider() *sdkmetric.MeterProvider
	Shutdown(ctx context.Context) error
}

Recorder is the interface for recording metrics.

func New

func New(
	ctx context.Context,
	version string,
	logger *slog.Logger,
	option RecorderOption,
) (Recorder, error)

New creates a new Recorder and initializes the OpenTelemetry provider.

func NewNoop

func NewNoop() Recorder

NewNoop returns a no-op Recorder.

type RecorderOption added in v0.7.1

type RecorderOption struct {
	UseDelta bool
}

RecorderOption holds configuration for creating a Recorder.

type ServiceReporter added in v0.7.1

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

ServiceReporter handles metrics reporting for import and export service operations.

func NewServiceReporter added in v0.7.1

func NewServiceReporter(recorder Recorder) *ServiceReporter

NewServiceReporter creates a new metrics reporter for service operations.

func (*ServiceReporter) ReportExportCall added in v0.7.1

func (r *ServiceReporter) ReportExportCall(ctx context.Context)

ReportExportCall reports an export operation.

func (*ServiceReporter) ReportImportCall added in v0.7.1

func (r *ServiceReporter) ReportImportCall(ctx context.Context)

ReportImportCall reports an import operation.

type UnknownActionReporter added in v0.7.1

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

UnknownActionReporter handles metrics reporting for unknown actions across all plugins.

func NewUnknownActionReporter added in v0.7.1

func NewUnknownActionReporter(recorder Recorder) *UnknownActionReporter

NewUnknownActionReporter creates a new metrics reporter for unknown actions.

func (*UnknownActionReporter) ReportUnknownCommand added in v0.7.1

func (r *UnknownActionReporter) ReportUnknownCommand(
	ctx context.Context,
	editorType pluginapi.EditorType,
	action string,
)

ReportUnknownCommand reports an unknown action encountered during import.

Jump to

Keyboard shortcuts

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