scope

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package scope groups OpenTelemetry instruments under one instrumentation scope name.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*options)

Option configures a Scope.

func WithMeterProvider

func WithMeterProvider(provider metric.MeterProvider) Option

WithMeterProvider uses provider to construct the scope meter.

func WithTracerProvider

func WithTracerProvider(provider trace.TracerProvider) Option

WithTracerProvider uses provider to construct the scope tracer.

type Scope

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

Scope owns commonly used OpenTelemetry instruments for a component.

func New

func New(name string, opts ...Option) *Scope

New constructs a Scope for name.

func (*Scope) Meter

func (s *Scope) Meter() metric.Meter

Meter returns the scope meter.

func (*Scope) Name

func (s *Scope) Name() string

Name returns the instrumentation scope name.

func (*Scope) Run

func (s *Scope) Run(ctx context.Context, name string, f span.Func, opts ...span.Option) error

Run starts a span on the scope tracer and executes f.

func (*Scope) Tracer

func (s *Scope) Tracer() trace.Tracer

Tracer returns the scope tracer.

Jump to

Keyboard shortcuts

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