mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-06 09:47:54 +00:00
18 lines
596 B
Go
18 lines
596 B
Go
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)
|
|
}
|