Documentation
¶
Index ¶
- Variables
- type ProbeConf
- func (*ProbeConf) Descriptor() ([]byte, []int)deprecated
- func (x *ProbeConf) GetConnectionString() string
- func (x *ProbeConf) GetDatabase() string
- func (x *ProbeConf) GetFlavor() ProbeConf_Flavor
- func (x *ProbeConf) GetPassword() string
- func (x *ProbeConf) GetQuery() string
- func (x *ProbeConf) GetQueryFile() string
- func (x *ProbeConf) GetResponseMetricsOptions() *proto1.OutputMetricsOptions
- func (x *ProbeConf) GetTlsConfig() *proto.TLSConfig
- func (x *ProbeConf) GetUser() string
- func (*ProbeConf) ProtoMessage()
- func (x *ProbeConf) ProtoReflect() protoreflect.Message
- func (x *ProbeConf) Reset()
- func (x *ProbeConf) String() string
- type ProbeConf_Flavor
- func (ProbeConf_Flavor) Descriptor() protoreflect.EnumDescriptor
- func (x ProbeConf_Flavor) Enum() *ProbeConf_Flavor
- func (ProbeConf_Flavor) EnumDescriptor() ([]byte, []int)deprecated
- func (x ProbeConf_Flavor) Number() protoreflect.EnumNumber
- func (x ProbeConf_Flavor) String() string
- func (ProbeConf_Flavor) Type() protoreflect.EnumType
- func (x *ProbeConf_Flavor) UnmarshalJSON(b []byte) errordeprecated
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ProbeConf_Flavor_name = map[int32]string{ 0: "FLAVOR_UNSPECIFIED", 1: "POSTGRES", } ProbeConf_Flavor_value = map[string]int32{ "FLAVOR_UNSPECIFIED": 0, "POSTGRES": 1, } )
Enum value maps for ProbeConf_Flavor.
View Source
var File_github_com_cloudprober_cloudprober_probes_sql_proto_config_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type ProbeConf ¶
type ProbeConf struct {
// Database flavor. Required. Currently only POSTGRES is supported; more
// flavors may be added based on demand.
Flavor *ProbeConf_Flavor `protobuf:"varint,1,opt,name=flavor,enum=cloudprober.probes.sql.ProbeConf_Flavor" json:"flavor,omitempty"`
// connection_string configures the database connection -- credentials,
// database name, sslmode, and other libpq parameters -- in key/value form
// e.g. "user=u dbname=db sslmode=require" or as a URI string
// e.g. "postgresql://user:password@host:port/database?sslmode=require".
//
// Note that connection string URI is incompatible with probe-targets
// configuration and results in an error. To use probe targets, define
// connection string in key-value form so that cloudprober can use the
// configured targets. Conversely, to connect using the connection_string's
// own host -- e.g. a full URI from a cloud provider -- omit the probe's
// targets entirely.
//
// In key-value form, @target.name@, @target.port@, @target.label.<name>@,
// etc. are substituted into connection_string. The user, password, and
// database fields below, if set, override the connection_string values.
// To keep secrets out of the config file, use the envSecret template
// function, e.g. password: "{{envSecret "DB_PASSWORD"}}".
ConnectionString *string `protobuf:"bytes,2,opt,name=connection_string,json=connectionString" json:"connection_string,omitempty"`
User *string `protobuf:"bytes,3,opt,name=user" json:"user,omitempty"`
Password *string `protobuf:"bytes,4,opt,name=password" json:"password,omitempty"`
Database *string `protobuf:"bytes,5,opt,name=database" json:"database,omitempty"`
// Query to run. If no query is configured, the probe only verifies that the
// database accepts connections and responds to a ping. Exactly one of query
// and query_file may be set.
//
// Query results are serialized as one line per row, with column values
// joined by a single space, e.g. the query
// "SELECT 'db_users', count(*) FROM users" may produce "db_users 42". This
// output is passed to the probe's validators, and to the payload metrics
// parser if response_metrics_options is set.
//
// Keep query results small and line-friendly:
// - Results are buffered in memory each run and capped at 1MB; exceeding
// the cap fails the probe. Use a LIMIT for potentially large results.
// - Column values containing spaces (free text, timestamps) span multiple
// space-separated tokens, and SQL NULL is rendered as "<nil>"; cast or
// format values in SQL if validators or payload parsing need clean
// tokens.
Query *string `protobuf:"bytes,6,opt,name=query" json:"query,omitempty"`
QueryFile *string `protobuf:"bytes,7,opt,name=query_file,json=queryFile" json:"query_file,omitempty"`
// TLS config for the database connection, e.g. for custom CA bundles or
// client certificates (mTLS). Same message other probes (http, tcp, grpc)
// use; see common/tlsconfig/proto/config.proto for the full field list.
// If set, it overrides any TLS parameters from connection_string
// (e.g. sslmode) or environment. If server_name is not set, it defaults to
// the host being connected to (the target's name, or connection_string's
// host with dummy_targets).
TlsConfig *proto.TLSConfig `protobuf:"bytes,8,opt,name=tls_config,json=tlsConfig" json:"tls_config,omitempty"`
// Export query results as metrics. Same shape external + http probes
// already use; with the row serialization described above, a query like
// "SELECT 'queue_depth', count(*) FROM jobs" exports queue_depth as a
// metric with no extra configuration.
ResponseMetricsOptions *proto1.OutputMetricsOptions `protobuf:"bytes,9,opt,name=response_metrics_options,json=responseMetricsOptions" json:"response_metrics_options,omitempty"`
// contains filtered or unexported fields
}
ProbeConf configures a SQL probe.
Each probe run establishes a new database connection, authenticates, and runs the configured query (or just pings the server if no query is set), so probe latency covers the full path: connect + auth + query. Clean completion is success; any error is failure.
func (*ProbeConf) Descriptor
deprecated
func (*ProbeConf) GetConnectionString ¶
func (*ProbeConf) GetDatabase ¶
func (*ProbeConf) GetFlavor ¶
func (x *ProbeConf) GetFlavor() ProbeConf_Flavor
func (*ProbeConf) GetPassword ¶
func (*ProbeConf) GetQueryFile ¶
func (*ProbeConf) GetResponseMetricsOptions ¶
func (x *ProbeConf) GetResponseMetricsOptions() *proto1.OutputMetricsOptions
func (*ProbeConf) GetTlsConfig ¶
func (*ProbeConf) ProtoMessage ¶
func (*ProbeConf) ProtoMessage()
func (*ProbeConf) ProtoReflect ¶
func (x *ProbeConf) ProtoReflect() protoreflect.Message
type ProbeConf_Flavor ¶
type ProbeConf_Flavor int32
const ( ProbeConf_FLAVOR_UNSPECIFIED ProbeConf_Flavor = 0 ProbeConf_POSTGRES ProbeConf_Flavor = 1 )
func (ProbeConf_Flavor) Descriptor ¶
func (ProbeConf_Flavor) Descriptor() protoreflect.EnumDescriptor
func (ProbeConf_Flavor) Enum ¶
func (x ProbeConf_Flavor) Enum() *ProbeConf_Flavor
func (ProbeConf_Flavor) EnumDescriptor
deprecated
func (ProbeConf_Flavor) EnumDescriptor() ([]byte, []int)
Deprecated: Use ProbeConf_Flavor.Descriptor instead.
func (ProbeConf_Flavor) Number ¶
func (x ProbeConf_Flavor) Number() protoreflect.EnumNumber
func (ProbeConf_Flavor) String ¶
func (x ProbeConf_Flavor) String() string
func (ProbeConf_Flavor) Type ¶
func (ProbeConf_Flavor) Type() protoreflect.EnumType
func (*ProbeConf_Flavor) UnmarshalJSON
deprecated
func (x *ProbeConf_Flavor) UnmarshalJSON(b []byte) error
Deprecated: Do not use.
Click to show internal directories.
Click to hide internal directories.