monitoring

package
v1.5.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Copyright 2021 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

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

func NewMetrics(subsystem string, isUnitTest bool) *Metrics

NewMetrics generates a new set of metrics with a certain subsystem name

func (*Metrics) RecordEgressRequestCnt

func (m *Metrics) RecordEgressRequestCnt(target string)

RecordEgressRequestCnt increases the Egress counter for a target

func (*Metrics) RecordEgressRequestDur

func (m *Metrics) RecordEgressRequestDur(target string, elapsed float64)

RecordEgressRequestDur registers the Egress duration for a target

func (*Metrics) RecordErrorCnt

func (m *Metrics) RecordErrorCnt(target string)

RecordErrorCnt increases the error counter for a target

func (*Metrics) RecordIngressRequestCnt

func (m *Metrics) RecordIngressRequestCnt(code, method, url string)

RecordIngressRequestCnt increases the Ingress counter for a target

func (*Metrics) RecordIngressRequestDur

func (m *Metrics) RecordIngressRequestDur(code, method, url string, elapsed float64)

RecordIngressRequestDur registers the Egress duration for a target

func (*Metrics) Use

func (m *Metrics) Use(e *echo.Echo)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL