change
This commit is contained in:
@@ -23,6 +23,7 @@ import (
|
|||||||
|
|
||||||
"go.opentelemetry.io/otel"
|
"go.opentelemetry.io/otel"
|
||||||
"go.opentelemetry.io/otel/attribute"
|
"go.opentelemetry.io/otel/attribute"
|
||||||
|
"go.opentelemetry.io/otel/metric"
|
||||||
"go.opentelemetry.io/otel/trace"
|
"go.opentelemetry.io/otel/trace"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -456,10 +457,11 @@ func CartIdHandler(fn func(cartId cart.CartId, w http.ResponseWriter, r *http.Re
|
|||||||
func (s *PoolServer) ProxyHandler(fn func(w http.ResponseWriter, r *http.Request, cartId cart.CartId) error) func(cartId cart.CartId, w http.ResponseWriter, r *http.Request) error {
|
func (s *PoolServer) ProxyHandler(fn func(w http.ResponseWriter, r *http.Request, cartId cart.CartId) error) func(cartId cart.CartId, w http.ResponseWriter, r *http.Request) error {
|
||||||
return func(cartId cart.CartId, w http.ResponseWriter, r *http.Request) error {
|
return func(cartId cart.CartId, w http.ResponseWriter, r *http.Request) error {
|
||||||
if ownerHost, ok := s.OwnerHost(uint64(cartId)); ok {
|
if ownerHost, ok := s.OwnerHost(uint64(cartId)); ok {
|
||||||
_, span := tracer.Start(r.Context(), "proxy")
|
ctx, span := tracer.Start(r.Context(), "proxy")
|
||||||
defer span.End()
|
defer span.End()
|
||||||
|
hostAttr := attribute.String("other host", ownerHost.Name())
|
||||||
span.SetAttributes(attribute.String("other host", ownerHost.Name()))
|
span.SetAttributes(hostAttr)
|
||||||
|
proxyCalls.Add(ctx, 1, metric.WithAttributes(hostAttr))
|
||||||
handled, err := ownerHost.Proxy(uint64(cartId), w, r)
|
handled, err := ownerHost.Proxy(uint64(cartId), w, r)
|
||||||
|
|
||||||
grainLookups.Inc()
|
grainLookups.Inc()
|
||||||
@@ -477,8 +479,9 @@ func (s *PoolServer) ProxyHandler(fn func(w http.ResponseWriter, r *http.Request
|
|||||||
var (
|
var (
|
||||||
tracer = otel.Tracer(name)
|
tracer = otel.Tracer(name)
|
||||||
|
|
||||||
// meter = otel.Meter(name)
|
meter = otel.Meter(name)
|
||||||
logger = otelslog.NewLogger(name)
|
logger = otelslog.NewLogger(name)
|
||||||
|
proxyCalls metric.Int64Counter
|
||||||
|
|
||||||
// rollCnt metric.Int64Counter
|
// rollCnt metric.Int64Counter
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -60,14 +60,14 @@ spec:
|
|||||||
path: /livez
|
path: /livez
|
||||||
port: web
|
port: web
|
||||||
failureThreshold: 1
|
failureThreshold: 1
|
||||||
periodSeconds: 10
|
periodSeconds: 30
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /readyz
|
path: /readyz
|
||||||
port: web
|
port: web
|
||||||
failureThreshold: 2
|
failureThreshold: 2
|
||||||
initialDelaySeconds: 2
|
initialDelaySeconds: 2
|
||||||
periodSeconds: 10
|
periodSeconds: 30
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: "/data"
|
- mountPath: "/data"
|
||||||
name: data
|
name: data
|
||||||
@@ -152,14 +152,14 @@ spec:
|
|||||||
path: /livez
|
path: /livez
|
||||||
port: web
|
port: web
|
||||||
failureThreshold: 1
|
failureThreshold: 1
|
||||||
periodSeconds: 10
|
periodSeconds: 30
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /readyz
|
path: /readyz
|
||||||
port: web
|
port: web
|
||||||
failureThreshold: 2
|
failureThreshold: 2
|
||||||
initialDelaySeconds: 2
|
initialDelaySeconds: 2
|
||||||
periodSeconds: 10
|
periodSeconds: 50
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: "/data"
|
- mountPath: "/data"
|
||||||
name: data
|
name: data
|
||||||
@@ -260,14 +260,14 @@ spec:
|
|||||||
path: /livez
|
path: /livez
|
||||||
port: web
|
port: web
|
||||||
failureThreshold: 1
|
failureThreshold: 1
|
||||||
periodSeconds: 10
|
periodSeconds: 30
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /readyz
|
path: /readyz
|
||||||
port: web
|
port: web
|
||||||
failureThreshold: 2
|
failureThreshold: 2
|
||||||
initialDelaySeconds: 2
|
initialDelaySeconds: 2
|
||||||
periodSeconds: 10
|
periodSeconds: 30
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: "/data"
|
- mountPath: "/data"
|
||||||
name: data
|
name: data
|
||||||
|
|||||||
Reference in New Issue
Block a user