[Improvement]: Loopback provider-event suppression also drops traffic-log events for the internal LLM proxy hop
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 71
- Forks
- 111
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 110
Description
Please select the area the issue is related to
Gateway
Please select the aspect the issue is related to
Aspect/Logging (Log formats, instrumentation, improvements)
Suggested Improvement
The fix for duplicate LLM proxy analytics events[1] suppresses the internal loopback LlmProvider hop in Analytics.Process (gateway/gateway-runtime/policy-engine/internal/analytics/analytics.go). That correctly removes the Moesif double-count. However, the suppression is implemented as an early return placed above the publisher fan-out, so it applies to every registered publisher not just the one with the double-count problem.
For every LLM proxy invocation, the provider hop disappears from the traffic log. That is the only record that measures the real vendor round-trip in isolation:
| Hop | Measures | After the fix |
|---|---|---|
| LlmProxy (client → gateway) | Whole chain, including the loopback re-entry | Logged |
| LlmProvider (gateway → vendor) | Actual vendor latency / response | Dropped |
Consequences:
- "Was the call slow because of the LLM vendor or because of our own mediation?" is no longer
answerable from the traffic log for proxied APIs. - Any debugging, audit, or SIEM pipeline consuming the traffic log silently loses the upstream
hop for all proxied LLM traffic.
Expected behaviour
Suppression should be scoped to the consumer that requires it (Moesif). The traffic-log publisher
should continue to receive both hops.
Related Issues
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in gateway/gateway-runtime/policy-engine/internal/analytics/analytics.go at Analytics.Process and inspect the early return before publisher fan-out. Trace the registered publishers to scope suppression to Moesif while preserving the LlmProvider event for traffic logging; verify both LlmProxy and LlmProvider hops remain in traffic logs and Moesif does not double-count.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- observability-sre
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100