monitoring

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client wraps the GCP Monitoring API

func NewClient

func NewClient(ctx context.Context) (*Client, error)

NewClient creates a new monitoring client using Application Default Credentials

func NewClientForTesting

func NewClientForTesting(httpClient *http.Client, baseURL string) *Client

NewClientForTesting creates a Client with a custom base URL and HTTP client. For use in tests only.

func (*Client) HTTPClient

func (c *Client) HTTPClient() *http.Client

HTTPClient returns the underlying authenticated HTTP client. It can be reused to call other GCP APIs (e.g., Cloud SQL Admin API).

func (*Client) QueryTimeSeries

func (c *Client) QueryTimeSeries(ctx context.Context, req QueryTimeSeriesRequest) (*QueryTimeSeriesResponse, error)

QueryTimeSeries executes a PromQL query

type QueryTimeSeriesRequest

type QueryTimeSeriesRequest struct {
	Project   string
	Query     string
	StartTime time.Time
	EndTime   time.Time
}

QueryTimeSeriesRequest represents a query request

type QueryTimeSeriesResponse

type QueryTimeSeriesResponse struct {
	TimeSeries []interface{} // Raw time series from API

}

QueryTimeSeriesResponse wraps the API response

Jump to

Keyboard shortcuts

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