queryactionsimpl

package
v0.0.0-...-ef3af43 Latest Latest
Warning

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

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

Documentation

Overview

Package queryactionsimpl implements the Data Observability query actions component

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomSQLSelectFields

type CustomSQLSelectFields struct {
	MetricConfigID int64  `json:"metric_config_id"`
	EntityID       string `json:"entity_id"`
}

CustomSQLSelectFields identifies the metric config and entity for custom SQL queries, since custom SQL cannot encode identity in the column name.

type DBIdentifier

type DBIdentifier struct {
	Type   string `json:"type"`
	Host   string `json:"host"`
	DBName string `json:"dbname"`
	// AgentHostname is deserialized from RC but is not currently used for filtering.
	// The RC backend is expected to route each config only to the agent whose hostname matches.
	// TODO: If RC delivery becomes broadcast (all agents receive all configs), filter here by
	// comparing AgentHostname against the current agent's hostname to prevent duplicate checks
	// in multi-agent deployments where multiple agents monitor the same postgres host.
	AgentHostname string `json:"agent_hostname"`
}

DBIdentifier identifies a database instance to target. Type describes the hosting kind (e.g. "self-hosted", "rds"). It is stored for informational purposes; instance matching is by host and dbname only.

type DOQueryPayload

type DOQueryPayload struct {
	ConfigID     string       `json:"config_id"`
	DBIdentifier DBIdentifier `json:"db_identifier"`
	Queries      []QuerySpec  `json:"queries"`
}

DOQueryPayload represents the RC config payload for a single DB instance. Each config contains the full set of active monitor queries for that instance.

type EntityMetadata

type EntityMetadata struct {
	Platform string `json:"platform,omitempty"`
	Account  string `json:"account,omitempty"`
	Database string `json:"database,omitempty"`
	Schema   string `json:"schema,omitempty"`
	Table    string `json:"table,omitempty"`
}

EntityMetadata describes the data asset a query targets (for lineage/tagging).

type Provides

type Provides struct {
	Comp doqueryactions.Component
}

Provides defines the output of the Data Observability query actions component

func NewComponent

func NewComponent(reqs Requires) (Provides, error)

NewComponent creates a new Data Observability query actions component

type QuerySpec

type QuerySpec struct {
	MonitorID             int64                  `json:"monitor_id,omitempty"`
	Type                  string                 `json:"type"`
	Query                 string                 `json:"query"`
	IntervalSeconds       int                    `json:"interval_seconds"`
	TimeoutSeconds        int                    `json:"timeout_seconds"`
	Entity                EntityMetadata         `json:"entity"`
	CustomSQLSelectFields *CustomSQLSelectFields `json:"custom_sql_select_fields,omitempty"`
}

QuerySpec defines a single monitor query to schedule.

type Requires

type Requires struct {
	Lc       compdef.Lifecycle
	Config   config.Component
	Log      log.Component
	RcClient rcclient.Component
	Ac       autodiscovery.Component
}

Requires defines the dependencies for the Data Observability query actions component

Jump to

Keyboard shortcuts

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