You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The following tags are applied to stats recorded by this package.
13
+
var (
14
+
// GoSqlMethod is the SQL method called.
15
+
GoSqlMethod, _=tag.NewKey("go_sql_method")
16
+
// GoSqlError is the error received while calling a SQL method.
17
+
GoSqlError, _=tag.NewKey("go_sql_error")
18
+
// GoSqlStatus identifies success vs. error from the SQL method response.
19
+
GoSqlStatus, _=tag.NewKey("go_sql_status")
20
+
21
+
valueOK=tag.Insert(GoSqlStatus, "OK")
22
+
valueErr=tag.Insert(GoSqlStatus, "ERROR")
23
+
)
24
+
25
+
// The following measures are supported for use in custom views.
26
+
var (
27
+
MeasureLatencyMs=stats.Float64("go.sql/latency", "The latency of calls in milliseconds", stats.UnitMilliseconds)
28
+
MeasureOpenConnections=stats.Int64("go.sql/connections/open", "Count of open connections in the pool", stats.UnitDimensionless)
29
+
MeasureIdleConnections=stats.Int64("go.sql/connections/idle", "Count of idle connections in the pool", stats.UnitDimensionless)
30
+
MeasureActiveConnections=stats.Int64("go.sql/connections/active", "Count of active connections in the pool", stats.UnitDimensionless)
31
+
MeasureWaitCount=stats.Int64("go.sql/connections/wait_count", "The total number of connections waited for", stats.UnitDimensionless)
32
+
MeasureWaitDuration=stats.Float64("go.sql/connections/wait_duration", "The total time blocked waiting for a new connection", stats.UnitMilliseconds)
33
+
MeasureIdleClosed=stats.Int64("go.sql/connections/idle_closed", "The total number of connections closed due to SetMaxIdleConns", stats.UnitDimensionless)
34
+
MeasureLifetimeClosed=stats.Int64("go.sql/connections/lifetime_closed", "The total number of connections closed due to SetConnMaxLifetime", stats.UnitDimensionless)
35
+
)
36
+
37
+
// Default distributions used by views in this package
0 commit comments