MCPcopy
hub / github.com/grafana/dskit / New

Function New

server/server.go:288–291  ·  view source on GitHub ↗

New makes a new Server. It will panic if the metrics cannot be registered.

(cfg Config)

Source from the content-addressed store, hash-verified

286
287// New makes a new Server. It will panic if the metrics cannot be registered.
288func New(cfg Config) (*Server, error) {
289 metrics := NewServerMetrics(cfg)
290 return newServer(cfg, metrics)
291}
292
293// NewWithMetrics makes a new Server using the provided Metrics. It will not attempt to register the metrics,
294// the user is responsible for doing so.

Callers 15

TestOTelTracingFunction · 0.92
TestHTTPGRPCTracingFunction · 0.92
TestDefaultAddressesFunction · 0.70
TestRunReturnsErrorFunction · 0.70
TestMiddlewareLoggingFunction · 0.70
TestTLSServerFunction · 0.70
TestLogSourceIPsFunction · 0.70

Calls 2

NewServerMetricsFunction · 0.85
newServerFunction · 0.85

Tested by 15

TestOTelTracingFunction · 0.74
TestHTTPGRPCTracingFunction · 0.74
TestDefaultAddressesFunction · 0.56
TestRunReturnsErrorFunction · 0.56
TestMiddlewareLoggingFunction · 0.56
TestTLSServerFunction · 0.56
TestLogSourceIPsFunction · 0.56