Documentation ¶
Overview ¶
Copyright 2024 Adobe. All rights reserved. This file is licensed to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type Metric
- type Metrics
- func (m *Metrics) RecordEgressRequestCnt(target string)
- func (m *Metrics) RecordEgressRequestDur(target string, elapsed float64)
- func (m *Metrics) RecordErrorCnt(target string)
- func (m *Metrics) RecordIngressRequestCnt(code, method, url string)
- func (m *Metrics) RecordIngressRequestDur(code, method, url string, elapsed float64)
- func (m *Metrics) Use(e *echo.Echo)
- type MetricsI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Metric ¶
type Metric struct { MetricCollector prometheus.Collector ID string Name string Description string Type string Args []string }
Metric is a definition for the name, description, type, ID, and prometheus.Collector type (i.e. CounterVec, HistogramVec, etc) of each metric
type Metrics ¶
type Metrics struct { // Context string to use as a prometheus URL label URLLabelFromContext string // contains filtered or unexported fields }
Metrics contains the metrics gathered by the instance and its path
func NewMetrics ¶
NewMetrics generates a new set of metrics with a certain subsystem name
func (*Metrics) RecordEgressRequestCnt ¶
RecordEgressRequestCnt increases the Egress counter for a target
func (*Metrics) RecordEgressRequestDur ¶
RecordEgressRequestDur registers the Egress duration for a target
func (*Metrics) RecordErrorCnt ¶
RecordErrorCnt increases the error counter for a target
func (*Metrics) RecordIngressRequestCnt ¶
RecordIngressRequestCnt increases the Ingress counter for a target
func (*Metrics) RecordIngressRequestDur ¶
RecordIngressRequestDur registers the Egress duration for a target
type MetricsI ¶
type MetricsI interface { RecordEgressRequestCnt(target string) RecordEgressRequestDur(target string, elapsed float64) RecordIngressRequestCnt(code, method, url string) RecordIngressRequestDur(code, method, url string, elapsed float64) RecordErrorCnt(target string) Use(e *echo.Echo) }
MetricsI interface