Skip to content

Commit

Permalink
Add fields to Target struct for PostgreSQL (grafana-tools#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
GustavJaner authored Aug 2, 2020
1 parent 007f486 commit e6a8cdd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions panel.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,26 @@ type Target struct {
Datasource string `json:"datasource,omitempty"`
Hide bool `json:"hide,omitempty"`

// For PostgreSQL
Table string `json:"table,omitempty"`
TimeColumn string `json:"timeColumn,omitempty"`
MetricColumn string `json:"metricColumn,omitempty"`
RawSql string `json:"rawSql,omitempty"`
Select [][]struct {
Params []string `json:"params,omitempty"`
Type string `json:"type,omitempty"`
} `json:"select,omitempty"`
Where []struct {
Type string `json:"type,omitempty"`
Name string `json:"name,omitempty"`
Params []string `json:"params,omitempty"`
Datatype string `json:"datatype,omitempty"`
} `json:"where,omitempty"`
Group []struct {
Type string `json:"type,omitempty"`
Params []string `json:"params,omitempty"`
} `json:"group,omitempty"`

// For Prometheus
Expr string `json:"expr,omitempty"`
IntervalFactor int `json:"intervalFactor,omitempty"`
Expand Down

0 comments on commit e6a8cdd

Please sign in to comment.