telmetry: add databroker storage metrics and tracing (#1161)

* telmetry: add databroker storage metrics and tracing
This commit is contained in:
Travis Groth 2020-07-30 18:19:23 -04:00 committed by GitHub
parent 29fb96a955
commit 3c4513a91e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 255 additions and 15 deletions

View file

@ -17,6 +17,7 @@ import (
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/emptypb"
"github.com/pomerium/pomerium/config"
"github.com/pomerium/pomerium/internal/log"
"github.com/pomerium/pomerium/internal/signal"
"github.com/pomerium/pomerium/internal/telemetry/trace"
@ -348,9 +349,9 @@ func (srv *Server) getDB(recordType string) (storage.Backend, error) {
func (srv *Server) newDB(recordType string) (db storage.Backend, err error) {
switch srv.cfg.storageType {
case inmemory.Name:
case config.StorageInMemoryName:
db = inmemory.NewDB(recordType, srv.cfg.btreeDegree)
case redis.Name:
case config.StorageRedisName:
db, err = redis.New(srv.cfg.storageConnectionString, recordType, int64(srv.cfg.deletePermanentlyAfter.Seconds()))
if err != nil {
return nil, fmt.Errorf("failed to create new redis storage: %w", err)