mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-06 17:57:51 +00:00
instrument k8s-prometheus-adapter to expose prometheus metrics
fixes #218
This commit is contained in:
parent
28a807aa9f
commit
cbba53e16b
11 changed files with 308 additions and 14 deletions
18
pkg/errors/errors.go
Normal file
18
pkg/errors/errors.go
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package errors
|
||||
|
||||
import (
|
||||
"github.com/directxman12/k8s-prometheus-adapter/pkg/metrics"
|
||||
"github.com/kubernetes-incubator/custom-metrics-apiserver/pkg/provider"
|
||||
apierr "k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
func NewMetricNotFoundError(resource schema.GroupResource, metricName string) error {
|
||||
metrics.Errors.WithLabelValues("not_found").Inc()
|
||||
return provider.NewMetricNotFoundError(resource, metricName)
|
||||
}
|
||||
|
||||
func NewInternalError(err error) *apierr.StatusError {
|
||||
metrics.Errors.WithLabelValues("internal").Inc()
|
||||
return apierr.NewInternalError(err)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue