mirror of
https://github.com/SigNoz/signoz.git
synced 2026-10-07 18:50:41 +01:00
Some checks failed
build-staging / prepare (push) Has been cancelled
build-staging / js-build (push) Has been cancelled
build-staging / go-build (push) Has been cancelled
build-staging / staging (push) Has been cancelled
cacheci / tests (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
#### Description - The frontend websocket client for query progress (`api/common/getQueryStats.ts`) was deleted in #9183, so `/api/v3/query_progress` and `/ws/query_progress` have had no consumers since. - Removes the `query_progress` tracker package, the `GetQueryProgressUpdates` handler, the `RegisterWebSocketPaths` route group, and the `websocket.Upgrader` on `APIHandler`. - Removes the clickhouse reader hooks that reported progress (`ReportQueryStartForProgressTracking`, `SubscribeToQueryProgress`, and the `clickhouse.WithProgress` callback in `GetTimeSeriesResultV3`), along with the untyped `"queryId"` context value they relied on. - Removes the `X-SIGNOZ-QUERY-ID` header the logs explorer still sent, plus the now-dead `Sec-WebSocket-Protocol` entries in the CORS allowlist and the `identn` tokenizer defaults. Livetail streams over SSE, so no websocket endpoint remains. #### Additional Information - `gorilla/websocket` moves from a direct to an indirect dependency (still pulled in by opamp-go). - Dropping `Sec-WebSocket-Protocol` from `identn.tokenizer.headers` changes a default in `conf/example.yaml`. It is only a token-extraction source for websocket handshakes, of which there are none left, but calling it out since it is a config-surface change.
119 lines
8.1 KiB
Go
119 lines
8.1 KiB
Go
package interfaces
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"github.com/SigNoz/signoz/pkg/query-service/model"
|
|
v3 "github.com/SigNoz/signoz/pkg/query-service/model/v3"
|
|
"github.com/SigNoz/signoz/pkg/query-service/querycache"
|
|
"github.com/SigNoz/signoz/pkg/types/retentiontypes"
|
|
"github.com/SigNoz/signoz/pkg/valuer"
|
|
"github.com/prometheus/prometheus/promql"
|
|
"github.com/prometheus/prometheus/util/stats"
|
|
)
|
|
|
|
type Reader interface {
|
|
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)
|
|
GetTopLevelOperations(ctx context.Context, start, end time.Time, services []string) (*map[string][]string, *model.ApiError)
|
|
GetEntryPointOperations(ctx context.Context, orgID valuer.UUID, query *model.GetTopOperationsParams) (*[]model.TopOperationsItem, error)
|
|
GetServices(ctx context.Context, orgID valuer.UUID, query *model.GetServicesParams) (*[]model.ServiceItem, *model.ApiError)
|
|
GetTopOperations(ctx context.Context, orgID valuer.UUID, query *model.GetTopOperationsParams) (*[]model.TopOperationsItem, *model.ApiError)
|
|
GetUsage(ctx context.Context, query *model.GetUsageParams) (*[]model.UsageItem, error)
|
|
GetServicesList(ctx context.Context) (*[]string, error)
|
|
GetDependencyGraph(ctx context.Context, orgID valuer.UUID, query *model.GetServicesParams) (*[]model.ServiceMapDependencyResponseItem, error)
|
|
|
|
GetTTL(ctx context.Context, orgID string, ttlParams *retentiontypes.GetTTLParams) (*retentiontypes.GetTTLResponseItem, *model.ApiError)
|
|
GetCustomRetentionTTL(ctx context.Context, orgID string) (*retentiontypes.GetCustomRetentionTTLResponse, error)
|
|
|
|
// 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)
|
|
GetTraceAggregateAttributes(ctx context.Context, req *v3.AggregateAttributeRequest) (*v3.AggregateAttributeResponse, error)
|
|
GetTraceAttributeKeys(ctx context.Context, req *v3.FilterAttributeKeyRequest) (*v3.FilterAttributeKeyResponse, error)
|
|
GetTraceAttributeValues(ctx context.Context, req *v3.FilterAttributeValueRequest) (*v3.FilterAttributeValueResponse, error)
|
|
GetSpanAttributeKeysByNames(ctx context.Context, names []string) (map[string]v3.AttributeKey, error)
|
|
|
|
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)
|
|
|
|
// Search Interfaces
|
|
SearchTraces(ctx context.Context, params *model.SearchTracesParams) (*[]model.SearchSpansResult, error)
|
|
// Setter Interfaces
|
|
SetTTL(ctx context.Context, orgID string, ttlParams *retentiontypes.TTLParams) (*retentiontypes.SetTTLResponseItem, *model.ApiError)
|
|
SetTTLV2(ctx context.Context, orgID string, params *retentiontypes.CustomRetentionTTLParams) (*retentiontypes.CustomRetentionTTLResponse, error)
|
|
|
|
FetchTemporality(ctx context.Context, orgID valuer.UUID, metricNames []string) (map[string]map[v3.Temporality]bool, error)
|
|
GetMetricAggregateAttributes(ctx context.Context, orgID valuer.UUID, req *v3.AggregateAttributeRequest, skipSignozMetrics bool) (*v3.AggregateAttributeResponse, error)
|
|
GetMeterAggregateAttributes(ctx context.Context, orgID valuer.UUID, req *v3.AggregateAttributeRequest) (*v3.AggregateAttributeResponse, error)
|
|
GetMetricAttributeKeys(ctx context.Context, orgID valuer.UUID, req *v3.FilterAttributeKeyRequest) (*v3.FilterAttributeKeyResponse, error)
|
|
GetMeterAttributeKeys(ctx context.Context, req *v3.FilterAttributeKeyRequest) (*v3.FilterAttributeKeyResponse, error)
|
|
GetMetricAttributeValues(ctx context.Context, orgID valuer.UUID, req *v3.FilterAttributeValueRequest) (*v3.FilterAttributeValueResponse, error)
|
|
|
|
// Returns `MetricStatus` for latest received metric among `metricNames`. Useful for status calculations
|
|
GetLatestReceivedMetric(
|
|
ctx context.Context, orgID valuer.UUID, metricNames []string, labelValues map[string]string,
|
|
) (*model.MetricStatus, *model.ApiError)
|
|
|
|
// QB V3 metrics/traces/logs
|
|
GetTimeSeriesResultV3(ctx context.Context, query string) ([]*v3.Series, error)
|
|
GetListResultV3(ctx context.Context, query string) ([]*v3.Row, error)
|
|
// Logs
|
|
GetLogFields(ctx context.Context) (*model.GetFieldsResponse, *model.ApiError)
|
|
GetLogFieldsFromNames(ctx context.Context, fieldNames []string) (*model.GetFieldsResponse, *model.ApiError)
|
|
UpdateLogField(ctx context.Context, field *model.UpdateField) *model.ApiError
|
|
GetLogAttributeKeys(ctx context.Context, req *v3.FilterAttributeKeyRequest) (*v3.FilterAttributeKeyResponse, error)
|
|
GetLogAttributeValues(ctx context.Context, req *v3.FilterAttributeValueRequest) (*v3.FilterAttributeValueResponse, error)
|
|
GetLogAggregateAttributes(ctx context.Context, req *v3.AggregateAttributeRequest) (*v3.AggregateAttributeResponse, error)
|
|
GetQBFilterSuggestionsForLogs(
|
|
ctx context.Context,
|
|
req *v3.QBFilterSuggestionsRequest,
|
|
) (*v3.QBFilterSuggestionsResponse, *model.ApiError)
|
|
|
|
QueryDashboardVars(ctx context.Context, query string) (*model.DashboardVar, error)
|
|
CheckClickHouse(ctx context.Context) error
|
|
|
|
GetMetricMetadata(context.Context, valuer.UUID, string, string) (*v3.MetricMetadataResponse, error)
|
|
|
|
AddRuleStateHistory(ctx context.Context, ruleStateHistory []model.RuleStateHistory) error
|
|
GetOverallStateTransitions(ctx context.Context, ruleID string, params *model.QueryRuleStateHistory) ([]model.ReleStateItem, error)
|
|
ReadRuleStateHistoryByRuleID(ctx context.Context, ruleID string, params *model.QueryRuleStateHistory) (*model.RuleStateTimeline, error)
|
|
GetTotalTriggers(ctx context.Context, ruleID string, params *model.QueryRuleStateHistory) (uint64, error)
|
|
GetTriggersByInterval(ctx context.Context, ruleID string, params *model.QueryRuleStateHistory) (*v3.Series, error)
|
|
GetAvgResolutionTime(ctx context.Context, ruleID string, params *model.QueryRuleStateHistory) (float64, error)
|
|
GetAvgResolutionTimeByInterval(ctx context.Context, ruleID string, params *model.QueryRuleStateHistory) (*v3.Series, error)
|
|
ReadRuleStateHistoryTopContributorsByRuleID(ctx context.Context, ruleID string, params *model.QueryRuleStateHistory) ([]model.RuleStateHistoryContributor, error)
|
|
GetLastSavedRuleStateHistory(ctx context.Context, ruleID string) ([]model.RuleStateHistory, error)
|
|
|
|
GetMinAndMaxTimestampForTraceID(ctx context.Context, traceID []string) (int64, int64, error)
|
|
|
|
//trace
|
|
GetTraceFields(ctx context.Context) (*model.GetFieldsResponse, *model.ApiError)
|
|
UpdateTraceField(ctx context.Context, field *model.UpdateField) *model.ApiError
|
|
|
|
UpdateMetricsMetadata(ctx context.Context, orgID valuer.UUID, req *model.UpdateMetricsMetadata) *model.ApiError
|
|
GetUpdatedMetricsMetadata(ctx context.Context, orgID valuer.UUID, metricNames ...string) (map[string]*model.UpdateMetricsMetadata, *model.ApiError)
|
|
|
|
CheckForLabelsInMetric(ctx context.Context, orgID valuer.UUID, metricName string, labels []string) (bool, *model.ApiError)
|
|
}
|
|
|
|
type Querier interface {
|
|
QueryRange(context.Context, valuer.UUID, *v3.QueryRangeParamsV3) ([]*v3.Result, map[string]error, error)
|
|
|
|
// test helpers
|
|
QueriesExecuted() []string
|
|
TimeRanges() [][]int
|
|
}
|
|
|
|
type QueryCache interface {
|
|
FindMissingTimeRanges(orgID valuer.UUID, start, end int64, step int64, cacheKey string) []querycache.MissInterval
|
|
FindMissingTimeRangesV2(orgID valuer.UUID, start, end int64, step int64, cacheKey string) []querycache.MissInterval
|
|
MergeWithCachedSeriesData(orgID valuer.UUID, cacheKey string, newData []querycache.CachedSeriesData) []querycache.CachedSeriesData
|
|
StoreSeriesInCache(orgID valuer.UUID, cacheKey string, series []querycache.CachedSeriesData)
|
|
MergeWithCachedSeriesDataV2(orgID valuer.UUID, cacheKey string, series []querycache.CachedSeriesData) []querycache.CachedSeriesData
|
|
}
|