The Simplest Way to Make Json Rpc and Lightstep Work Like They Should
You pair json rpc and lightstep to trace remote calls across your backend apps. This setup shows your team which method calls fail or run slow in production. Remote procedure calls pack method names and data into a single text payload. Standard web monitors only see one web route and one status code for every call. Passing trace headers inside your remote calls lets your trace tool track every single method. How json rpc and lightstep share data and permissions Your client app starts a trace
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You pair json rpc and lightstep to trace remote calls across your backend apps. This setup shows your team which method calls fail or run slow in production.
Remote procedure calls pack method names and data into a single text payload. Standard web monitors only see one web route and one status code for every call. Passing trace headers inside your remote calls lets your trace tool track every single method.
How json rpc and lightstep share data and permissions
Your client app starts a trace and creates a unique trace ID for the request. It puts this ID into the request metadata or the transport headers before sending. The server reads the ID, runs the requested method, and records the time taken.
Both apps send their span data to the trace collector using a project key. Each service needs its own key with write-only rights for span data. Read keys stay locked down to specific team roles inside the trace dashboard.
Good spans tag the exact method name from the payload so teams can filter calls. Without this tag, every span in your dashboard looks like the exact same web request. You also want to tag error codes from the response body onto the span.
Common failure modes and how to scope roles
Many teams make the mistake of logging the entire request body into span tags. Request params often hold sensitive data like emails, phone numbers, card numbers, or national IDs. If you send raw params to your trace tool, every dashboard reader sees that data.
Masking rules should rewrite matched fields in results and spans before data leaves your network. Another common issue happens when batch requests pack ten method calls into one payload. If the server uses one span for the whole batch, slow methods hide inside.
JSON Web Tokens (JWT) + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Your server code must start a child span for each item in the batch array. Shared project keys also create risk when one key gets leaked in a client app. Give each backend app a separate ingest key so you can rotate keys fast.
Fixing broken traces across queue workers
Many teams send remote procedure payloads over message queues instead of direct web calls. Queue workers often drop the trace context because they only read the message body. When this happens, your trace map splits into two separate halves with no link.
You can fix this by putting the trace state inside a metadata object in the payload. The worker pulls the trace state out before it runs the target method. It then links its new span to the parent span from the caller app.
Keep network paths tight so only backend apps can send data to the collector. Client browsers and mobile apps should not hold ingest keys for your trace project. Route client trace data through your own backend so you control what gets logged.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.
Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Why do all my remote calls show up under one route name?
Most web tools name spans after the URL path, which never changes for these calls. You must read the method field from the payload and set it as the span name.
How do I handle errors when the web status is always 200 OK?
Check the response body for an error object before you close the active span. If the error field exists, mark the span as failed and record the error code.
How do I keep private user data out of my trace spans?
Never attach raw request parameters or full response bodies to your span tags. Log only the method name, the request ID, and safe numeric counts or status codes.
Related guides
In this post