Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metric graphs within a dashboard #8202

Merged
merged 12 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions backend/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ var Models = []interface{}{
&SystemConfiguration{},
&SessionInsight{},
&ErrorTag{},
&Graph{},
&Visualization{},
}

func init() {
Expand Down Expand Up @@ -1432,6 +1434,32 @@ type Retryable struct {
Error string
}

type Graph struct {
Model
VisualizationID int `gorm:"index"`
Type string
Title string
ProductType modelInputs.ProductType
Query string
Metric string
FunctionType modelInputs.MetricAggregator
GroupByKey *string
BucketByKey *string
BucketCount *int
Limit *int
LimitFunctionType *modelInputs.MetricAggregator
LimitMetric *string
Display *string
NullHandling *string
}

type Visualization struct {
Model
ProjectID int `gorm:"uniqueIndex:visualization_project_id_name_idx"`
Name string `gorm:"uniqueIndex:visualization_project_id_name_idx"`
Graphs []Graph
}

func SetupDB(ctx context.Context, dbName string) (*gorm.DB, error) {
var (
host = os.Getenv("PSQL_HOST")
Expand Down
Loading
Loading