Documentation ¶
Index ¶
- Variables
- func AddReasonTag(ctx context.Context, reason string) (context.Context, error)
- func AddTargetTag(ctx context.Context, target string) (context.Context, error)
- func AddVersionTag(ctx context.Context, version string) (context.Context, error)
- func Initialize(cfg config.InstrumentationConfig) error
- func InitializeLatencyTracking(ctx context.Context) context.Context
- func RecordLatency(ctx context.Context)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // MLatencyMs records the time it took for request to be served (routed to proxy) MLatencyMs = stats.Float64("request/latency", "Latency of request served", "ms") // KeyTarget holds target information of the request being routed. It will be either "canary" or "main" KeyTarget, _ = tag.NewKey("target") // KeyReason holds information of the reason on routing decision KeyReason, _ = tag.NewKey("reason") // KeyVersion holds information of binary version KeyVersion, _ = tag.NewKey("version") )
View Source
var ( // RequestCountView provide View for request count grouped by target and reason RequestCountView = &view.View{ Name: "request/count", Measure: MLatencyMs, Description: "The count of requests per target and reason", Aggregation: view.Count(), TagKeys: []tag.Key{KeyVersion, KeyTarget, KeyReason}, } // RequestLatencyView provide view for latency count distribution RequestLatencyView = &view.View{ Name: "request/latency", Measure: MLatencyMs, Description: "The latency distribution per request target", Aggregation: view.Distribution(0, 25, 50, 75, 100, 200, 400, 600, 800, 1000, 2000, 4000, 6000), TagKeys: []tag.Key{KeyVersion, KeyTarget}, } )
Functions ¶
func AddReasonTag ¶
AddReasonTag ...
func AddTargetTag ¶
AddTargetTag ...
func AddVersionTag ¶
AddVersionTag ...
func Initialize ¶
func Initialize(cfg config.InstrumentationConfig) error
Initialize register views and default Prometheus exporter
func InitializeLatencyTracking ¶
InitializeLatencyTracking ...
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.