Documentation
¶
Index ¶
- Constants
- func AppDone()
- func DefaultConfig() *config.Config
- func Disable(disconnect bool)
- func Enable()
- func Enabled() bool
- func GetAppRunId() string
- func Init(appName string, cfgParam *config.Config) (bool, error)
- func Log(str string)
- func Logf(format string, args ...any)
- func MakeLogStream(name string) (io.Writer, error)
- func OrigStderr() *os.File
- func OrigStdout() *os.File
- func OutrigVersion() string
- func SetGoRoutineName(name string)
- func Shutdown()
- type Config
- type Pusher
- type Watch
- func (w *Watch) AsCounter() *Watch
- func (w *Watch) AsGoFmt() *Watch
- func (w *Watch) AsJSON() *Watch
- func (w *Watch) AsStringer() *Watch
- func (w *Watch) ForPush() *Pusher
- func (w *Watch) PollAtomic(val any) *Watch
- func (w *Watch) PollFunc(fn any) *Watch
- func (w *Watch) PollSync(lock sync.Locker, val any) *Watch
- func (w *Watch) Unregister()
- func (w *Watch) WithTags(tags ...string) *Watch
Constants ¶
const ( DomainSocketEnvName = ds.DomainSocketEnvName DisabledEnvName = ds.DisabledEnvName NoTelemetryEnvName = ds.NoTelemetryEnvName )
Environment variables
Variables ¶
This section is empty.
Functions ¶
func AppDone ¶
func AppDone()
AppDone signals that the application is done This should be deferred in the program's main function
func DefaultConfig ¶
DefaultConfig returns the default configuration
func GetAppRunId ¶
func GetAppRunId() string
GetAppRunId returns the unique identifier for the current application run
func Log ¶ added in v0.4.2
func Log(str string)
Log sends a simple string message to the Outrig logger
func MakeLogStream ¶ added in v0.5.0
MakeLogStream creates an io.Writer that sends written data as log lines to Outrig The name parameter specifies the source of the logs
func OrigStderr ¶
OrigStderr returns the original stderr stream that was captured during initialization
func OrigStdout ¶
OrigStdout returns the original stdout stream that was captured during initialization
func SetGoRoutineName ¶
func SetGoRoutineName(name string)
SetGoRoutineName sets a name for the current goroutine
Types ¶
type Pusher ¶ added in v0.5.0
type Pusher struct {
// contains filtered or unexported fields
}
func (*Pusher) Unregister ¶ added in v0.5.0
func (p *Pusher) Unregister()
Unregister unregisters the pusher's watch from the watch collector
type Watch ¶ added in v0.5.0
type Watch struct {
// contains filtered or unexported fields
}
func (*Watch) AsStringer ¶ added in v0.5.0
func (*Watch) PollAtomic ¶ added in v0.5.0
PollAtomic sets up an atomic-based watch that reads values from atomic variables. This method is optimized for monitoring values that are updated using atomic operations.
The val parameter must be:
- A non-nil pointer
- A pointer to one of the following types:
- sync/atomic package types (atomic.Bool, atomic.Int32, atomic.Int64, etc.)
- Primitive types that support atomic operations (int32, int64, uint32, uint64, uintptr)
- unsafe.Pointer
Example:
var counter atomic.Int64
outrig.NewWatch("atomic-counter").PollAtomic(&counter)
func (*Watch) PollFunc ¶ added in v0.5.0
PollFunc sets up a function-based watch that periodically calls the provided function to retrieve its current value. The provided function must take no arguments and must return exactly one value (of any type).
Requirements for fn:
- Non-nil function
- Zero arguments
- Exactly one return value
Example:
outrig.NewWatch("counter").PollFunc(func() int { return myCounter })
func (*Watch) PollSync ¶ added in v0.5.0
PollSync sets up a synchronization-based watch to monitor values protected by a mutex or other locker. It's intended for values updated concurrently, ensuring thread-safe access during polling.
Requirements:
- lock: A non-nil sync.Locker (e.g., *sync.Mutex, *sync.RWMutex)
- val: A non-nil pointer to the value being watched
Example:
var mu sync.Mutex
var counter int
outrig.NewWatch("sync-counter").PollSync(&mu, &counter)
func (*Watch) Unregister ¶ added in v0.5.0
func (w *Watch) Unregister()
Unregister unregisters the watch from the watch collector
Directories
¶
| Path | Synopsis |
|---|---|
|
pkg
|
|
|
collector/loginitex
Package loginitex provides external process-based log capture functionality
|
Package loginitex provides external process-based log capture functionality |
|
ds
Package ds provides data structures, types, and constants used over the wire between the SDK and the server
|
Package ds provides data structures, types, and constants used over the wire between the SDK and the server |
|
ioutrig
internal outrig package (used to get around circular references for internal outrig SDK calls)
|
internal outrig package (used to get around circular references for internal outrig SDK calls) |
|
server
module
|