Documentation
¶
Overview ¶
Package signoz provides source-scoped, bounded read operations for SigNoz.
Index ¶
- Constants
- Variables
- func Retryable(err error) bool
- func ScrubExactSecret(value, secret string) string
- func ScrubExactSecretValue(value any, secret string) any
- func ScrubSignalExactSecret(signal core.Signal, secret string) core.Signal
- type Client
- type Config
- type FieldRequest
- type MetricRequest
- type Policy
- type Result
- type SearchRequest
- type Service
- func (service *Service) DiscoveryAvailable() bool
- func (service *Service) FieldKeys(ctx context.Context, signal Signal, request FieldRequest) (Result, error)
- func (service *Service) FieldValues(ctx context.Context, signal Signal, request FieldRequest) (Result, error)
- func (service *Service) ListMetrics(ctx context.Context, search string, limit int) (Result, error)
- func (service *Service) QueryMetrics(ctx context.Context, request MetricRequest) (Result, error)
- func (service *Service) SearchLogs(ctx context.Context, request SearchRequest) (Result, error)
- func (service *Service) SearchTraces(ctx context.Context, request SearchRequest) (Result, error)
- func (service *Service) SetScrubber(scrubber core.Scrubber)
- type Signal
- type StatusError
Constants ¶
const ( QueryRangePath = "/api/v5/query_range" FieldKeysPath = "/api/v1/fields/keys" FieldValuesPath = "/api/v1/fields/values" MetricsPath = "/api/v2/metrics" DefaultLimit = 50 MaximumLimit = 100 MaximumOffset = 10_000 )
Variables ¶
Functions ¶
func ScrubExactSecret ¶
ScrubExactSecret removes every occurrence of secret from value.
func ScrubExactSecretValue ¶
ScrubExactSecretValue returns a fresh copy of JSON-shaped maps and arrays with the exact secret removed from every map key and string value.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client owns the shared read-only SigNoz HTTP transport.
type Config ¶
type Config struct {
Address string
APIKey string
InsecureSkipVerify bool
AllowLoopback bool
AllowPrivate bool
RootCAs *x509.CertPool
ScopeFilter string
}
Config contains one source's trusted connection and scope settings.
type FieldRequest ¶
type FieldRequest struct {
MetricName string
SearchText string
Context string
DataType string
Name string
}
FieldRequest scopes field discovery to a trusted signal and optional metric.
type MetricRequest ¶
type MetricRequest struct {
Start time.Time
End time.Time
Service string
MetricName string
Temporality string
TimeAggregation string
SpaceAggregation string
Step time.Duration
Limit int
}
MetricRequest is a bounded time-series read for one named metric.
type Policy ¶
type Policy struct {
Timeout time.Duration
MaximumBytes int64
MaximumWindow time.Duration
MaximumRows int
MaximumSeries int
MaximumFieldKeys int
MaximumDatapointsPerSeries int
MaximumDatapoints int
}
Policy contains independent resource budgets for one use of the service.
func IngestPolicy ¶
func IngestPolicy() Policy
IngestPolicy preserves the larger response and timeout budgets used by source ingestion.
func ToolPolicy ¶
func ToolPolicy() Policy
ToolPolicy is the bounded interactive-read policy used by model tools.
type Result ¶
type Result struct {
Data map[string]any `json:"data"`
Count int `json:"count"`
Truncated bool `json:"truncated"`
Truncation []string `json:"truncation,omitempty"`
Offset int `json:"offset,omitempty"`
Limit int `json:"limit"`
}
Result is a model-neutral bounded response from SigNoz.
type SearchRequest ¶
type SearchRequest struct {
Start time.Time
End time.Time
Service string
SearchText string
Severity string
Operation string
ErrorOnly *bool
Offset int
Limit int
}
SearchRequest is a bounded raw logs or spans read. Filter is always composed with the configured source scope and cannot replace it.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service owns transport, validation, source scope, budgets, and redaction for one source.
func NewService ¶
NewService validates one source and constructs a bounded read-only service.
func (*Service) DiscoveryAvailable ¶
DiscoveryAvailable reports whether source-wide metadata discovery is safe. SigNoz discovery endpoints do not accept the configured query scope.
func (*Service) FieldKeys ¶
func (service *Service) FieldKeys(ctx context.Context, signal Signal, request FieldRequest) (Result, error)
FieldKeys discovers bounded fields for one trusted signal.
func (*Service) FieldValues ¶
func (service *Service) FieldValues(ctx context.Context, signal Signal, request FieldRequest) (Result, error)
FieldValues discovers bounded observed values for one trusted signal field.
func (*Service) ListMetrics ¶
ListMetrics discovers bounded metric metadata from the configured source.
func (*Service) QueryMetrics ¶
QueryMetrics reads bounded time series for one metric from the configured source.
func (*Service) SearchLogs ¶
SearchLogs reads bounded log rows from the configured source.
func (*Service) SearchTraces ¶
SearchTraces reads bounded span rows from the configured source.
func (*Service) SetScrubber ¶
SetScrubber applies the shared redaction policy before data leaves the service.
type Signal ¶
type Signal string
Signal is a SigNoz query signal selected by trusted source configuration.
type StatusError ¶
type StatusError struct {
StatusCode int
}
StatusError carries an upstream status without including its response body.
func (*StatusError) Error ¶
func (err *StatusError) Error() string