Skip to content

Commit

Permalink
make datastore metrics more representative of the actual underlying d…
Browse files Browse the repository at this point in the history
…atastore

the datastore metrics proxy was installed after
various other proxies that try to help with
datastore performance, namely caching and deduplication.
If the proxy is installed after those, the metrics
obtained do not reflect the actual latencies and requests
to the datastore:
- latencies will be lower thanks to caching and deduplication
- actual datastore calls will be higher that they actually are
  because some requests may never hit the datastore

Given how important is the access to the datastore for the latency
and throughput of the application, this moves the proxy so it
measures actual calls to the datastore by moving it around
the proxy chain.
  • Loading branch information
vroldanbet committed Dec 1, 2023
1 parent 9415fff commit c7a9678
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/cmd/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,9 @@ func (c *Config) Complete(ctx context.Context) (RunnableServer, error) {
cachingMode = schemacaching.WatchIfSupported
}

ds = proxy.NewObservableDatastoreProxy(ds)
ds = proxy.NewSingleflightDatastoreProxy(ds)
ds = schemacaching.NewCachingDatastoreProxy(ds, nscc, c.DatastoreConfig.GCWindow, cachingMode)
ds = proxy.NewObservableDatastoreProxy(ds)
closeables.AddWithError(ds.Close)

enableGRPCHistogram()
Expand Down

0 comments on commit c7a9678

Please sign in to comment.