Files
ajarbot/mcp_servers/loki/config.py

39 lines
1.4 KiB
Python
Raw Normal View History

"""
Loki MCP Server - Configuration
This is where we store settings for connecting to your Loki instance.
We use environment variables with sensible defaults so you can override
them without editing code.
Environment variables:
LOKI_URL - Base URL for your Loki instance
LOKI_TIMEOUT - Request timeout in seconds (default: 30)
LOKI_DEFAULT_LIMIT - Default number of log lines to return (default: 100)
"""
import os
# ---------------------------------------------------------------------------
# Connection settings
# ---------------------------------------------------------------------------
# The URL where Loki is reachable. This goes through your Caddy reverse proxy.
LOKI_URL = os.getenv("LOKI_URL", "https://loki.apophisnetworking.net")
# How long (seconds) to wait for Loki to respond before giving up.
LOKI_TIMEOUT = int(os.getenv("LOKI_TIMEOUT", "30"))
# ---------------------------------------------------------------------------
# Query defaults
# ---------------------------------------------------------------------------
# How many log lines to return if the caller doesn't specify.
# 100 is a good balance — enough to see what's happening, not so many
# that it floods the response.
DEFAULT_LIMIT = int(os.getenv("LOKI_DEFAULT_LIMIT", "100"))
# Default time range for queries if none specified (in hours).
# "1" means "show me the last hour of logs."
DEFAULT_RANGE_HOURS = 1