metrics

package
v0.0.0-...-447887d Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	EndpointType  = "metrics"
	CLIENT_ID_KEY = "METRICS_CLIENT"
)

Variables

This section is empty.

Functions

func Init

func Init(portalProxy api.PortalProxy) (api.StratosPlugin, error)

Init creates a new MetricsSpecification

Types

type EndpointMetricsRelation

type EndpointMetricsRelation struct {
	// contains filtered or unexported fields
}

type MetricsAuth

type MetricsAuth struct {
	Type     string
	Username string
	Password string
}

type MetricsMetadata

type MetricsMetadata struct {
	Type         string
	URL          string
	Job          string
	EndpointGUID string
	Environment  string
}

type MetricsProviderMetadata

type MetricsProviderMetadata struct {
	Type        string `json:"type"`
	URL         string `json:"url"`
	Job         string `json:"job,omitempty"`
	Environment string `json:"environment,omitempty"`
}

type MetricsSpecification

type MetricsSpecification struct {
	// contains filtered or unexported fields
}

MetricsSpecification is a plugin to support the metrics endpoint type

func (*MetricsSpecification) AddAdminGroupRoutes

func (m *MetricsSpecification) AddAdminGroupRoutes(echoContext *echo.Group)

AddAdminGroupRoutes adds the admin routes for this plugin to the Echo server

func (*MetricsSpecification) AddSessionGroupRoutes

func (m *MetricsSpecification) AddSessionGroupRoutes(echoContext *echo.Group)

AddSessionGroupRoutes adds the session routes for this plugin to the Echo server

func (*MetricsSpecification) Connect

func (m *MetricsSpecification) Connect(ec *echo.Context, cnsiRecord api.CNSIRecord, userId string) (*api.TokenRecord, bool, error)

func (*MetricsSpecification) GetClientId

func (m *MetricsSpecification) GetClientId() string

func (*MetricsSpecification) GetEndpointPlugin

func (m *MetricsSpecification) GetEndpointPlugin() (api.EndpointPlugin, error)

GetEndpointPlugin gets the endpoint plugin for this plugin

func (*MetricsSpecification) GetMiddlewarePlugin

func (m *MetricsSpecification) GetMiddlewarePlugin() (api.MiddlewarePlugin, error)

GetMiddlewarePlugin gets the middleware plugin for this plugin

func (*MetricsSpecification) GetRoutePlugin

func (m *MetricsSpecification) GetRoutePlugin() (api.RoutePlugin, error)

GetRoutePlugin gets the route plugin for this plugin

func (*MetricsSpecification) GetType

func (m *MetricsSpecification) GetType() string

func (*MetricsSpecification) Info

func (m *MetricsSpecification) Info(apiEndpoint string, skipSSLValidation bool, caCert string) (api.CNSIRecord, interface{}, error)

func (*MetricsSpecification) Init

func (m *MetricsSpecification) Init() error

Init performs plugin initialization

func (*MetricsSpecification) Register

func (m *MetricsSpecification) Register(echoContext *echo.Context) error

func (*MetricsSpecification) UpdateMetadata

func (m *MetricsSpecification) UpdateMetadata(info *api.Info, userGUID string, echoContext *echo.Context)

func (*MetricsSpecification) Validate

func (m *MetricsSpecification) Validate(userGUID string, cnsiRecord api.CNSIRecord, tokenRecord api.TokenRecord) error

type PrometheusQueryResponse

type PrometheusQueryResponse struct {
	Status string `json:"status"`
	Data   struct {
		ResultType string `json:"resultType"`
		Result     []struct {
			Metric struct {
				Name           string `json:"__name__,omitempty"`
				ApplicationID  string `json:"application_id,omitempty"`
				BoshDeployment string `json:"bosh_deployment,omitempty"`
				BoshJobID      string `json:"bosh_job_id,omitempty"`
				BoshJobName    string `json:"bosh_job_name,omitempty"`
				Environment    string `json:"environment,omitempty"`
				Instance       string `json:"instance,omitempty"`
				InstanceIndex  string `json:"instance_index,omitempty"`
				Job            string `json:"job,omitempty"`
				Origin         string `json:"origin,omitempty"`
			} `json:"metric"`
			Value []interface{} `json:"value"`
		} `json:"result"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

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