Skip to content

Telemetry from the FE to be logged to langfuse via backend#65

Merged
KDwevedi merged 7 commits into
amul-devfrom
Telemetry_FE
May 19, 2026
Merged

Telemetry from the FE to be logged to langfuse via backend#65
KDwevedi merged 7 commits into
amul-devfrom
Telemetry_FE

Conversation

@yashgoel1331
Copy link
Copy Markdown

-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.

@KDwevedi
Copy link
Copy Markdown
Collaborator

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 main or insecure.

The diff here is otherwise fine — public/jwt_public_key.pem is the public key (private key was never tracked; the new .gitignore entry is good defensive hygiene), and the react-markdown/remark-gfm additions correctly render the new milk-collection tables.

One thing to confirm before merge: @fingerprintjs/fingerprintjs is device-fingerprinting used for the anonymous_token_issued flow — given the farmer user base, please get an explicit privacy sign-off on collecting/transmitting a device fingerprint, and confirm what's stored on the Langfuse side.

@KDwevedi KDwevedi mentioned this pull request May 19, 2026
yashgoel1331 and others added 4 commits May 19, 2026 15:33
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants