Documentation
¶
Index ¶
- Constants
- func NormalizeURL(raw string) (string, error)
- func ParseCustomHeaders(raw string) (http.Header, error)
- type AggregateRequest
- type Client
- func (c *Client) Aggregate(ctx context.Context, r AggregateRequest) (QueryResult, error)
- func (c *Client) CollectPages(ctx context.Context, r SearchRequest, b PageBudget) (SearchResult, error)
- func (c *Client) FieldKeys(ctx context.Context, r FieldKeysRequest) (FieldKeysResult, error)
- func (c *Client) FieldValues(ctx context.Context, r FieldValuesRequest) (FieldValuesResult, error)
- func (c *Client) Me(ctx context.Context) (Identity, error)
- func (c *Client) MetricsList(ctx context.Context, r MetricsListRequest) (MetricsListResult, error)
- func (c *Client) MetricsQuery(ctx context.Context, r MetricsQueryRequest) (QueryResult, error)
- func (c *Client) Preview(ctx context.Context, q NativeQuery, verbose bool) (PreviewResult, error)
- func (c *Client) Query(ctx context.Context, q NativeQuery) (QueryResult, error)
- func (c *Client) Search(ctx context.Context, r SearchRequest) (SearchPage, error)
- func (c *Client) Trace(ctx context.Context, r TraceRequest) (TraceResult, error)
- type Error
- type FieldKey
- type FieldKeysRequest
- type FieldKeysResult
- type FieldValues
- type FieldValuesRequest
- type FieldValuesResult
- type Identity
- type MetricsListRequest
- type MetricsListResult
- type MetricsQueryRequest
- type NativeQuery
- type PageBudget
- type PreviewResult
- type PreviewVerdict
- type QueryResult
- type SearchPage
- type SearchRequest
- type SearchResult
- type Signal
- type TraceRequest
- type TraceResult
- type Window
Constants ¶
const ( Logs Signal = "logs" Traces Signal = "traces" Metrics Signal = "metrics" MaxQueryBytes = 1 << 20 MaxSearchRows = 10000 MaxSearchOffset = 1000000 )
const MaxAggregateTextBytes = 1 << 20
MaxAggregateTextBytes bounds the combined aggregation and filter input text in UTF-8 bytes, before JSON escaping. It is not an encoded request-body limit.
Variables ¶
This section is empty.
Functions ¶
func NormalizeURL ¶
func ParseCustomHeaders ¶
ParseCustomHeaders implements the MCP's comma-separated Name:Value format. The returned map is owned by the caller. Errors never include input text: even an invalid name or a missing delimiter can contain a credential.
Types ¶
type AggregateRequest ¶
type AggregateRequest struct {
Window
Signal Signal
Aggregation, Where string
GroupBy []string
Limit int
Order string
Step time.Duration // Zero means scalar; positive means time_series.
NoCache bool
}
func (AggregateRequest) Validate ¶
func (r AggregateRequest) Validate() error
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewWithHeaders ¶
func NewWithHeaders(rawURL, key string, timeout time.Duration, customHeaders string) (*Client, error)
NewWithHeaders snapshots MCP-format custom headers for this client's endpoint. Use New when no additional headers are needed. Neither constructor reads the environment, and clients never follow redirects, including same-origin ones.
func (*Client) Aggregate ¶
func (c *Client) Aggregate(ctx context.Context, r AggregateRequest) (QueryResult, error)
func (*Client) CollectPages ¶
func (c *Client) CollectPages(ctx context.Context, r SearchRequest, b PageBudget) (SearchResult, error)
CollectPages keeps the resolved window immutable and returns no partial success on error. Callers supply a context deadline for the whole collection.
func (*Client) FieldKeys ¶
func (c *Client) FieldKeys(ctx context.Context, r FieldKeysRequest) (FieldKeysResult, error)
func (*Client) FieldValues ¶
func (c *Client) FieldValues(ctx context.Context, r FieldValuesRequest) (FieldValuesResult, error)
func (*Client) MetricsList ¶
func (c *Client) MetricsList(ctx context.Context, r MetricsListRequest) (MetricsListResult, error)
func (*Client) MetricsQuery ¶
func (c *Client) MetricsQuery(ctx context.Context, r MetricsQueryRequest) (QueryResult, error)
func (*Client) Preview ¶
func (c *Client) Preview(ctx context.Context, q NativeQuery, verbose bool) (PreviewResult, error)
func (*Client) Query ¶
func (c *Client) Query(ctx context.Context, q NativeQuery) (QueryResult, error)
func (*Client) Search ¶
func (c *Client) Search(ctx context.Context, r SearchRequest) (SearchPage, error)
func (*Client) Trace ¶
func (c *Client) Trace(ctx context.Context, r TraceRequest) (TraceResult, error)
type Error ¶
type FieldKeysRequest ¶
type FieldKeysRequest struct {
Window
Signal Signal
Limit int
Search, FieldContext, DataType, MetricName string
}
func (FieldKeysRequest) Validate ¶
func (r FieldKeysRequest) Validate() error
type FieldKeysResult ¶
func (FieldKeysResult) Completeness ¶
func (r FieldKeysResult) Completeness() string
type FieldValues ¶
type FieldValuesRequest ¶
type FieldValuesRequest struct {
FieldKeysRequest
Name, Where string
}
func (FieldValuesRequest) Validate ¶
func (r FieldValuesRequest) Validate() error
type FieldValuesResult ¶
type FieldValuesResult struct {
Values FieldValues
Complete bool
Raw jsontext.Value
}
func (FieldValuesResult) Completeness ¶
func (r FieldValuesResult) Completeness() string
type Identity ¶
Raw preserves fields not interpreted by the CLI, including large JSON numbers. The typed views own validation and metadata; callers never reparse envelopes.
type MetricsListRequest ¶
func (MetricsListRequest) Validate ¶
func (r MetricsListRequest) Validate() error
type MetricsListResult ¶
type MetricsQueryRequest ¶
func (MetricsQueryRequest) Validate ¶
func (r MetricsQueryRequest) Validate() error
type NativeQuery ¶
type NativeQuery struct {
// contains filtered or unexported fields
}
NativeQuery is validated once on input and retains the original JSON numbers and open-ended expressions. Its contents cannot be mutated by callers.
func ParseQuery ¶
func ParseQuery(payload []byte) (NativeQuery, error)
type PageBudget ¶
type PageBudget struct{ Pages int }
func (PageBudget) Validate ¶
func (b PageBudget) Validate(limit int) error
type PreviewResult ¶
type PreviewResult struct {
Queries map[string]PreviewVerdict
Raw jsontext.Value
}
type PreviewVerdict ¶
type QueryResult ¶
type SearchPage ¶
type SearchPage struct {
Rows []jsontext.Value
NextCursor string
Warning jsontext.Value
Truncated bool
}
SearchPage contains API facts only. The collector owns continuation and completeness, including the upstream cursor's loss of timestamp ties.
type SearchRequest ¶
func (SearchRequest) Validate ¶
func (r SearchRequest) Validate() error
type SearchResult ¶
type TraceRequest ¶
func (TraceRequest) Validate ¶
func (r TraceRequest) Validate() error
type TraceResult ¶
func (TraceResult) Completeness ¶
func (r TraceResult) Completeness() string