observation

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

package observation defines all the structures used to communicate all aspects of an observation by each component of PATH.

This includes, but is not limited to observations of: 1. HTTP service requests; e.g. the length of the HTTP request's payload. 2. Protocol-level observations; e.g. an endpoint's indicating it is maxed-out (i.e. over-serviced) for an app (i.e. an onchain staked application). 3. QoS-level observations; e.g. Solana blockchain Epoch reported by an endpoint.

Recall that an endpoint is a URL of a particular onchain staked node/supplier providing service.

Index

Constants

This section is empty.

Variables

View Source
var (
	RequestType_name = map[int32]string{
		0: "REQUEST_TYPE_UNSPECIFIED",
		1: "REQUEST_TYPE_ORGANIC",
		2: "REQUEST_TYPE_SYNTHETIC",
	}
	RequestType_value = map[string]int32{
		"REQUEST_TYPE_UNSPECIFIED": 0,
		"REQUEST_TYPE_ORGANIC":     1,
		"REQUEST_TYPE_SYNTHETIC":   2,
	}
)

Enum value maps for RequestType.

View Source
var (
	GatewayRequestErrorKind_name = map[int32]string{
		0: "GATEWAY_REQUEST_ERROR_KIND_UNSPECIFIED",
		1: "GATEWAY_REQUEST_ERROR_KIND_MISSING_SERVICE_ID",
		2: "GATEWAY_REQUEST_ERROR_KIND_REJECTED_BY_QOS",
		3: "GATEWAY_REQUEST_ERROR_KIND_WEBSOCKET_REJECTED_BY_QOS",
		4: "GATEWAY_REQUEST_ERROR_KIND_WEBSOCKET_CONNECTION_FAILED",
		5: "GATEWAY_REQUEST_ERROR_KIND_UNSUPPORTED_RPC_TYPE",
		6: "GATEWAY_REQUEST_ERROR_KIND_RPC_TYPE_DETECTION_ERROR",
	}
	GatewayRequestErrorKind_value = map[string]int32{
		"GATEWAY_REQUEST_ERROR_KIND_UNSPECIFIED":                 0,
		"GATEWAY_REQUEST_ERROR_KIND_MISSING_SERVICE_ID":          1,
		"GATEWAY_REQUEST_ERROR_KIND_REJECTED_BY_QOS":             2,
		"GATEWAY_REQUEST_ERROR_KIND_WEBSOCKET_REJECTED_BY_QOS":   3,
		"GATEWAY_REQUEST_ERROR_KIND_WEBSOCKET_CONNECTION_FAILED": 4,
		"GATEWAY_REQUEST_ERROR_KIND_UNSUPPORTED_RPC_TYPE":        5,
		"GATEWAY_REQUEST_ERROR_KIND_RPC_TYPE_DETECTION_ERROR":    6,
	}
)

Enum value maps for GatewayRequestErrorKind.

View Source
var File_path_auth_proto protoreflect.FileDescriptor
View Source
var File_path_gateway_proto protoreflect.FileDescriptor
View Source
var File_path_http_proto protoreflect.FileDescriptor
View Source
var File_path_observations_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type GatewayObservations

type GatewayObservations struct {

	// request_auth stores any fields related to the identification/authentication of the request.
	RequestAuth *RequestAuth `protobuf:"bytes,1,opt,name=request_auth,json=requestAuth,proto3" json:"request_auth,omitempty"`
	// Specifies the request origin.
	// For example, wWhether the request was sent by a user or synthetically generated (e.g. by the endpoint hydrator).
	RequestType RequestType `protobuf:"varint,2,opt,name=request_type,json=requestType,proto3,enum=path.RequestType" json:"request_type,omitempty"`
	// service_id is the identifier specified via custom HTTP header.
	// As of PR #72, this can only be specified through a custom header on the HTTP request, extracted in `request/parser.go`.
	ServiceId string `protobuf:"bytes,3,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
	// received_time is when the request was initially received
	//   - For HTTP requests: when the HTTP request was received
	//   - For Websocket requests: when the Websocket connection was established
	ReceivedTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=received_time,json=receivedTime,proto3" json:"received_time,omitempty"`
	// completed_time is when request processing finished and response was returned
	//   - For HTTP requests: when the HTTP response was sent
	//   - For Websocket requests: when the Websocket connection was terminated
	CompletedTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=completed_time,json=completedTime,proto3" json:"completed_time,omitempty"`
	// response_size is the size in bytes of the response payload
	ResponseSize uint64 `protobuf:"varint,6,opt,name=response_size,json=responseSize,proto3" json:"response_size,omitempty"`
	// gateway-level request error, if any.
	// e.g. no service ID specified.
	RequestError *GatewayRequestError `protobuf:"bytes,7,opt,name=request_error,json=requestError,proto3,oneof" json:"request_error,omitempty"`
	// parallel_request_observations tracks the outcome of parallel requests within a batch.
	GatewayParallelRequestObservations *GatewayParallelRequestObservations `` /* 173-byte string literal not displayed */
	// contains filtered or unexported fields
}

GatewayObservations is the set of observations on a service request, made from the perspective of a gateway. Examples include the geographic region of the request, the request type, etc.

func (*GatewayObservations) Descriptor deprecated

func (*GatewayObservations) Descriptor() ([]byte, []int)

Deprecated: Use GatewayObservations.ProtoReflect.Descriptor instead.

func (*GatewayObservations) GetCompletedTime

func (x *GatewayObservations) GetCompletedTime() *timestamppb.Timestamp

func (*GatewayObservations) GetGatewayParallelRequestObservations

func (x *GatewayObservations) GetGatewayParallelRequestObservations() *GatewayParallelRequestObservations

func (*GatewayObservations) GetReceivedTime

func (x *GatewayObservations) GetReceivedTime() *timestamppb.Timestamp

func (*GatewayObservations) GetRequestAuth

func (x *GatewayObservations) GetRequestAuth() *RequestAuth

func (*GatewayObservations) GetRequestError

func (x *GatewayObservations) GetRequestError() *GatewayRequestError

func (*GatewayObservations) GetRequestType

func (x *GatewayObservations) GetRequestType() RequestType

func (*GatewayObservations) GetResponseSize

func (x *GatewayObservations) GetResponseSize() uint64

func (*GatewayObservations) GetServiceId

func (x *GatewayObservations) GetServiceId() string

func (*GatewayObservations) ProtoMessage

func (*GatewayObservations) ProtoMessage()

func (*GatewayObservations) ProtoReflect

func (x *GatewayObservations) ProtoReflect() protoreflect.Message

func (*GatewayObservations) Reset

func (x *GatewayObservations) Reset()

func (*GatewayObservations) String

func (x *GatewayObservations) String() string

type GatewayParallelRequestObservations

type GatewayParallelRequestObservations struct {

	// The number of requests made
	NumRequests int32 `protobuf:"varint,1,opt,name=num_requests,json=numRequests,proto3" json:"num_requests,omitempty"`
	// The number of successful requests
	NumSuccessful int32 `protobuf:"varint,2,opt,name=num_successful,json=numSuccessful,proto3" json:"num_successful,omitempty"`
	// The number of failed requests
	NumFailed int32 `protobuf:"varint,3,opt,name=num_failed,json=numFailed,proto3" json:"num_failed,omitempty"`
	// The number of canceled requests
	NumCanceled int32 `protobuf:"varint,4,opt,name=num_canceled,json=numCanceled,proto3" json:"num_canceled,omitempty"`
	// contains filtered or unexported fields
}

Tracks the outcome of parallel requests within a batch.

func (*GatewayParallelRequestObservations) Descriptor deprecated

func (*GatewayParallelRequestObservations) Descriptor() ([]byte, []int)

Deprecated: Use GatewayParallelRequestObservations.ProtoReflect.Descriptor instead.

