common

package
v0.0.0-...-3c84b19 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const OBJECT_KEY = "OBJECTKEY"
View Source
const OUTPUT_PATH = "OUTPUTPATH"
View Source
const S3_ASSESS_KEY_ID = "ACCESSKEYID"
View Source
const S3_BUCKET_NAME = "BUCKETNAME"
View Source
const S3_HOST = "HOST"
View Source
const S3_SECRET_ACCESS_KEY = "SECRETACCESSKEY"

Variables

This section is empty.

Functions

func NewRecorder

func NewRecorder(cfg Config) metrics.Recorder

NewRecorder returns a new metrics recorder that implements the recorder using Prometheus as the backend.

Types

type Config

type Config struct {
	// Prefix is the prefix that will be set on the metrics, by default it will be empty.
	Prefix string
	// DurationBuckets are the buckets used by Prometheus for the HTTP request duration metrics,
	// by default uses Prometheus default buckets (from 5ms to 10s).
	DurationBuckets []float64
	// SizeBuckets are the buckets used by Prometheus for the HTTP response size metrics,
	// by default uses a exponential buckets from 100B to 1GB.
	SizeBuckets []float64
	// Registry is the registry that will be used by the recorder to store the metrics,
	// if the default registry is not used then it will use the default one.
	Registry prometheus.Registerer
	// HandlerIDLabel is the name that will be set to the handler ID label, by default is `handler`.
	HandlerIDLabel string
	// StatusCodeLabel is the name that will be set to the status code label, by default is `code`.
	StatusCodeLabel string
	// MethodLabel is the name that will be set to the method label, by default is `method`.
	MethodLabel string
	// ServiceLabel is the name that will be set to the service label, by default is `service`.
	ServiceLabel string
}

Config has the dependencies and values of the recorder.

type MLServeRequest

type MLServeRequest struct {
	Metadata Metadata `json:"metadata"`
	Payload  []byte   `json:"payload"`
}

func (*MLServeRequest) GetDestination

func (req *MLServeRequest) GetDestination() string

func (*MLServeRequest) ToJSON

func (req *MLServeRequest) ToJSON() string

type MLServeResponse

type MLServeResponse struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
	Payload []byte `json:"payload"`
}

type Metadata

type Metadata struct {
	Sender    string `json:"sender"`
	RequestID string `json:"requestID"`
}

Jump to

Keyboard shortcuts

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