request

package
v2.0.4-alloy-test Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessagingPublish = "publish"
	MessagingProcess = "process"
)
View Source
const (
	SchemeHostSeparator = ";"
)

Variables

This section is empty.

Functions

func ClientAddr

func ClientAddr(val string) attribute.KeyValue

func ClientMetric

func ClientMetric(val string) attribute.KeyValue

func ClientNamespaceMetric

func ClientNamespaceMetric(val string) attribute.KeyValue

func ConnectionTypeMetric

func ConnectionTypeMetric(val string) attribute.KeyValue

func CudaKernel

func CudaKernel(val string) attribute.KeyValue

func DBCollectionName

func DBCollectionName(val string) attribute.KeyValue

func DBOperationName

func DBOperationName(val string) attribute.KeyValue

func DBQueryText

func DBQueryText(val string) attribute.KeyValue

func DBSystemName

func DBSystemName(val string) attribute.KeyValue

func ErrorType

func ErrorType(val string) attribute.KeyValue

func HTTPClientHost

func HTTPClientHost(span *Span) string

func HTTPRequestBodySize

func HTTPRequestBodySize(val int) attribute.KeyValue

func HTTPRequestMethod

func HTTPRequestMethod(val string) attribute.KeyValue

func HTTPResponseStatusCode

func HTTPResponseStatusCode(val int) attribute.KeyValue

func HTTPScheme

func HTTPScheme(span *Span) string

func HTTPUrlFull

func HTTPUrlFull(val string) attribute.KeyValue

func HTTPUrlPath

func HTTPUrlPath(val string) attribute.KeyValue

func HostAsServer

func HostAsServer(span *Span) string

func MessagingOperationType

func MessagingOperationType(val string) attribute.KeyValue

func PeerAsClient

func PeerAsClient(span *Span) string

func ServerAddr

func ServerAddr(val string) attribute.KeyValue

func ServerMetric

func ServerMetric(val string) attribute.KeyValue

func ServerNamespaceMetric

func ServerNamespaceMetric(val string) attribute.KeyValue

func ServerPort

func ServerPort(val int) attribute.KeyValue

func ServiceMetric

func ServiceMetric(val string) attribute.KeyValue

func SourceMetric

func SourceMetric(val string) attribute.KeyValue

func SpanHost

func SpanHost(span *Span) string

func SpanKindMetric

func SpanKindMetric(val string) attribute.KeyValue

func SpanNameMetric

func SpanNameMetric(val string) attribute.KeyValue

func SpanOTELGetters

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

func SpanPeer(span *Span) string

func SpanPromGetters

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 SpanStatusCode

func SpanStatusCode(span *Span) codes.Code

func StatusCodeMetric

func StatusCodeMetric(val int) attribute.KeyValue

func URLFull

func URLFull(scheme, host, path string) string

Types

type EventType

type EventType uint8
const (
	// EventTypeProcessAlive is an internal signal. It will be ignored by the metrics exporters.
	EventTypeProcessAlive EventType = iota
	EventTypeHTTP
	EventTypeGRPC
	EventTypeHTTPClient
	EventTypeGRPCClient
	EventTypeSQLClient
	EventTypeRedisClient
	EventTypeKafkaClient
	EventTypeRedisServer
	EventTypeKafkaServer
	EventTypeGPUKernelLaunch
	EventTypeGPUMalloc
)

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

func (EventType) MarshalText

func (t EventType) MarshalText() ([]byte, error)

func (EventType) String

func (t EventType) String() string

type PidInfo

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 SQLKind

type SQLKind uint8
const (
	DBGeneric SQLKind = iota + 1
	DBPostgres
	DBMySQL
)

type Span

type Span struct {
	Type           EventType      `json:"type"`
	IgnoreSpan     ignoreMode     `json:"ignoreSpan"`
	Method         string         `json:"-"`
	Path           string         `json:"-"`
	Route          string         `json:"-"`
	Peer           string         `json:"peer"`
	PeerPort       int            `json:"peerPort,string"`
	Host           string         `json:"host"`
	HostPort       int            `json:"hostPort,string"`
	Status         int            `json:"-"`
	ContentLength  int64          `json:"-"`
	RequestStart   int64          `json:"-"`
	Start          int64          `json:"-"`
	End            int64          `json:"-"`
	Service        svc.Attrs      `json:"-"`
	TraceID        trace2.TraceID `json:"traceID"`
	SpanID         trace2.SpanID  `json:"spanID"`
	ParentSpanID   trace2.SpanID  `json:"parentSpanID"`
	Flags          uint8          `json:"flags,string"`
	Pid            PidInfo        `json:"-"`
	PeerName       string         `json:"peerName"`
	HostName       string         `json:"hostName"`
	OtherNamespace string         `json:"-"`
	Statement      string         `json:"-"`
	SubType        int            `json:"-"`
}

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/export/attributes/attr_defs.go

func (*Span) DBSystemName

func (s *Span) DBSystemName() attribute.KeyValue

func (*Span) HasOriginalHost

func (s *Span) HasOriginalHost() bool

func (*Span) IgnoreMetrics

func (s *Span) IgnoreMetrics() bool

func (*Span) IgnoreTraces

func (s *Span) IgnoreTraces() bool

func (*Span) Inside

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

func (*Span) InternalSignal

func (s *Span) InternalSignal() bool

InternalSignal returns whether a span is not aimed to be exported as a metric or a trace, because it's used to internally send messages through the pipeline.

func (*Span) IsClientSpan

func (s *Span) IsClientSpan() bool

func (*Span) IsExportMetricsSpan

func (s *Span) IsExportMetricsSpan() bool

func (*Span) IsExportTracesSpan

func (s *Span) IsExportTracesSpan() bool

func (*Span) IsSelfReferenceSpan

func (s *Span) IsSelfReferenceSpan() bool

func (*Span) IsValid

func (s *Span) IsValid() bool

func (Span) MarshalJSON

func (s Span) MarshalJSON() ([]byte, error)

func (*Span) RequestLength

func (s *Span) RequestLength() int64

func (*Span) ServiceGraphKind

func (s *Span) ServiceGraphKind() string

ServiceGraphKind returns the Kind string representation that is compliant with service graph metrics specification

func (*Span) SetIgnoreMetrics

func (s *Span) SetIgnoreMetrics()

func (*Span) SetIgnoreTraces

func (s *Span) SetIgnoreTraces()

func (*Span) Timings

func (s *Span) Timings() Timings

func (*Span) TraceName

func (s *Span) TraceName() string

type SpanAttributes

type SpanAttributes map[string]string

helper attribute functions used by JSON serialization

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