Skip to content

Conversation

@mdehsan873
Copy link
Contributor

@mdehsan873 mdehsan873 commented Dec 8, 2025

Note

Telemetry now sends events to a proxy endpoint without an API key, with simplified config handling and updated payload/headers.

  • Telemetry routing:
    • Replace PostHog host/track URL with PROXY_URL (https://scrapegraph-proxy.onrender.com/capture/).
    • Remove API key usage and Authorization header; send via proxy with JSON and User-Agent only.
  • Payload/behavior:
    • log_event sends event, distinct_id, and merged properties (no api_key).
    • Update telemetry_version to "0.0.4-proxy".
    • Keep async dispatch via thread; tweak debug messages and error handling.
  • Config/flags:
    • Simplify telemetry-enabled flag parsing from config and SCRAPEGRAPHAI_TELEMETRY_ENABLED env var.
    • Retain anonymous ID generation and session limiting logic.
  • Refactors:
    • Minor renames/cleanups in log_graph_execution and decorator capture_function_usage; remove verbose comments/docstrings.

Written by Cursor Bugbot for commit e230856. This will update automatically on new commits. Configure here.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Dec 8, 2025
@github-actions
Copy link

github-actions bot commented Dec 8, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA e230856.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@mdehsan873 mdehsan873 requested a review from VinciGit00 December 8, 2025 08:54
@dosubot dosubot bot added the enhancement New feature or request label Dec 8, 2025
"DEFAULT", "telemetry_enabled"
)
except Exception:
pass
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Environment variable telemetry override is completely broken

The environment variable SCRAPEGRAPHAI_TELEMETRY_ENABLED check is broken. The code checks if the variable is set (os.environ.get(...) is not None) but then reads from config_obj instead of using the actual environment variable value. The original code first assigned the env var value into config_obj["DEFAULT"]["telemetry_enabled"] = env_value before reading it back, but this assignment was removed. Now setting SCRAPEGRAPHAI_TELEMETRY_ENABLED=false won't actually disable telemetry since the env var value is never used.

Fix in Cursor Fix in Web

)

return wrapped_fn
log_event("function_usage", {"function_name": call_fn.__name__})
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Removed error handling exposes race condition in decorator

The capture_function_usage decorator removed the try/except block that previously wrapped the log_event call. Since send_event_json raises RuntimeError when telemetry is disabled, and there's a race condition where g_telemetry_enabled could be set to False (via disable_telemetry()) between the is_telemetry_enabled() check and the send_event_json call, any exception will now propagate up from the finally block. This could unexpectedly affect the decorated function's behavior when the original code silently caught these errors.

Fix in Cursor Fix in Web

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 8, 2025
@VinciGit00 VinciGit00 merged commit 1f7e533 into main Dec 8, 2025
8 of 9 checks passed
@VinciGit00 VinciGit00 deleted the posthog-proxy-implement branch December 8, 2025 16:16
@github-actions
Copy link

github-actions bot commented Dec 8, 2025

🎉 This PR is included in version 1.65.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer released on @stable size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants