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
- func WithContext(ctx context.Context, metadata types.ExecutionMetadata) context.Context
- func WithIntegration(ctx context.Context, integrationID, definitionID string) context.Context
- func WithOperation(ctx context.Context, operation string) context.Context
- func WithRunID(ctx context.Context, runID string) context.Context
- type IntegrationRef
Constants ¶
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 ¶
WithContext stores execution metadata on context and enriches the logger with all non-empty execution fields
func WithIntegration ¶
WithIntegration enriches the context logger with integration identity fields so that all downstream log calls via logx.FromContext automatically include them
func WithOperation ¶
WithOperation adds the operation name 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