mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-21 02:28:06 +02:00
- telemetry/tace: add traces throughout code - telemetry/metrics: nest metrics and trace under telemetry - telemetry/tace: add service name span to HTTPMetricsHandler. - telemetry/metrics: removed chain dependency middleware_tests. - telemetry/metrics: wrap and encapsulate variatic view registration. - telemetry/tace: add jaeger support for tracing. - cmd/pomerium: move `parseOptions` to internal/config. - cmd/pomerium: offload server handling to httputil and sub pkgs. - httputil: standardize creation/shutdown of http listeners. - httputil: prefer curve X25519 to P256 when negotiating TLS. - fileutil: use standardized Getw Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
41 lines
1.4 KiB
Go
41 lines
1.4 KiB
Go
package metrics // import "github.com/pomerium/pomerium/internal/telemetry/metrics"
|
|
|
|
import (
|
|
"go.opencensus.io/plugin/ocgrpc"
|
|
"go.opencensus.io/stats/view"
|
|
"go.opencensus.io/tag"
|
|
)
|
|
|
|
// The following tags are applied to stats recorded by this package.
|
|
var (
|
|
TagKeyHTTPMethod tag.Key = tag.MustNewKey("http_method")
|
|
TagKeyService tag.Key = tag.MustNewKey("service")
|
|
TagKeyGRPCService tag.Key = tag.MustNewKey("grpc_service")
|
|
TagKeyGRPCMethod tag.Key = tag.MustNewKey("grpc_method")
|
|
TagKeyHost tag.Key = tag.MustNewKey("host")
|
|
TagKeyDestination tag.Key = tag.MustNewKey("destination")
|
|
)
|
|
|
|
// Default distributions used by views in this package.
|
|
var (
|
|
DefaulHTTPSizeDistribution = view.Distribution(
|
|
1, 256, 512, 1024, 2048, 8192, 16384, 32768, 65536, 131072, 262144,
|
|
524288, 1048576, 2097152, 4194304, 8388608)
|
|
DefaultHTTPLatencyDistrubtion = view.Distribution(
|
|
1, 2, 5, 7, 10, 25, 500, 750, 100, 250, 500, 750, 1000, 2500, 5000,
|
|
7500, 10000, 25000, 50000, 75000, 100000)
|
|
grpcSizeDistribution = view.Distribution(
|
|
1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024,
|
|
2048, 4096, 8192, 16384,
|
|
)
|
|
DefaultMillisecondsDistribution = ocgrpc.DefaultMillisecondsDistribution
|
|
)
|
|
|
|
// DefaultViews are a set of default views to view HTTP and GRPC metrics.
|
|
var (
|
|
DefaultViews = [][]*view.View{
|
|
GRPCServerViews,
|
|
HTTPServerViews,
|
|
GRPCClientViews,
|
|
GRPCServerViews}
|
|
)
|