request

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientAddr added in v1.6.0

func ClientAddr(val string) attribute.KeyValue

func ClientMetric added in v1.6.0

func ClientMetric(val string) attribute.KeyValue

func ClientNamespaceMetric added in v1.6.0

func ClientNamespaceMetric(val string) attribute.KeyValue

func ConnectionTypeMetric added in v1.6.0

func ConnectionTypeMetric(val string) attribute.KeyValue

func HTTPRequestBodySize added in v1.6.0

func HTTPRequestBodySize(val int) attribute.KeyValue

func HTTPRequestMethod added in v1.6.0

func HTTPRequestMethod(val string) attribute.KeyValue

func HTTPResponseStatusCode added in v1.6.0

func HTTPResponseStatusCode(val int) attribute.KeyValue

func HTTPUrlFull added in v1.6.0

func HTTPUrlFull(val string) attribute.KeyValue

func HTTPUrlPath added in v1.6.0

func HTTPUrlPath(val string) attribute.KeyValue

func ServerAddr added in v1.6.0

func ServerAddr(val string) attribute.KeyValue

func ServerMetric added in v1.6.0

func ServerMetric(val string) attribute.KeyValue

func ServerNamespaceMetric added in v1.6.0

func ServerNamespaceMetric(val string) attribute.KeyValue

func ServerPort added in v1.6.0

func ServerPort(val int) attribute.KeyValue

func ServiceMetric added in v1.6.0

func ServiceMetric(val string) attribute.KeyValue

func SourceMetric added in v1.6.0

func SourceMetric(val string) attribute.KeyValue

func SpanHost added in v1.6.0

func SpanHost(span *Span) string

func SpanKindMetric added in v1.6.0

func SpanKindMetric(val string) attribute.KeyValue

func SpanNameMetric added in v1.6.0

func SpanNameMetric(val string) attribute.KeyValue

func SpanOTELGetters added in v1.6.0

func SpanOTELGetters(name attr.Name) (attributes.Getter[*Span, attribute.KeyValue], bool)

SpanOTELGetters returns the attributes.Getter function that returns the OTEL attribute.KeyValue of a given attribute name. nolint:cyclop

func SpanPeer added in v1.6.0

func SpanPeer(span *Span) string

func SpanPromGetters added in v1.6.0

func SpanPromGetters(attrName attr.Name) (attributes.Getter[*Span, string], bool)

SpanPromGetters returns the attributes.Getter function that returns the Prometheus string value of a given attribute name. nolint:cyclop

func StatusCodeMetric added in v1.6.0

func StatusCodeMetric(val int) attribute.KeyValue

Types

type EventType

type EventType uint8
const (
	EventTypeHTTP EventType = iota + 1
	EventTypeGRPC
	EventTypeHTTPClient
	EventTypeGRPCClient
	EventTypeSQLClient
)

The following consts need to coincide with some C identifiers: EVENT_HTTP_REQUEST, EVENT_GRPC_REQUEST, EVENT_HTTP_CLIENT, EVENT_GRPC_CLIENT, EVENT_SQL_CLIENT

type IgnoreMode added in v0.3.2

type IgnoreMode uint8
const (
	IgnoreMetrics IgnoreMode = iota + 1
	IgnoreTraces
)

type PidInfo added in v0.3.2

type PidInfo struct {
	// HostPID is the PID as seen by the host (root cgroup)
	HostPID uint32
	// UserID is the PID as seen by the user space.
	// Might differ from HostPID if the process is in a different namespace/cgroup/container/etc.
	UserPID uint32
	// Namespace for the PIDs
	Namespace uint32
}

PidInfo stores different views of the PID of the process that generated the span

type Span

type Span struct {
	Type           EventType
	IgnoreSpan     IgnoreMode
	ID             uint64
	Method         string
	Path           string
	Route          string
	Peer           string
	Host           string
	HostPort       int
	Status         int
	ContentLength  int64
	RequestStart   int64
	Start          int64
	End            int64
	ServiceID      svc.ID // TODO: rename to Service or ResourceAttrs
	TraceID        trace2.TraceID
	SpanID         trace2.SpanID
	ParentSpanID   trace2.SpanID
	Flags          uint8
	Pid            PidInfo
	PeerName       string
	HostName       string
	OtherNamespace string
	Statement      string
}

Span contains the information being submitted by the following nodes in the graph. It enables comfortable handling of data from Go. REMINDER: any attribute here must be also added to the functions SpanOTELGetters, SpanPromGetters and getDefinitions in pkg/internal/export/metric/definitions.go

func (*Span) Inside

func (s *Span) Inside(parent *Span) bool

func (*Span) IsClientSpan added in v1.5.0

func (s *Span) IsClientSpan() bool

func (*Span) IsValid added in v1.4.2

func (s *Span) IsValid() bool

func (*Span) Timings

func (s *Span) Timings() Timings

type Timings

type Timings struct {
	RequestStart time.Time
	Start        time.Time
	End          time.Time
}

Jump to

Keyboard shortcuts

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