signoz/pkg/query-service/model/queryParams.go
Yash Sharma 992644dff7
Added GET/SET endpoint for setting ttl for clickhouse (#304)
* feat: add ttl for clickhouse setup in signoz

* feat: added ttl for metrics table

Signed-off-by: Yash Sharma <yashrsharma44@gmail.com>

* feat: changed the api to use type and duration as params

Signed-off-by: Yash Sharma <yashrsharma44@gmail.com>

* added a getter for ttl endpoint

Signed-off-by: Yash Sharma <yashrsharma44@gmail.com>

* added a feature to retunr ttl for both metrics and traces

Signed-off-by: Yash Sharma <yashrsharma44@gmail.com>
2021-10-20 13:18:19 +05:30

118 lines
2.1 KiB
Go

package model
import (
"fmt"
"time"
)
type InstantQueryMetricsParams struct {
Time time.Time
Query string
Stats string
}
type QueryRangeParams struct {
Start time.Time
End time.Time
Step time.Duration
Query string
Stats string
}
type GetTopEndpointsParams struct {
StartTime string
EndTime string
ServiceName string
Start *time.Time
End *time.Time
}
type GetUsageParams struct {
StartTime string
EndTime string
ServiceName string
Period string
StepHour int
Start *time.Time
End *time.Time
}
type GetServicesParams struct {
StartTime string
EndTime string
Period int
Start *time.Time
End *time.Time
}
type GetServiceOverviewParams struct {
StartTime string
EndTime string
Start *time.Time
End *time.Time
ServiceName string
Period string
StepSeconds int
}
type ApplicationPercentileParams struct {
ServiceName string
GranOrigin string
GranPeriod string
Intervals string
}
func (query *ApplicationPercentileParams) SetGranPeriod(step int) {
minutes := step / 60
query.GranPeriod = fmt.Sprintf("PT%dM", minutes)
}
type TagQuery struct {
Key string
Value string
Operator string
}
type SpanSearchAggregatesParams struct {
ServiceName string
OperationName string
Kind string
MinDuration string
MaxDuration string
Tags []TagQuery
Start *time.Time
End *time.Time
GranOrigin string
GranPeriod string
Intervals string
StepSeconds int
Dimension string
AggregationOption string
}
type SpanSearchParams struct {
ServiceName string
OperationName string
Kind string
Intervals string
Start *time.Time
End *time.Time
MinDuration string
MaxDuration string
Limit int64
Order string
Offset int64
BatchSize int64
Tags []TagQuery
}
type TTLParams struct {
Type string
Duration string
}
type GetTTLParams struct {
Type string
GetAllTTL bool
}