Telemetry from the FE to be logged to langfuse via backend#65
Conversation
|
Holding this until backend PR OpenAgriNet/amul-oan-api#63 is fixed and merged — this is the client side of that telemetry endpoint, and #63 currently has blocking security issues (unauthenticated, unbounded public ingest into production Langfuse). Merging this first would point the FE at an endpoint that's either absent on The diff here is otherwise fine — One thing to confirm before merge: |
Keep both telemetry pathways open simultaneously instead of cutting over hard to the new backend/Langfuse path: - emitTelemetry() fans each chat event (question/response/error/ feedback) out to BOTH sendTelemetryToBackend (new) and the legacy Sunbird Telemetry.response (guarded, fault-isolated). - startTelemetry() restores the legacy Telemetry.start session alongside fingerprint/PerfObserver setup; params no longer discarded. - endTelemetry() closes the legacy session again. - LEGACY_TELEMETRY_ENABLED flag to retire the legacy path in one line once the new pathway is validated. Anonymous-token event stays new-path only (legacy Sunbird has no such event and expects a target). Each sink is independently try/catch'd so the legacy SDK can never break the new path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The 2048->4096-bit public-key rotation is a cross-service change that must deploy in lockstep with the backend signing key. Reverting it to amul-dev's current key so this PR ships only the telemetry dual-write; key rotation will be handled as its own backend-coordinated PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts: # .gitignore
-Fixed frontend telemetry gaps:
-ensured response events are logged across multi-turn chats
-ensured feedback uses questionId linkage correctly
-Updated local dev proxy in OAN-UI so /observability-service reaches backend.