feat(go): implement metrics and tracing for http and grpc servers #5925
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses the lack of observability in the Feast Go Feature Server by implementing comprehensive metrics for both HTTP and gRPC endpoints, and integrating them with the existing OpenTelemetry tracing.
Changes
gotoprom(a type-safe wrapper for the official Prometheus client) to ensure standardized bucket configuration and label safety.internal/feast/metrics/metrics.goto define histograms and counters./metricsendpoint.internal/feast/server/http_server.goto capture request duration and status codes.http_server.go(instead ofmain.go) to maintain high cohesion within the server struct and ensure metrics are applied correctly to business endpoints while excluding health checks.main.goto capture gRPC specific metrics (latency, status codes, methods).9090to expose Prometheus metrics when running in gRPC mode.How Has This Been Tested?
/metricsendpoint returns valid Prometheus data./get-online-featuresincrements the counters and updates histograms.metrics_test.go.Checklist
go.mod/go.sum).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