2022-07-04 17:13:36 +05:30
|
|
|
package interfaces
|
2021-05-22 19:51:56 +05:30
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
|
|
|
|
|
2022-07-14 11:59:06 +05:30
|
|
|
"github.com/ClickHouse/clickhouse-go/v2"
|
2021-08-29 10:28:40 +05:30
|
|
|
"github.com/prometheus/prometheus/promql"
|
|
|
|
|
"github.com/prometheus/prometheus/util/stats"
|
2022-03-28 21:01:57 +05:30
|
|
|
am "go.signoz.io/query-service/integrations/alertManager"
|
2022-04-06 16:29:10 +05:30
|
|
|
"go.signoz.io/query-service/model"
|
2021-05-22 19:51:56 +05:30
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type Reader interface {
|
2021-11-22 16:15:58 +05:30
|
|
|
GetChannel(id string) (*model.ChannelItem, *model.ApiError)
|
|
|
|
|
GetChannels() (*[]model.ChannelItem, *model.ApiError)
|
|
|
|
|
DeleteChannel(id string) *model.ApiError
|
2022-03-28 21:01:57 +05:30
|
|
|
CreateChannel(receiver *am.Receiver) (*am.Receiver, *model.ApiError)
|
|
|
|
|
EditChannel(receiver *am.Receiver, id string) (*am.Receiver, *model.ApiError)
|
2021-11-22 16:15:58 +05:30
|
|
|
|
2021-08-29 10:28:40 +05:30
|
|
|
GetInstantQueryMetricsResult(ctx context.Context, query *model.InstantQueryMetricsParams) (*promql.Result, *stats.QueryStats, *model.ApiError)
|
|
|
|
|
GetQueryRangeResult(ctx context.Context, query *model.QueryRangeParams) (*promql.Result, *stats.QueryStats, *model.ApiError)
|
2022-05-03 11:20:57 +05:30
|
|
|
GetServiceOverview(ctx context.Context, query *model.GetServiceOverviewParams) (*[]model.ServiceOverviewItem, *model.ApiError)
|
|
|
|
|
GetServices(ctx context.Context, query *model.GetServicesParams) (*[]model.ServiceItem, *model.ApiError)
|
|
|
|
|
GetTopEndpoints(ctx context.Context, query *model.GetTopEndpointsParams) (*[]model.TopEndpointsItem, *model.ApiError)
|
2021-05-31 11:14:11 +05:30
|
|
|
GetUsage(ctx context.Context, query *model.GetUsageParams) (*[]model.UsageItem, error)
|
|
|
|
|
GetServicesList(ctx context.Context) (*[]string, error)
|
|
|
|
|
GetServiceMapDependencies(ctx context.Context, query *model.GetServicesParams) (*[]model.ServiceMapDependencyResponseItem, error)
|
2021-10-20 13:18:19 +05:30
|
|
|
GetTTL(ctx context.Context, ttlParams *model.GetTTLParams) (*model.GetTTLResponseItem, *model.ApiError)
|
2022-03-21 23:58:56 +05:30
|
|
|
|
|
|
|
|
// GetDisks returns a list of disks configured in the underlying DB. It is supported by
|
|
|
|
|
// clickhouse only.
|
|
|
|
|
GetDisks(ctx context.Context) (*[]model.DiskItem, *model.ApiError)
|
2022-01-26 20:41:59 +05:30
|
|
|
GetSpanFilters(ctx context.Context, query *model.SpanFilterParams) (*model.SpanFiltersResponse, *model.ApiError)
|
|
|
|
|
GetTagFilters(ctx context.Context, query *model.TagFilterParams) (*[]model.TagFilters, *model.ApiError)
|
2022-02-08 23:05:50 +05:30
|
|
|
GetTagValues(ctx context.Context, query *model.TagFilterParams) (*[]model.TagValues, *model.ApiError)
|
2022-01-26 20:41:59 +05:30
|
|
|
GetFilteredSpans(ctx context.Context, query *model.GetFilteredSpansParams) (*model.GetFilterSpansResponse, *model.ApiError)
|
|
|
|
|
GetFilteredSpansAggregates(ctx context.Context, query *model.GetFilteredSpanAggregatesParams) (*model.GetFilteredSpansAggregatesResponse, *model.ApiError)
|
|
|
|
|
|
2022-07-13 15:55:43 +05:30
|
|
|
ListErrors(ctx context.Context, params *model.ListErrorsParams) (*[]model.Error, *model.ApiError)
|
|
|
|
|
CountErrors(ctx context.Context, params *model.CountErrorsParams) (uint64, *model.ApiError)
|
|
|
|
|
GetErrorFromErrorID(ctx context.Context, params *model.GetErrorParams) (*model.ErrorWithSpan, *model.ApiError)
|
|
|
|
|
GetErrorFromGroupID(ctx context.Context, params *model.GetErrorParams) (*model.ErrorWithSpan, *model.ApiError)
|
|
|
|
|
GetNextPrevErrorIDs(ctx context.Context, params *model.GetErrorParams) (*model.NextPrevErrorIDs, *model.ApiError)
|
|
|
|
|
|
2021-10-20 13:18:19 +05:30
|
|
|
// Search Interfaces
|
|
|
|
|
SearchTraces(ctx context.Context, traceID string) (*[]model.SearchSpansResult, error)
|
|
|
|
|
|
|
|
|
|
// Setter Interfaces
|
|
|
|
|
SetTTL(ctx context.Context, ttlParams *model.TTLParams) (*model.SetTTLResponseItem, *model.ApiError)
|
2022-05-03 11:20:57 +05:30
|
|
|
|
2022-06-24 14:52:11 +05:30
|
|
|
GetMetricAutocompleteMetricNames(ctx context.Context, matchText string, limit int) (*[]string, *model.ApiError)
|
2022-05-03 11:20:57 +05:30
|
|
|
GetMetricAutocompleteTagKey(ctx context.Context, params *model.MetricAutocompleteTagParams) (*[]string, *model.ApiError)
|
|
|
|
|
GetMetricAutocompleteTagValue(ctx context.Context, params *model.MetricAutocompleteTagParams) (*[]string, *model.ApiError)
|
2022-06-24 14:52:11 +05:30
|
|
|
GetMetricResult(ctx context.Context, query string) ([]*model.Series, error)
|
2022-07-04 17:13:36 +05:30
|
|
|
|
|
|
|
|
GetTotalSpans(ctx context.Context) (uint64, error)
|
|
|
|
|
GetSpansInLastHeartBeatInterval(ctx context.Context) (uint64, error)
|
|
|
|
|
GetTimeSeriesInfo(ctx context.Context) (map[string]interface{}, error)
|
|
|
|
|
GetSamplesInfoInLastHeartBeatInterval(ctx context.Context) (uint64, error)
|
2022-07-12 16:38:26 +05:30
|
|
|
|
|
|
|
|
// Logs
|
|
|
|
|
GetLogFields(ctx context.Context) (*model.GetFieldsResponse, *model.ApiError)
|
|
|
|
|
UpdateLogField(ctx context.Context, field *model.UpdateField) *model.ApiError
|
2022-07-13 15:42:13 +05:30
|
|
|
GetLogs(ctx context.Context, params *model.LogsFilterParams) (*[]model.GetLogsResponse, *model.ApiError)
|
2022-07-18 16:37:46 +05:30
|
|
|
TailLogs(ctx context.Context, client *model.LogsTailClient) *model.ApiError
|
2022-07-18 16:49:04 +05:30
|
|
|
|
2022-07-14 11:59:06 +05:30
|
|
|
// Connection needed for rules, not ideal but required
|
|
|
|
|
GetConn() clickhouse.Conn
|
2021-05-22 19:51:56 +05:30
|
|
|
}
|