attrs

package
v0.0.0-...-a1933d6 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AttrDBSystem    string = string(semconv.DBSystemKey)
	AtrrDBNamespace string = string(semconv.DBNamespaceKey)

	AttrDBErrorType string = string(semconv.ErrorTypeKey)

	// histogram: (the
	MetDBClientOperationDuration string = string(semconv.DBClientOperationDurationName)

	// counter with error type attribute (AttrDBErrorType), with limited
	// types to:
	// - QUERY error
	// - CONN error
	// - TIMEOUT error
	MetDBClientConnectionTimouts string = "db.client.error"
)

Signals and attributes for database metrics

View Source
const (

	// MetDBConnError keeps track of the number of db conn. errors
	MetDBConnError     string = "db.client.sql.connerror"
	MetDBQueryDuration string = "db.client.sql.query.duration"

	// Metric definitions for Redis
	MetRedisConnError     string = "db.client.redis.connerror"
	MetRedisQueryDuration string = "db.client.redis.query.duration"

	// Metric definitions for requests
	MetReqCount    string = "http.request.count"
	MetReqDuration string = "http.request.duration"
	MetReqTimeout  string = "http.request.timeout"
)
View Source
const (

	// request metric attributes
	AttrHTTPMethod string = string(semconv.HTTPRequestMethodKey) // "method"
	AttrHTTPRoute  string = string(semconv.HTTPRouteKey)         // route

	// response metric attributes
	AttrHTTPStatus      string = string(semconv.HTTPResponseStatusCodeKey)
	AttrHTTPStatusGroup string = "http.response.status_group" // 2xx , 3xx, 4xx or 5xx , to reduce metric cardinality

	AttrHTTPRequestID string = "http.request.id" //

	// counter: with the attributes:
	// - method
	// - router
	MetHTTPServerRequestCount = "http.server.request.count"

	// histogram:
	MetHTTPServerRequestDuration = string(semconv.HTTPServerRequestDurationName)

	// histogram: http.server.request.body.size (including headers)
	MetHTTPServerRequestBodySize = string(semconv.HTTPServerRequestBodySizeName)

	// histogram: http.server.response.body.size (including headers)
	MetHTTPServerResponseBodySize = string(semconv.HTTPServerResponseBodySizeName)
)

Attributes that can appear in http requests

View Source
const (
	AttrApp string = "app"
)

Attributes shared across all signal metrics

Variables

View Source
var (
	AttrListHTTP = obsattrs.AttrDefinitionList{
		obsattrs.AttrDefinition{
			Name:        AttrHTTPMethod,
			StrAttrType: "str",
		},
		obsattrs.AttrDefinition{
			Name:        AttrHTTPRoute,
			StrAttrType: "str",
		},
		obsattrs.AttrDefinition{
			Name:        AttrHTTPStatus,
			StrAttrType: "i64",
		},
		obsattrs.AttrDefinition{
			Name:        AttrHTTPStatusGroup,
			StrAttrType: "i64",
		},
	}
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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