func (*GatewayParallelRequestObservations) GetNumCanceled

func (x *GatewayParallelRequestObservations) GetNumCanceled() int32

func (*GatewayParallelRequestObservations) GetNumFailed

func (x *GatewayParallelRequestObservations) GetNumFailed() int32

func (*GatewayParallelRequestObservations) GetNumRequests

func (x *GatewayParallelRequestObservations) GetNumRequests() int32

func (*GatewayParallelRequestObservations) GetNumSuccessful

func (x *GatewayParallelRequestObservations) GetNumSuccessful() int32

func (*GatewayParallelRequestObservations) ProtoMessage

func (*GatewayParallelRequestObservations) ProtoMessage()

func (*GatewayParallelRequestObservations) ProtoReflect

func (*GatewayParallelRequestObservations) Reset

func (*GatewayParallelRequestObservations) String

type GatewayRequestError

type GatewayRequestError struct {

	// Categorizes the error
	ErrorKind GatewayRequestErrorKind `protobuf:"varint,1,opt,name=error_kind,json=errorKind,proto3,enum=path.GatewayRequestErrorKind" json:"error_kind,omitempty"`
	// Detailed reason
	Details string `protobuf:"bytes,2,opt,name=details,proto3" json:"details,omitempty"`
	// contains filtered or unexported fields
}

Tracks any errors encountered at the gateway level. e.g.: No Service ID specified by the request's HTTP headers.

func (*GatewayRequestError) Descriptor deprecated

func (*GatewayRequestError) Descriptor() ([]byte, []int)

Deprecated: Use GatewayRequestError.ProtoReflect.Descriptor instead.

func (*GatewayRequestError) GetDetails

func (x *GatewayRequestError) GetDetails() string

func (*GatewayRequestError) GetErrorKind

func (x *GatewayRequestError) GetErrorKind() GatewayRequestErrorKind

func (*GatewayRequestError) ProtoMessage

func (*GatewayRequestError) ProtoMessage()

func (*GatewayRequestError) ProtoReflect

func (x *GatewayRequestError) ProtoReflect() protoreflect.Message

func (*GatewayRequestError) Reset

func (x *GatewayRequestError) Reset()

func (*GatewayRequestError) String

func (x *GatewayRequestError) String() string

type GatewayRequestErrorKind

type GatewayRequestErrorKind int32
const (
	GatewayRequestErrorKind_GATEWAY_REQUEST_ERROR_KIND_UNSPECIFIED GatewayRequestErrorKind = 0
	// Service ID not specified.
	GatewayRequestErrorKind_GATEWAY_REQUEST_ERROR_KIND_MISSING_SERVICE_ID GatewayRequestErrorKind = 1
	// QoS rejected the request.
	// e.g. malformed payload could not be unmarshaled into JSONRPC
	GatewayRequestErrorKind_GATEWAY_REQUEST_ERROR_KIND_REJECTED_BY_QOS GatewayRequestErrorKind = 2
	// Websocket request was rejected by QoS instance.
	// e.g. Websocket subscription request validation failed.
	GatewayRequestErrorKind_GATEWAY_REQUEST_ERROR_KIND_WEBSOCKET_REJECTED_BY_QOS GatewayRequestErrorKind = 3
	// Websocket connection establishment failed.
	// e.g. Failed to upgrade HTTP connection to Websocket or connect to endpoint.
	GatewayRequestErrorKind_GATEWAY_REQUEST_ERROR_KIND_WEBSOCKET_CONNECTION_FAILED GatewayRequestErrorKind = 4
	// RPC type is not supported by the service.
	// e.g. Service configured for json_rpc but received a REST request.
	GatewayRequestErrorKind_GATEWAY_REQUEST_ERROR_KIND_UNSUPPORTED_RPC_TYPE GatewayRequestErrorKind = 5
	// RPC type detection failed.
	// e.g. Could not determine RPC type from request headers and payload.
	GatewayRequestErrorKind_GATEWAY_REQUEST_ERROR_KIND_RPC_TYPE_DETECTION_ERROR GatewayRequestErrorKind = 6
)

