mirror of
https://github.com/pomerium/pomerium.git
synced 2025-04-30 19:06:33 +02:00
- Rename SessionState to State to avoid stutter. - Simplified option validation to use a wrapper function for base64 secrets. - Removed authenticates grpc code. - Abstracted logic to load and validate a user's authenticate session. - Removed instances of url.Parse in favor of urlutil's version. - proxy: replaces grpc refresh logic with forced deadline advancement. - internal/sessions: remove rest store; parse authorize header as part of session store. - proxy: refactor request signer - sessions: remove extend deadline (fixes #294) - remove AuthenticateInternalAddr - remove AuthenticateInternalAddrString - omit type tag.Key from declaration of vars TagKey* it will be inferred from the right-hand side - remove compatibility package xerrors - use cloned http.DefaultTransport as base transport
43 lines
1.3 KiB
Go
43 lines
1.3 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.MustNewKey("http_method")
|
|
TagKeyService = tag.MustNewKey("service")
|
|
TagKeyGRPCService = tag.MustNewKey("grpc_service")
|
|
TagKeyGRPCMethod = tag.MustNewKey("grpc_method")
|
|
TagKeyHost = tag.MustNewKey("host")
|
|
TagKeyDestination = 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,
|
|
InfoViews,
|
|
}
|
|
)
|