dynatrace

package
v0.47.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VaultAddr string = "vault_address"

	// Logs
	DTStorageVaultPath string = "dt_vault_path"
	DTStorageScopes    string = "storage:logs:read storage:events:read storage:buckets:read"

	// Dashboards
	DTDocumentVaultPath string = "dt_document_vault_path"
	DTDocumentScopes    string = "document:documents:read"
	DTDashboardType     string = "dashboard"
)

Variables

View Source
var ErrUnsupportedCluster = fmt.Errorf("Not an HCP or MC Cluster")

Functions

func GetDynatraceURLFromManagementCluster

func GetDynatraceURLFromManagementCluster(clusterID string) (string, error)

func GetLinkToWebConsole

func GetLinkToWebConsole(dtURL string, from string, to string, finalQuery string) (string, error)

func NewCmdDynatrace

func NewCmdDynatrace() *cobra.Command

func NewCmdHCPMustGather

func NewCmdHCPMustGather() *cobra.Command

func NewCmdLogs

func NewCmdLogs() *cobra.Command

Types

type DTDocument added in v0.43.0

type DTDocument struct {
	Id   string `json:"id"`
	Name string `json:"name"`
	Type string `json:"type"`
}

type DTDocumentResult added in v0.43.0

type DTDocumentResult struct {
	Documents []DTDocument `json:"documents"`
}

type DTEventResult

type DTEventResult struct {
	Records []json.RawMessage `json:"records"`
}

type DTEventsPollResult

type DTEventsPollResult struct {
	State    string        `json:"state"`
	Progress int           `json:"progress"`
	Result   DTEventResult `json:"result"`
}

type DTExecuteResults

type DTExecuteResults struct {
	Result []json.RawMessage `json:"records"`
}

type DTExecuteState

type DTExecuteState struct {
	State      string `json:"state"`
	TTLSeconds int    `json:"ttlSeconds"`
}

type DTExecuteToken

type DTExecuteToken struct {
	RequestToken string `json:"requestToken"`
}

type DTLogsPollResult

type DTLogsPollResult struct {
	State    string    `json:"state"`
	Progress int       `json:"progress"`
	Result   LogResult `json:"result"`
}

type DTPollResult

type DTPollResult struct {
	State string `json:"state"`
}

type DTQuery

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

func GetQuery

func GetQuery(hcpCluster HCPCluster, fromVar time.Time, toVar time.Time, since int) (query DTQuery, error error)

func (*DTQuery) Build

func (q *DTQuery) Build() string

func (*DTQuery) Cluster

func (q *DTQuery) Cluster(mgmtClusterName string) *DTQuery

func (*DTQuery) Containers

func (q *DTQuery) Containers(containerList []string) *DTQuery

func (*DTQuery) ContainsPhrase

func (q *DTQuery) ContainsPhrase(phrase string) *DTQuery

func (*DTQuery) Deployments

func (q *DTQuery) Deployments(workloads []string) *DTQuery

func (*DTQuery) InitEvents

func (q *DTQuery) InitEvents(hours int) *DTQuery

func (*DTQuery) InitLogs

func (q *DTQuery) InitLogs(hours int) *DTQuery

func (*DTQuery) InitLogsWithTimeRange added in v0.46.0

func (q *DTQuery) InitLogsWithTimeRange(from time.Time, to time.Time) *DTQuery

func (*DTQuery) Limit

func (q *DTQuery) Limit(limit int) *DTQuery

func (*DTQuery) Namespaces

func (q *DTQuery) Namespaces(namespaceList []string) *DTQuery

func (*DTQuery) Nodes

func (q *DTQuery) Nodes(nodeList []string) *DTQuery

func (*DTQuery) Pods

func (q *DTQuery) Pods(podList []string) *DTQuery

func (*DTQuery) Sort

func (q *DTQuery) Sort(order string) (query *DTQuery, error error)

func (*DTQuery) Status

func (q *DTQuery) Status(statusList []string) *DTQuery

type DTQueryPayload

type DTQueryPayload struct {
	Query            string `json:"query"`
	MaxResultRecords int    `json:"maxResultRecords"`
}

type DTRequestError

type DTRequestError struct {
	Records json.RawMessage `json:"error"`
}

type GatherLogsOpts

type GatherLogsOpts struct {
	Since     int
	Tail      int
	SortOrder string
	DestDir   string
	ClusterID string
}

func (*GatherLogsOpts) GatherLogs

func (g *GatherLogsOpts) GatherLogs(clusterID string, elevationReasons ...string) (error error)

type HCPCluster

type HCPCluster struct {
	DynatraceURL string
	// contains filtered or unexported fields
}

func FetchClusterDetails

func FetchClusterDetails(clusterKey string) (hcpCluster HCPCluster, error error)

type LogContent

type LogContent struct {
	Content string `json:"content"`
}

type LogResult

type LogResult struct {
	Records []LogContent `json:"records"`
}

type Requester

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

Jump to

Keyboard shortcuts

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