cloud

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package cloud provides clients for Grafana Cloud platform APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GCOMClient

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

GCOMClient is an HTTP client for the Grafana Cloud API (GCOM).

func NewGCOMClient

func NewGCOMClient(baseURL, token string) (*GCOMClient, error)

NewGCOMClient returns a new GCOMClient configured to call the given base URL using the provided Bearer token.

The client uses a 30-second timeout and will not follow HTTP redirects to a different domain than baseURL.

func (*GCOMClient) GetStack

func (c *GCOMClient) GetStack(ctx context.Context, slug string) (StackInfo, error)

GetStack calls GET /api/instances/{slug} on the GCOM API and returns the corresponding StackInfo. It returns an error if the response status is not 200.

type StackInfo

type StackInfo struct {
	ID         int    `json:"id"`
	Slug       string `json:"slug"`
	Name       string `json:"name"`
	URL        string `json:"url"`
	OrgID      int    `json:"orgId"`
	OrgSlug    string `json:"orgSlug"`
	Status     string `json:"status"`
	RegionSlug string `json:"regionSlug"`

	// Prometheus (Hosted Metrics)
	HMInstancePromID        int    `json:"hmInstancePromId"`
	HMInstancePromURL       string `json:"hmInstancePromUrl"`
	HMInstancePromClusterID int    `json:"hmInstancePromClusterId"`

	// Loki (Hosted Logs)
	HLInstanceID  int    `json:"hlInstanceId"`
	HLInstanceURL string `json:"hlInstanceUrl"`

	// Tempo (Hosted Traces)
	HTInstanceID  int    `json:"htInstanceId"`
	HTInstanceURL string `json:"htInstanceUrl"`

	// Pyroscope (Hosted Profiles)
	HPInstanceID  int    `json:"hpInstanceId"`
	HPInstanceURL string `json:"hpInstanceUrl"`

	// Fleet Management (Agent Management)
	AgentManagementInstanceID  int    `json:"agentManagementInstanceId"`
	AgentManagementInstanceURL string `json:"agentManagementInstanceUrl"`

	// Alertmanager
	AMInstanceID  int    `json:"amInstanceId"`
	AMInstanceURL string `json:"amInstanceUrl"`
}

StackInfo holds the information about a Grafana Cloud stack as returned by the GCOM API.

Jump to

Keyboard shortcuts

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