func (GatewayRequestErrorKind) Descriptor

func (GatewayRequestErrorKind) Enum

func (GatewayRequestErrorKind) EnumDescriptor deprecated

func (GatewayRequestErrorKind) EnumDescriptor() ([]byte, []int)

Deprecated: Use GatewayRequestErrorKind.Descriptor instead.

func (GatewayRequestErrorKind) Number

func (GatewayRequestErrorKind) String

func (x GatewayRequestErrorKind) String() string

func (GatewayRequestErrorKind) Type

type HTTPRequestObservations

type HTTPRequestObservations struct {

	// host stores the Host part of the HTTP request's URL.
	Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"`
	// contains filtered or unexported fields
}

HTTPRequestObservations captures all the observations regarding an HTTP service request.

func (*HTTPRequestObservations) Descriptor deprecated

func (*HTTPRequestObservations) Descriptor() ([]byte, []int)

Deprecated: Use HTTPRequestObservations.ProtoReflect.Descriptor instead.

func (*HTTPRequestObservations) GetHost

func (x *HTTPRequestObservations) GetHost() string

func (*HTTPRequestObservations) ProtoMessage

func (*HTTPRequestObservations) ProtoMessage()

func (*HTTPRequestObservations) ProtoReflect

func (x *HTTPRequestObservations) ProtoReflect() protoreflect.Message

func (*HTTPRequestObservations) Reset

func (x *HTTPRequestObservations) Reset()

func (*HTTPRequestObservations) String

func (x *HTTPRequestObservations) String() string

type PortalCredentials

type PortalCredentials struct {

	// The ID of the Grove portal account behind the service request
	PortalAccountId string `protobuf:"bytes,3,opt,name=portal_account_id,json=portalAccountId,proto3" json:"portal_account_id,omitempty"`
	// The ID of the Grove portal application authenticating the service request.
	PortalApplicationId string `protobuf:"bytes,4,opt,name=portal_application_id,json=portalApplicationId,proto3" json:"portal_application_id,omitempty"`
	// contains filtered or unexported fields
}

PortalCredentials captures fields related to the Grove portal's request authentication.

func (*PortalCredentials) Descriptor deprecated

func (*PortalCredentials) Descriptor() ([]byte, []int)

Deprecated: Use PortalCredentials.ProtoReflect.Descriptor instead.

func (*PortalCredentials) GetPortalAccountId

func (x *PortalCredentials) GetPortalAccountId() string

func (*PortalCredentials) GetPortalApplicationId

func (x *PortalCredentials) GetPortalApplicationId() string

func (*PortalCredentials) ProtoMessage

func (*PortalCredentials) ProtoMessage()

func (*PortalCredentials) ProtoReflect

func (x *PortalCredentials) ProtoReflect() protoreflect.Message

func (*PortalCredentials) Reset

func (x *PortalCredentials) Reset()

func (*PortalCredentials) String

func (x *PortalCredentials) String() string

type RequestAuth

type RequestAuth struct {

	// Unique identifier for tracing the service request.
	// Used by the data pipeline.
	TraceId string `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"`
	// The geographic region where the gateway serving the request was located.
	// DEV_NOTE: It aligns with typical cloud regions (e.g. us-east) but kept as a string for simplicity.
	// TODO_FUTURE: this may need to move into a separate message if more details regarding the PATH instance are required.
	Region string `protobuf:"bytes,2,opt,name=region,proto3" json:"region,omitempty"`
	// Tracks Grove portal credentials.
	PortalCredentials *PortalCredentials `protobuf:"bytes,3,opt,name=portal_credentials,json=portalCredentials,proto3,oneof" json:"portal_credentials,omitempty"`
	// contains filtered or unexported fields
}

RequestAuth captures all fields related to the authentication of the request. These are all external to PATH, i.e. reported to PATH by the authentication layer. Used in generating observations for the data pipeline.

