metrics

package
v0.0.0-...-10da5ee Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: MIT Imports: 12 Imported by: 0

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