Skip to content

Observability

octomate.config.observability

Logging levels and Logfire export settings.

LogLevel module-attribute

LogLevel = Annotated[
    Literal[
        "CRITICAL",
        "ERROR",
        "WARNING",
        "INFO",
        "DEBUG",
        "NOTSET",
    ],
    BeforeValidator(
        lambda level: (
            level.upper()
            if isinstance(level, str)
            else level
        )
    ),
]

LoggingConfig pydantic-model

Bases: BaseModel

Console log levels: the root level and per-logger overrides.

Fields:

Source code in octomate/config/observability.py
class LoggingConfig(BaseModel):
    """Console log levels: the root level and per-logger overrides."""

    level: LogLevel = "INFO"
    loggers: dict[str, LogLevel] = Field(
        default_factory=dict,
        description="Per-logger level overrides applied on top of `level` — e.g. "
        "`{httpx: WARNING}` to quiet a chatty library.",
    )

level pydantic-field

level: LogLevel = 'INFO'

loggers pydantic-field

loggers: dict[str, LogLevel]

Per-logger level overrides applied on top of level — e.g. {httpx: WARNING} to quiet a chatty library.

LogfireInstrumentConfig pydantic-model

Bases: BaseModel

Library auto-instrumentation toggles, all off by default: each one traces a whole library's internals (every HTTP request, every SQL statement, every model round-trip), which is diagnostic-session volume rather than always-on volume. Octomate's own spans — the octomate.*-scoped ones in telemetry.py — are not behind these: they always emit whenever tracing itself is on.

Fields:

Source code in octomate/config/observability.py
class LogfireInstrumentConfig(BaseModel):
    """Library auto-instrumentation toggles, all off by default: each one traces a
    whole library's internals (every HTTP request, every SQL statement, every model
    round-trip), which is diagnostic-session volume rather than always-on volume.
    Octomate's own spans — the `octomate.*`-scoped ones in `telemetry.py` — are not
    behind these: they always emit whenever tracing itself is on."""

    pydantic_ai: bool = Field(
        default=False,
        description="Trace pydantic-ai internals: model requests, tool calls, and "
        "token usage per agent run.",
    )
    httpx: bool = Field(
        default=False,
        description="Trace every outbound httpx request (LLM providers, Slack, "
        "Lark, NapCat — all of them).",
    )
    sqlalchemy: bool = Field(
        default=False,
        description="Trace every SQL statement the engine executes.",
    )

pydantic_ai pydantic-field

pydantic_ai: bool = False

Trace pydantic-ai internals: model requests, tool calls, and token usage per agent run.

httpx pydantic-field

httpx: bool = False

Trace every outbound httpx request (LLM providers, Slack, Lark, NapCat — all of them).

sqlalchemy pydantic-field

sqlalchemy: bool = False

Trace every SQL statement the engine executes.

LogfireConfig pydantic-model

Bases: BaseModel

Logfire export: service identity, where spans go, and per-library instrumentation.

Fields:

Source code in octomate/config/observability.py
class LogfireConfig(BaseModel):
    """Logfire export: service identity, where spans go, and per-library
    instrumentation."""

    service_name: str = "octomate"
    environment: str = "development"
    send_to_logfire: bool = False
    console: bool = False
    scrub: bool = True
    instrument: LogfireInstrumentConfig = Field(
        default_factory=LogfireInstrumentConfig,
        description="Per-library auto-instrumentation; see LogfireInstrumentConfig.",
    )

service_name pydantic-field

service_name: str = 'octomate'

environment pydantic-field

environment: str = 'development'

send_to_logfire pydantic-field

send_to_logfire: bool = False

console pydantic-field

console: bool = False

scrub pydantic-field

scrub: bool = True

instrument pydantic-field

instrument: LogfireInstrumentConfig

Per-library auto-instrumentation; see LogfireInstrumentConfig.