Skip to content

exclude_patterns is unscoped substring; localhost not auto-excluded in cloud mode #12

@AndresL230

Description

@AndresL230

Summary

_init.py:148-150 uses pattern in event.url or pattern in event.host. Short or hostname-like patterns over-match. * is taken literally, not as a glob — users naturally pass "*.internal.corp" expecting it to work and silently miss every request.

Also: when api_key is set (cloud mode), the SDK does not auto-exclude localhost / 127.0.0.1. A local dev recost instance could be self-traced.

Fix

  • Add an option for exact host match (e.g. accept ("=", "api.example.com") tuples or a separate exclude_hosts field).
  • Document the substring contract explicitly; reject patterns containing * with a clear error so users don't misuse it.
  • Auto-exclude localhost when a local recost dev API is detected.

Files

  • recost/_init.py
  • README.md
  • tests/test_init.py

Priority

P2 — misleading config; silent self-instrumentation risk in local-dev setups.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Polish / nice-to-havebugSomething isn't workingdocumentationImprovements or additions to documentation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions