Title: feat(go): Implement metrics and tracing for http and grpc servers by luisazofracabify · Pull Request #5925 · feast-dev/feast · GitHub
Open Graph Title: feat(go): Implement metrics and tracing for http and grpc servers by luisazofracabify · Pull Request #5925 · feast-dev/feast
X Title: feat(go): Implement metrics and tracing for http and grpc servers by luisazofracabify · Pull Request #5925 · feast-dev/feast
Description: Description This PR significantly improves the observability and reliability of the Feast Go Feature Server by implementing comprehensive Prometheus metrics, and robust configuration options for both HTTP and gRPC modes. It addresses issues with hardcoded ports, inconsistent metric exposure, and potential race conditions during shutdown. Changes 1. Prometheus Metrics Instrumentation Unified Metrics Server: Implemented a dedicated, configurable HTTP server (default port :9090) for serving metrics in both HTTP and gRPC modes. This unifies the observability strategy. HTTP Server Instrumentation: Added metricsMiddleware in internal/feast/server/http_server.go to track: Request duration (http_request_duration_seconds) Request counts by method, path, and status (http_requests_total) Instrumented the /health endpoint for readiness probe visibility. gRPC Metrics: Integrated go-grpc-prometheus to fully expose standard gRPC server metrics. 2. Tracing Enhancements Dynamic Service Name: Improved the existing OpenTelemetry integration by adding support for the OTEL_SERVICE_NAME environment variable (defaults to FeastGoFeatureServer). This allows proper service identification in distributed tracing systems without code changes. 3. Server Configuration & Reliability Configurable Metrics Port: Added -metrics-port flag to main.go. Graceful Shutdown: Implemented sync.WaitGroup in StartHttpServer to ensure clean shutdown of the metrics server and logging services, matching the robust behavior of StartGrpcServer. Code Cleanup: Refactored ServerStarter interfaces and removed unused legacy code. How Has This Been Tested? Verification Confirmed /metrics endpoint accessibility on custom ports. Verified /health and request metrics counters. Validated status 200 recording fix. Tested OTEL_SERVICE_NAME env var reflects in traces. Verified clean shutdown logs (SIGINT/SIGTERM). Checklist My code follows the code style of this project. I have added tests that prove my fix is effective or that my feature works. I have updated the dependencies (go.mod / go.sum). All new and existing tests passed. Why gotoprom It reduces boilerplate code for histograms and ensures type-safety for labels, preventing runtime panics due to mismatched label cardinality. It wraps the official prometheus client, so it's fully compatible
Open Graph Description: Description This PR significantly improves the observability and reliability of the Feast Go Feature Server by implementing comprehensive Prometheus metrics, and robust configuration options for bo...
X Description: Description This PR significantly improves the observability and reliability of the Feast Go Feature Server by implementing comprehensive Prometheus metrics, and robust configuration options for bo...
Opengraph URL: https://github.com/feast-dev/feast/pull/5925
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:0ef180ae-0a30-323a-8f2a-7d09762aeed6 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B40C:BDC69:13BDFE3:1ACAACE:6A4D7298 |
| html-safe-nonce | 5b420b81a615cb550f6bbb654cb554783d08dcbb4a29786e338a68137021c8c8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDBDOkJEQzY5OjEzQkRGRTM6MUFDQUFDRTo2QTRENzI5OCIsInZpc2l0b3JfaWQiOiIzNTQ1NDk4NTcxMjM4MTA5ODQ4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 35f071d93c3c6eea1606957ba43cf28be060a1eeb05acc5d51e29fe0ac2fbd4b |
| hovercard-subject-tag | pull_request:3227547243 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/feast-dev/feast/pull/5925/files |
| twitter:image | https://avatars.githubusercontent.com/u/220917905?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/220917905?s=400&v=4 |
| og:image:alt | Description This PR significantly improves the observability and reliability of the Feast Go Feature Server by implementing comprehensive Prometheus metrics, and robust configuration options for bo... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | c78260c7b3f4ac4b0356c8208537f05406a3a2d46a9ec3f735b372dcc519c39e |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/feast-dev/feast git https://github.com/feast-dev/feast.git |
| octolytics-dimension-user_id | 57027613 |
| octolytics-dimension-user_login | feast-dev |
| octolytics-dimension-repository_id | 161133770 |
| octolytics-dimension-repository_nwo | feast-dev/feast |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 161133770 |
| octolytics-dimension-repository_network_root_nwo | feast-dev/feast |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 399fff412f48461d435721c009efc17ea44be72f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width