Skip to content

impl: gRPC server logging interceptors#68

Merged
anj-s merged 3 commits into
mainfrom
u/anj/observability-pr2
Jun 10, 2026
Merged

impl: gRPC server logging interceptors#68
anj-s merged 3 commits into
mainfrom
u/anj/observability-pr2

Conversation

@anj-s

@anj-s anj-s commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • gRPC Server Logging Interceptors: Implemented and registered logging interceptors for both unary and stream gRPC services in the AX server.
  • Unary Interceptor (LoggingInterceptor): Captures and logs incoming unary RPC details, including full method names, duration, request success/failure, and dynamically extracts and includes conversation_id in log context if the request supports GetConversationId().
  • Stream Interceptor (StreamLoggingInterceptor): Logs stream lifecycle events (start, complete, fail) along with latency, method names, and errors.
  • Service Integration: Registered the logging interceptors in both the standard server (server.go) and the harness server (server_harness.go) using grpc.ChainUnaryInterceptor and grpc.ChainStreamInterceptor.
  • Unit Testing: Added a robust mock-server test suite using bufconn to assert correct log formats, message contents, and error handling for both successful and failing unary/stream calls.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactor (cleanups and structured logging migration)
  • Documentation
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Related Issues

Part 2 of the Observability & Monitoring epic.

Test Plan

  • Automated Tests: Unit tests pass for both standard and harness build tags:
    go test -v ./internal/server
    go test -v -tags harness ./internal/server
  • Verification: Verified correct log output structures and assert JSON format validation (e.g. conversation_id propagation).

Notes for Reviewer

This is the second of 5 planned modular PRs to roll out comprehensive AX observability. It introduces automatic logging for gRPC server entrypoints.

@anj-s anj-s requested a review from wjjclaud June 10, 2026 20:53
@anj-s anj-s marked this pull request as ready for review June 10, 2026 20:53
@anj-s anj-s merged commit 6ce9531 into main Jun 10, 2026
7 checks passed
@anj-s anj-s deleted the u/anj/observability-pr2 branch June 10, 2026 21:25
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