func (*RequestAuth) Descriptor deprecated

func (*RequestAuth) Descriptor() ([]byte, []int)

Deprecated: Use RequestAuth.ProtoReflect.Descriptor instead.

func (*RequestAuth) GetPortalCredentials

func (x *RequestAuth) GetPortalCredentials() *PortalCredentials

func (*RequestAuth) GetRegion

func (x *RequestAuth) GetRegion() string

func (*RequestAuth) GetTraceId

func (x *RequestAuth) GetTraceId() string

func (*RequestAuth) ProtoMessage

func (*RequestAuth) ProtoMessage()

func (*RequestAuth) ProtoReflect

func (x *RequestAuth) ProtoReflect() protoreflect.Message

func (*RequestAuth) Reset

func (x *RequestAuth) Reset()

func (*RequestAuth) String

func (x *RequestAuth) String() string

type RequestResponseObservations

type RequestResponseObservations struct {

	// Identifies the target service for the request
	ServiceId string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"`
	// Contains metrics about the incoming HTTP request (e.g., payload size)
	HttpRequest *HTTPRequestObservations `protobuf:"bytes,2,opt,name=http_request,json=httpRequest,proto3" json:"http_request,omitempty"`
	// Records gateway-level processing details (e.g., request origin - user vs hydrator)
	Gateway *GatewayObservations `protobuf:"bytes,3,opt,name=gateway,proto3" json:"gateway,omitempty"`
	// Contains protocol-level metrics (e.g., serving block height)
	Protocol *protocol.Observations `protobuf:"bytes,4,opt,name=protocol,proto3" json:"protocol,omitempty"`
	// Tracks QoS-related metrics (e.g., endpoint responses to chain queries)
	Qos *qos.Observations `protobuf:"bytes,5,opt,name=qos,proto3" json:"qos,omitempty"`
	// contains filtered or unexported fields
}

RequestResponseObservations aggregates all observations made during service request processing. Contains observations for: - QoS metrics - Protocol instances - Gateway processing - HTTP request details

func (*RequestResponseObservations) Descriptor deprecated

func (*RequestResponseObservations) Descriptor() ([]byte, []int)

Deprecated: Use RequestResponseObservations.ProtoReflect.Descriptor instead.

func (*RequestResponseObservations) GetGateway

func (*RequestResponseObservations) GetHttpRequest

func (*RequestResponseObservations) GetProtocol

func (*RequestResponseObservations) GetQos

func (*RequestResponseObservations) GetServiceId

func (x *RequestResponseObservations) GetServiceId() string

func (*RequestResponseObservations) ProtoMessage

func (*RequestResponseObservations) ProtoMessage()

func (*RequestResponseObservations) ProtoReflect

func (*RequestResponseObservations) Reset

func (x *RequestResponseObservations) Reset()

func (*RequestResponseObservations) String

func (x *RequestResponseObservations) String() string

type RequestType

type RequestType int32

RequestType captures the origin of the request. As of PR #72, it is one of:

  1. Organic: a real user sent a service request to a PATH instance
  2. Synthetic: internal infrastructure generated the service request for simulation and data purposes.
const (
	RequestType_REQUEST_TYPE_UNSPECIFIED RequestType = 0
	// Organic: Service request sent by a user.
	RequestType_REQUEST_TYPE_ORGANIC RequestType = 1
	// Synthetic: Service request sent by the endpoint hydrator: see gateway/hydrator.go.
	RequestType_REQUEST_TYPE_SYNTHETIC RequestType = 2
)

func (RequestType) Descriptor

func (RequestType) Enum

func (x RequestType) Enum() *RequestType

func (RequestType) EnumDescriptor deprecated

func (RequestType) EnumDescriptor() ([]byte, []int)

Deprecated: Use RequestType.Descriptor instead.

func (RequestType) Number

func (x RequestType) Number() protoreflect.EnumNumber

func (RequestType) String

func (x RequestType) String() string

func (RequestType) Type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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