mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* Cloud migrations: create route to delete token * gcom.DeleteToken returns ErrTokenNotFound instead of a boolean * remove unnecessary comment * make openapi3-gen && yarn run rtk-query-codegen-openapi ./scripts/generate-rtk-apis.ts * gcom stub: implement DeleteToken
43 lines
1.0 KiB
Go
43 lines
1.0 KiB
Go
package cloudmigrationimpl
|
|
|
|
import (
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
)
|
|
|
|
const (
|
|
namespace = "grafana"
|
|
subsystem = "cloudmigrations"
|
|
)
|
|
|
|
type Metrics struct {
|
|
accessTokenCreated *prometheus.CounterVec
|
|
accessTokenDeleted *prometheus.CounterVec
|
|
}
|
|
|
|
func newMetrics() *Metrics {
|
|
return &Metrics{
|
|
accessTokenCreated: prometheus.NewCounterVec(prometheus.CounterOpts{
|
|
Namespace: namespace,
|
|
Subsystem: subsystem,
|
|
Name: "access_token_created",
|
|
Help: "Total of access tokens created",
|
|
}, []string{"slug"}),
|
|
accessTokenDeleted: prometheus.NewCounterVec(prometheus.CounterOpts{
|
|
Namespace: namespace,
|
|
Subsystem: subsystem,
|
|
Name: "access_token_deleted",
|
|
Help: "Total of access tokens deleted",
|
|
}, []string{"slug"}),
|
|
}
|
|
}
|
|
|
|
func (metrics *Metrics) Collect(ch chan<- prometheus.Metric) {
|
|
metrics.accessTokenCreated.Collect(ch)
|
|
metrics.accessTokenDeleted.Collect(ch)
|
|
}
|
|
|
|
func (metrics *Metrics) Describe(ch chan<- *prometheus.Desc) {
|
|
metrics.accessTokenCreated.Describe(ch)
|
|
metrics.accessTokenDeleted.Describe(ch)
|
|
}
|