dash0

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChannelNameClear    = "clear"
	ChannelNameDegraded = "degraded"
	ChannelNameCritical = "critical"
)

Output channel names for ListIssues component

View Source
const (
	// MaxResponseSize limits the size of Prometheus API responses to prevent excessive memory usage
	// 1MB should be sufficient for most Prometheus queries while preventing abuse
	MaxResponseSize = 1 * 1024 * 1024 // 1MB
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckRule

type CheckRule struct {
	ID   string `json:"id"`
	Name string `json:"name,omitempty"`
}

type Client

type Client struct {
	Token   string
	BaseURL string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(http core.HTTPContext, ctx core.IntegrationContext) (*Client, error)

func (*Client) ExecutePrometheusInstantQuery

func (c *Client) ExecutePrometheusInstantQuery(promQLQuery, dataset string) (map[string]any, error)

func (*Client) ExecutePrometheusRangeQuery

func (c *Client) ExecutePrometheusRangeQuery(promQLQuery, dataset, start, end, step string) (map[string]any, error)

func (*Client) ListCheckRules

func (c *Client) ListCheckRules() ([]CheckRule, error)

type Configuration

type Configuration struct {
	APIToken string `json:"apiToken"`
	BaseURL  string `json:"baseURL"`
}

type Dash0

type Dash0 struct{}

func (*Dash0) Actions added in v0.6.0

func (d *Dash0) Actions() []core.Action

func (*Dash0) Cleanup added in v0.6.0

func (d *Dash0) Cleanup(ctx core.IntegrationCleanupContext) error

func (*Dash0) CleanupWebhook

func (d *Dash0) CleanupWebhook(ctx core.CleanupWebhookContext) error

func (*Dash0) CompareWebhookConfig

func (d *Dash0) CompareWebhookConfig(a, b any) (bool, error)

func (*Dash0) Components

func (d *Dash0) Components() []core.Component

func (*Dash0) Configuration

func (d *Dash0) Configuration() []configuration.Field

func (*Dash0) Description

func (d *Dash0) Description() string

func (*Dash0) HandleAction added in v0.6.0

func (d *Dash0) HandleAction(ctx core.IntegrationActionContext) error

func (*Dash0) HandleRequest

func (d *Dash0) HandleRequest(ctx core.HTTPRequestContext)

func (*Dash0) Icon

func (d *Dash0) Icon() string

func (*Dash0) Instructions

func (d *Dash0) Instructions() string

func (*Dash0) Label

func (d *Dash0) Label() string

func (*Dash0) ListResources

func (d *Dash0) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)

func (*Dash0) Name

func (d *Dash0) Name() string

func (*Dash0) SetupWebhook

func (d *Dash0) SetupWebhook(ctx core.SetupWebhookContext) (any, error)

func (*Dash0) Sync

func (d *Dash0) Sync(ctx core.SyncContext) error

func (*Dash0) Triggers

func (d *Dash0) Triggers() []core.Trigger

type ListIssues

type ListIssues struct{}

func (*ListIssues) Actions

func (l *ListIssues) Actions() []core.Action

func (*ListIssues) Cancel

func (l *ListIssues) Cancel(ctx core.ExecutionContext) error

func (*ListIssues) Color

func (l *ListIssues) Color() string

func (*ListIssues) Configuration

func (l *ListIssues) Configuration() []configuration.Field

func (*ListIssues) Description

func (l *ListIssues) Description() string

func (*ListIssues) Documentation

func (l *ListIssues) Documentation() string

func (*ListIssues) ExampleOutput

func (c *ListIssues) ExampleOutput() map[string]any

func (*ListIssues) Execute

func (l *ListIssues) Execute(ctx core.ExecutionContext) error

func (*ListIssues) HandleAction

func (l *ListIssues) HandleAction(ctx core.ActionContext) error

func (*ListIssues) HandleWebhook

func (l *ListIssues) HandleWebhook(ctx core.WebhookRequestContext) (int, error)

func (*ListIssues) Icon

func (l *ListIssues) Icon() string

func (*ListIssues) Label

func (l *ListIssues) Label() string

func (*ListIssues) Name

func (l *ListIssues) Name() string

func (*ListIssues) OutputChannels

func (l *ListIssues) OutputChannels(configuration any) []core.OutputChannel

func (*ListIssues) ProcessQueueItem

func (l *ListIssues) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*ListIssues) Setup

