Metrics data is stored as structure, HTTP requests logging, got rid of context.
Metrics data now stored as structures. This is a first step for autodiscovery helping for NMSes. HTTP requests now logged. Got rid of context.Context for getting metric data in applications because context.Context is useless here.
This commit is contained in:
@@ -1,11 +0,0 @@
|
||||
package common
|
||||
|
||||
// ContextKey is a type of context.Context keys.
|
||||
type ContextKey string
|
||||
|
||||
const (
|
||||
// ContextKeyApplication specifies that returned value is a name of application.
|
||||
ContextKeyApplication ContextKey = "applicationName"
|
||||
// ContextKeyMetric specifies that returned value is a name of metric of application.
|
||||
ContextKeyMetric ContextKey = "metricName"
|
||||
)
|
@@ -1,6 +1,6 @@
|
||||
package common
|
||||
|
||||
import "context"
|
||||
import "go.dev.pztrn.name/metricator/internal/models"
|
||||
|
||||
// HTTPHandlerFunc describes signature of HTTP requests handling function.
|
||||
type HTTPHandlerFunc func(context.Context) string
|
||||
type HTTPHandlerFunc func(*models.RequestInfo) string
|
||||
|
Reference in New Issue
Block a user