metrics

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ResourceTypeKnativeRevision is the resource type for Knative revision
	ResourceTypeKnativeRevision = "knative_revision"

	// LabelServiceName is the label for the deployed service name
	LabelServiceName = "service_name"

	// LabelRouteName is the label for immutable name of the route that receives the request
	LabelRouteName = "route_name"

	// LabelRouteTag is the label for immutable name of the route tag that receives the request
	LabelRouteTag = "route_tag"

	// LabelConfigurationName is the label for the configuration which created the monitored revision
	LabelConfigurationName = "configuration_name"

	// LabelRevisionName is the label for the monitored revision
	LabelRevisionName = "revision_name"

	// LabelNamespaceName is the label for immutable name of the namespace that the service is deployed
	LabelNamespaceName = metricskey.LabelNamespaceName

	// LabelContainerName is the container for which the metric is reported.
	LabelContainerName = metricskey.ContainerName

	// LabelPodName is the name of the pod for which the metric is reported.
	LabelPodName = metricskey.PodName

	// LabelResponseCode is the label for the HTTP response status code.
	LabelResponseCode = metricskey.LabelResponseCode

	// LabelResponseCodeClass is the label for the HTTP response status code class. For example, "2xx", "3xx", etc.
	LabelResponseCodeClass = metricskey.LabelResponseCodeClass

	// LabelResponseError is the label for client error. For HTTP, A non-2xx status code doesn't cause an error.
	LabelResponseError = metricskey.LabelResponseError

	// LabelResponseTimeout is the label timeout.
	LabelResponseTimeout = metricskey.LabelResponseTimeout

	// ValueUnknown is the default value if the field is unknown, e.g. project will be unknown if Knative
	// is not running on GKE.
	ValueUnknown = metricskey.ValueUnknown
)

Variables

View Source
var (
	PodKey               = tag.MustNewKey(LabelPodName)
	ContainerKey         = tag.MustNewKey(LabelContainerName)
	ResponseCodeKey      = tag.MustNewKey(LabelResponseCode)
	ResponseCodeClassKey = tag.MustNewKey(LabelResponseCodeClass)
	RouteTagKey          = tag.MustNewKey(LabelRouteTag)
)

Create the tag keys that will be used to add tags to our measurements. Tag keys must conform to the restrictions described in go.opencensus.io/tag/validate.go. Currently those restrictions are: - length between 1 and 255 inclusive - characters are printable US-ASCII

Functions

func AugmentWithResponse added in v0.13.0

func AugmentWithResponse(baseCtx context.Context, responseCode int) context.Context

AugmentWithResponse augments the given context with response-code specific tags.

func AugmentWithResponseAndRouteTag added in v0.30.2

func AugmentWithResponseAndRouteTag(baseCtx context.Context, responseCode int, routeTag string) context.Context

AugmentWithResponseAndRouteTag augments the given context with response-code and route-tag specific tags.

func PodRevisionContext added in v0.13.0

func PodRevisionContext(pod, container, ns, svc, cfg, rev string) (context.Context, error)

PodRevisionContext generates a new base metric reporting context containing the respective pod and revision specific tags.

func RevisionContext added in v0.13.0

func RevisionContext(ns, svc, cfg, rev string) context.Context

RevisionContext generates a new base metric reporting context containing the respective revision specific tags.

Types

This section is empty.

Jump to

Keyboard shortcuts

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