-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add more detailed metrics * fix name of two metrics * add space to some of sync metrics * fix some spelling and cleanup some metrics * async -> custom * register missing metrics * cleanup metrics names * httpapi -> config
- Loading branch information
Showing
6 changed files
with
309 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
package httpapi | ||
|
||
import ( | ||
"github.com/prometheus/client_golang/prometheus" | ||
) | ||
|
||
func init() { | ||
prometheus.MustRegister(metricFunctionRegistered) | ||
prometheus.MustRegister(metricFunctionDeleted) | ||
|
||
prometheus.MustRegister(metricFunctionGetRequests) | ||
prometheus.MustRegister(metricFunctionRegisterRequests) | ||
prometheus.MustRegister(metricFunctionDeleteRequests) | ||
prometheus.MustRegister(metricFunctionUpdateRequests) | ||
prometheus.MustRegister(metricFunctionListRequests) | ||
|
||
prometheus.MustRegister(metricSubscriptionCreated) | ||
prometheus.MustRegister(metricSubscriptionDeleted) | ||
|
||
prometheus.MustRegister(metricSubscriptionGetRequests) | ||
prometheus.MustRegister(metricSubscriptionCreateRequests) | ||
prometheus.MustRegister(metricSubscriptionDeleteRequests) | ||
prometheus.MustRegister(metricSubscriptionListRequests) | ||
} | ||
|
||
// Functions | ||
|
||
var metricFunctionRegistered = prometheus.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Namespace: "gateway", | ||
Subsystem: "functions", | ||
Name: "registered_total", | ||
Help: "Total of functions registered.", | ||
}, []string{"space"}) | ||
|
||
var metricFunctionDeleted = prometheus.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Namespace: "gateway", | ||
Subsystem: "functions", | ||
Name: "deleted_total", | ||
Help: "Total of functions deleted.", | ||
}, []string{"space"}) | ||
|
||
// Functions Config API | ||
|
||
var metricFunctionGetRequests = prometheus.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Namespace: "gateway", | ||
Subsystem: "config", | ||
Name: "function_get_requests_total", | ||
Help: "Total of Config API get function requests.", | ||
}, []string{"space"}) | ||
|
||
var metricFunctionRegisterRequests = prometheus.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Namespace: "gateway", | ||
Subsystem: "config", | ||
Name: "function_register_requests_total", | ||
Help: "Total of Config API register function requests.", | ||
}, []string{"space"}) | ||
|
||
var metricFunctionDeleteRequests = prometheus.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Namespace: "gateway", | ||
Subsystem: "config", | ||
Name: "function_delete_requests_total", | ||
Help: "Total of Config API delete function requests.", | ||
}, []string{"space"}) | ||
|
||
var metricFunctionUpdateRequests = prometheus.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Namespace: "gateway", | ||
Subsystem: "config", | ||
Name: "function_update_requests_total", | ||
Help: "Total of Config API update function requests.", | ||
}, []string{"space"}) | ||
|
||
var metricFunctionListRequests = prometheus.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Namespace: "gateway", | ||
Subsystem: "config", | ||
Name: "function_list_requests_total", | ||
Help: "Total of Config API list functions requests.", | ||
}, []string{"space"}) | ||
|
||
// Subscriptions | ||
|
||
var metricSubscriptionCreated = prometheus.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Namespace: "gateway", | ||
Subsystem: "subscriptions", | ||
Name: "created_total", | ||
Help: "Total of subscriptions created.", | ||
}, []string{"space"}) | ||
|
||
var metricSubscriptionDeleted = prometheus.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Namespace: "gateway", | ||
Subsystem: "subscriptions", | ||
Name: "deleted_total", | ||
Help: "Total of subscriptions deleted.", | ||
}, []string{"space"}) | ||
|
||
// Subscriptions Config API | ||
|
||
var metricSubscriptionGetRequests = prometheus.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Namespace: "gateway", | ||
Subsystem: "config", | ||
Name: "subscription_get_requests_total", | ||
Help: "Total of Config API get subscription requests.", | ||
}, []string{"space"}) | ||
|
||
var metricSubscriptionCreateRequests = prometheus.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Namespace: "gateway", | ||
Subsystem: "config", | ||
Name: "subscription_create_requests_total", | ||
Help: "Total of Config API create subscription requests.", | ||
}, []string{"space"}) | ||
|
||
var metricSubscriptionDeleteRequests = prometheus.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Namespace: "gateway", | ||
Subsystem: "config", | ||
Name: "subscription_delete_requests_total", | ||
Help: "Total of Config API delete subscription requests.", | ||
}, []string{"space"}) | ||
|
||
var metricSubscriptionListRequests = prometheus.NewCounterVec( | ||
prometheus.CounterOpts{ | ||
Namespace: "gateway", | ||
Subsystem: "config", | ||
Name: "subscription_list_requests_total", | ||
Help: "Total of Config API list subscriptions requests.", | ||
}, []string{"space"}) |
Oops, something went wrong.