Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -1198,28 +1198,28 @@ PAGINATION_INCLUDE_LINKS=true

# Enable observability tracing and metrics collection
# When enabled, all HTTP requests will be traced with detailed timing, status codes, and context
# OBSERVABILITY_ENABLED=false
OBSERVABILITY_ENABLED=false

# Automatically trace HTTP requests
# OBSERVABILITY_TRACE_HTTP_REQUESTS=true
OBSERVABILITY_TRACE_HTTP_REQUESTS=true

# Number of days to retain trace data
# OBSERVABILITY_TRACE_RETENTION_DAYS=7
OBSERVABILITY_TRACE_RETENTION_DAYS=7

# Maximum number of traces to retain (prevents unbounded growth)
# OBSERVABILITY_MAX_TRACES=100000
OBSERVABILITY_MAX_TRACES=100000

# Trace sampling rate (0.0-1.0) - 1.0 means trace everything, 0.1 means trace 10%
# OBSERVABILITY_SAMPLE_RATE=1.0
OBSERVABILITY_SAMPLE_RATE=1.0

# Paths to exclude from tracing (comma-separated regex patterns)
# OBSERVABILITY_EXCLUDE_PATHS=/health,/healthz,/ready,/metrics,/static/.*
OBSERVABILITY_EXCLUDE_PATHS='["/health", "/healthz", "/ready", "/metrics", "/static/.*"]'

# Enable metrics collection
# OBSERVABILITY_METRICS_ENABLED=true
OBSERVABILITY_METRICS_ENABLED=true

# Enable event logging within spans
# OBSERVABILITY_EVENTS_ENABLED=true
OBSERVABILITY_EVENTS_ENABLED=true

#####################################
# Ed25519 Key Support
Expand Down
3 changes: 2 additions & 1 deletion mcpgateway/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ def _parse_allowed_origins(cls, v: Any) -> Set[str]:
observability_sample_rate: float = Field(default=1.0, ge=0.0, le=1.0, description="Trace sampling rate (0.0-1.0)")

# Exclude paths from tracing (regex patterns)
observability_exclude_paths: List[str] = Field(default_factory=lambda: ["/health", "/healthz", "/ready", "/metrics", "/static/.*"], description="Paths to exclude from tracing (regex)")
observability_exclude_paths: List[str] = Field(default_factory=lambda: ["/health", "/healthz", "/ready", "/metrics", "/static/.*"], description="Paths to exclude from tracing")

# Enable performance metrics
observability_metrics_enabled: bool = Field(default=True, description="Enable metrics collection")
Expand Down Expand Up @@ -1102,6 +1102,7 @@ def _auto_enable_security_txt(cls, v: Any, info: ValidationInfo) -> bool:
"sso_auto_admin_domains",
"sso_github_admin_orgs",
"sso_google_admin_domains",
"observability_exclude_paths",
mode="before",
)
@classmethod
Expand Down
Loading