func (l *ListIssues) Setup(ctx core.SetupContext) error

type ListIssuesNodeMetadata

type ListIssuesNodeMetadata struct {
	CheckRules []CheckRule `json:"checkRules" mapstructure:"checkRules"`
}

type ListIssuesSpec

type ListIssuesSpec struct {
	CheckRules []string `json:"checkRules,omitempty"`
}

type Metadata

type Metadata struct {
}

type PrometheusQueryResult

type PrometheusQueryResult struct {
	Metric map[string]string `json:"metric"`
	Value  []interface{}     `json:"value,omitempty"`  // For instant queries: [timestamp, value]
	Values [][]interface{}   `json:"values,omitempty"` // For range queries: [[timestamp, value], ...]
}

type PrometheusResponse

type PrometheusResponse struct {
	Status string                 `json:"status"`
	Data   PrometheusResponseData `json:"data"`
}

type PrometheusResponseData

type PrometheusResponseData struct {
	ResultType string                  `json:"resultType"`
	Result     []PrometheusQueryResult `json:"result"`
}

type QueryPrometheus

type QueryPrometheus struct{}

func (*QueryPrometheus) Actions

func (q *QueryPrometheus) Actions() []core.Action

func (*QueryPrometheus) Cancel

func (q *QueryPrometheus) Cancel(ctx core.ExecutionContext) error

func (*QueryPrometheus) Color

func (q *QueryPrometheus) Color() string

func (*QueryPrometheus) Configuration

func (q *QueryPrometheus) Configuration() []configuration.Field

func (*QueryPrometheus) Description

func (q *QueryPrometheus) Description() string

func (*QueryPrometheus) Documentation

func (q *QueryPrometheus) Documentation() string

func (*QueryPrometheus) ExampleOutput

func (c *QueryPrometheus) ExampleOutput() map[string]any

func (*QueryPrometheus) Execute

func (q *QueryPrometheus) Execute(ctx core.ExecutionContext) error

func (*QueryPrometheus) HandleAction

func (q *QueryPrometheus) HandleAction(ctx core.ActionContext) error

func (*QueryPrometheus) HandleWebhook

func (q *QueryPrometheus) HandleWebhook(ctx core.WebhookRequestContext) (int, error)

func (*QueryPrometheus) Icon

func (q *QueryPrometheus) Icon() string

func (*QueryPrometheus) Label

func (q *QueryPrometheus) Label() string

func (*QueryPrometheus) Name

func (q *QueryPrometheus) Name() string

func (*QueryPrometheus) OutputChannels

func (q *QueryPrometheus) OutputChannels(configuration any) []core.OutputChannel

func (*QueryPrometheus) ProcessQueueItem

func (q *QueryPrometheus) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)

func (*QueryPrometheus) Setup

func (q *QueryPrometheus) Setup(ctx core.SetupContext) error

type QueryPrometheusSpec

type QueryPrometheusSpec struct {
	Query   string  `json:"query"`
	Dataset string  `json:"dataset"`
	Type    string  `json:"type"`            // "instant" or "range"
	Start   *string `json:"start,omitempty"` // For range queries, e.g., "now-5m"
	End     *string `json:"end,omitempty"`   // For range queries, e.g., "now"
	Step    *string `json:"step,omitempty"`  // For range queries, e.g., "15s"
}

Jump to

Keyboard shortcuts

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