Skip to content

Commit

Permalink
[dashboard] Add support for log query in legacy API
Browse files Browse the repository at this point in the history
  • Loading branch information
jbenais committed Jul 16, 2019
1 parent 7105890 commit 1bd777c
Show file tree
Hide file tree
Showing 3 changed files with 5,753 additions and 4,823 deletions.
33 changes: 33 additions & 0 deletions dashboards.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,39 @@ type GraphDefinitionRequest struct {
OrderBy *string `json:"order_by,omitempty"`
ExtraCol *string `json:"extra_col,omitempty"`
Metadata map[string]GraphDefinitionMetadata `json:"metadata,omitempty"`

// For APM and log query
LogQuery *GraphApmOrLogQuery `json:"log_query,omitempty"`
}

// GraphApmOrLogQuery represents an APM or a Log query
type GraphApmOrLogQuery struct {
Index *string `json:"index"`
Compute *GraphApmOrLogQueryCompute `json:"compute"`
Search *GraphApmOrLogQuerySearch `json:"search,omitempty"`
GroupBy []GraphApmOrLogQueryGroupBy `json:"groupBy,omitempty"`
}

type GraphApmOrLogQueryCompute struct {
Aggregation *string `json:"aggregation"`
Facet *string `json:"facet,omitempty"`
Interval *int `json:"interval,omitempty"`
}

type GraphApmOrLogQuerySearch struct {
Query *string `json:"query"`
}

type GraphApmOrLogQueryGroupBy struct {
Facet *string `json:"facet"`
Limit *int `json:"limit,omitempty"`
Sort *GraphApmOrLogQueryGroupBySort `json:"sort,omitempty"`
}

type GraphApmOrLogQueryGroupBySort struct {
Aggregation *string `json:"aggregation"`
Order *string `json:"order"`
Facet *string `json:"facet,omitempty"`
}

type GraphDefinitionMetadata TileDefMetadata
Expand Down
Loading

0 comments on commit 1bd777c

Please sign in to comment.