observability

package
v1.20.3 Latest Latest
Warning

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

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

Documentation

Overview

Package observability provides structured logging helpers for the integrations subsystem. It enriches context-scoped loggers with integration identity and operation metadata so that all downstream log lines automatically include consistent fields without manual repetition

Index

Constants

View Source
const (
	// FieldIntegrationID is the log field key for the integration identifier
	FieldIntegrationID = "integration_id"
	// FieldDefinitionID is the log field key for the integration definition identifier
	FieldDefinitionID = "definition_id"
	// FieldOperation is the log field key for the operation name
	FieldOperation = "operation"
	// FieldRunID is the log field key for the run identifier
	FieldRunID = "run_id"
)

Variables

This section is empty.

Functions

func WithContext

func WithContext(ctx context.Context, metadata types.ExecutionMetadata) context.Context

WithContext stores execution metadata on context and enriches the logger with all non-empty execution fields

func WithIntegration

func WithIntegration(ctx context.Context, integrationID, definitionID string) context.Context

WithIntegration enriches the context logger with integration identity fields so that all downstream log calls via logx.FromContext automatically include them

func WithOperation

func WithOperation(ctx context.Context, operation string) context.Context

WithOperation adds the operation name to the context logger

func WithRunID

func WithRunID(ctx context.Context, runID string) context.Context

WithRunID adds the run identifier to the context logger

Types

type IntegrationRef

type IntegrationRef struct {
	// IntegrationID is the integration instance identifier
	IntegrationID string
	// DefinitionID is the integration definition (provider type) identifier
	DefinitionID string
}

IntegrationRef carries integration identity for structured log embedding

func FromIntegration

func FromIntegration(integration *ent.Integration) IntegrationRef

FromIntegration builds an IntegrationRef from an ent Integration

func (IntegrationRef) MarshalZerologObject

func (r IntegrationRef) MarshalZerologObject(e *zerolog.Event)

MarshalZerologObject implements zerolog.LogObjectMarshaler

Jump to

Keyboard shortcuts

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