mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-08 14:39:09 +02:00
[proxy] Reverse-proxy middleware framework, chain, and request plumbing
The per-target middleware chain (slots, dispatcher, mutation gate, metadata merger), body capture, access-log terminal sink, and the proxy wiring that builds + runs chains for synthesized agent-network services.
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
||||
// Metrics collects OpenTelemetry metrics for the proxy.
|
||||
type Metrics struct {
|
||||
ctx context.Context
|
||||
meter metric.Meter
|
||||
requestsTotal metric.Int64Counter
|
||||
activeRequests metric.Int64UpDownCounter
|
||||
configuredDomains metric.Int64UpDownCounter
|
||||
@@ -49,10 +50,18 @@ type Metrics struct {
|
||||
mappingPaths map[string]int
|
||||
}
|
||||
|
||||
// Meter returns the OpenTelemetry meter the bundle was built with, so other
|
||||
// subsystems (e.g. the middleware manager) register instruments on the same
|
||||
// meter.
|
||||
func (m *Metrics) Meter() metric.Meter {
|
||||
return m.meter
|
||||
}
|
||||
|
||||
// New creates a Metrics instance using the given OpenTelemetry meter.
|
||||
func New(ctx context.Context, meter metric.Meter) (*Metrics, error) {
|
||||
m := &Metrics{
|
||||
ctx: ctx,
|
||||
meter: meter,
|
||||
mappingPaths: make(map[string]int),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user