feat(config): add telemetry kill switch - #110
Merged
kxzk merged 7 commits intoAug 17, 2026
Conversation
kxzk
force-pushed
the
feature/aai-391-add-tracing-enabled-kill-switch
branch
from
August 17, 2026 17:53
0a205ef to
e6d2e12
Compare
kxzk
changed the base branch from
main
to
feature/aai-390-fixscoring-bound-the-score-queue-and-cap-batch-payload-size
August 17, 2026 17:53
kxzk
changed the base branch from
feature/aai-390-fixscoring-bound-the-score-queue-and-cap-batch-payload-size
to
main
August 17, 2026 18:20
kxzk
changed the base branch from
main
to
feature/aai-390-fixscoring-bound-the-score-queue-and-cap-batch-payload-size
August 17, 2026 18:21
kxzk
force-pushed
the
feature/aai-391-add-tracing-enabled-kill-switch
branch
from
August 17, 2026 18:29
cb9b93d to
9aa3f32
Compare
kxzk
changed the base branch from
feature/aai-390-fixscoring-bound-the-score-queue-and-cap-batch-payload-size
to
main
August 17, 2026 18:33
kxzk
changed the base branch from
main
to
feature/aai-390-fixscoring-bound-the-score-queue-and-cap-batch-payload-size
August 17, 2026 18:34
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9aa3f32. Configure here.
kxzk
changed the base branch from
feature/aai-390-fixscoring-bound-the-score-queue-and-cap-batch-payload-size
to
main
August 17, 2026 18:43
kxzk
changed the base branch from
main
to
feature/aai-390-fixscoring-bound-the-score-queue-and-cap-batch-payload-size
August 17, 2026 18:44
kxzk
force-pushed
the
feature/aai-391-add-tracing-enabled-kill-switch
branch
from
August 17, 2026 19:05
a33e0ba to
918ca30
Compare
kxzk
changed the base branch from
feature/aai-390-fixscoring-bound-the-score-queue-and-cap-batch-payload-size
to
main
August 17, 2026 19:05
kxzk
changed the base branch from
main
to
feature/aai-390-fixscoring-bound-the-score-queue-and-cap-batch-payload-size
August 17, 2026 19:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

TL;DRApplications can disable Langfuse tracing and scoring without removing credentials or changing call sites.
WhyThe SDK needs a complete telemetry kill switch for incident response, tests, and environments that must not export telemetry.
ChecklistCloses #
Note
Kade's words:
Summary
Applications can now set
tracing_enabled = falseorLANGFUSE_TRACING_ENABLED=false. Explicit Ruby configuration overrides the Langfuse environment variable.OTEL_SDK_DISABLED=truealways disables telemetry.Disabled trace and score calls are no-ops. They do not require credentials or create requests. Prompt and data API construction stays deferred, so those calls still validate the normal configuration when used. Existing enabled behavior stays unchanged.
Change diagram
flowchart TD accTitle: Langfuse telemetry kill switch accDescr: Configuration selects enabled telemetry or no-op trace and score behavior while API calls retain normal validation. C["Read telemetry configuration"] --> E{"Telemetry enabled"} E -->|"Yes"| T["Create trace and score clients"] E -->|"No"| N["Use no-op tracing and scoring"] N --> P["Defer prompt and data API client"] P --> V["Validate configuration on API use"]Verification
I ran the complete RSpec suite locally. All 1,586 examples passed. Line coverage was 97.28%.
I ran RuboCop against 100 files. RuboCop reported no offenses.
The enabled Ruby SDK probe delivered trace
37df4a1e645254a82760e18daa9b41a6and its score. The disabled probe used trace ID1ecdcf1ebb5833d8c9f4931e9e76ea0b. Its span was non-recording, and both score APIs returnednil. The Langfuse CLI found the enabled trace and score. The CLI found no observation or score for the disabled trace ID.Unit tests also cover
OTEL_SDK_DISABLED=true, environment precedence, explicit Ruby precedence, missing credentials, and deferred prompt validation. I did not preview the rendered Mermaid diagram in GitHub. I reviewed the Mermaid source and syntax locally.Note
Medium Risk
Changes core initialization, runtime telemetry toggling, and export paths; behavior is broad but covered by new specs and mostly fails closed when disabled.
Overview
Adds a
tracing_enabled/LANGFUSE_TRACING_ENABLEDkill switch so Langfuse tracing and scoring can be turned off without changing call sites. When disabled,observeand score APIs become no-ops (no credentials, no network);create_score!returnsnil; buffered spans are dropped viaTraceExportGuardon export/flush.OTEL_SDK_DISABLED=trueonly stops trace export while score ingestion can still run when telemetry is on.Clientno longer always validates credentials at boot: telemetry-off clients usevalidate_telemetry_disabled!, and the API/score clients are built lazily so prompt/data APIs still enforce full config on first use.Langfuse.configured?,tracer_provider, andensure_tracing_startedrespecttrace_export_enabled?and fall back to a shared no-op tracer provider.Also adds
PromptVariablesand#variableson text/chat prompt clients to list Mustache variables (sections, nested paths; chat skips placeholders), plus docs and specs for the new behavior.Reviewed by Cursor Bugbot for commit 6408b2a. Bugbot is set up for automated code reviews on this repo. Configure here.