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

New data sources for widgets #304

Merged
Merged
Show file tree
Hide file tree
Changes from 6 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
90 changes: 54 additions & 36 deletions board_widgets.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,12 @@ type ChangeRequest struct {
OrderDir *string `json:"order_dir,omitempty"`
ShowPresent *bool `json:"show_present,omitempty"`
// A ChangeRequest should implement exactly one of the following query types
MetricQuery *string `json:"q,omitempty"`
ApmQuery *WidgetApmOrLogQuery `json:"apm_query,omitempty"`
LogQuery *WidgetApmOrLogQuery `json:"log_query,omitempty"`
ProcessQuery *WidgetProcessQuery `json:"process_query,omitempty"`
MetricQuery *string `json:"q,omitempty"`
ApmQuery *WidgetApmOrLogQuery `json:"apm_query,omitempty"`
LogQuery *WidgetApmOrLogQuery `json:"log_query,omitempty"`
ProcessQuery *WidgetProcessQuery `json:"process_query,omitempty"`
RumQuery *WidgetApmOrLogQuery `json:"rum_query,omitempty"`
SecurityQuery *WidgetApmOrLogQuery `json:"security_query,omitempty"`
}

// CheckStatusDefinition represents the definition for a Check Status widget
Expand Down Expand Up @@ -180,10 +182,12 @@ type DistributionDefinition struct {
type DistributionRequest struct {
Style *WidgetRequestStyle `json:"style,omitempty"`
// A DistributionRequest should implement exactly one of the following query types
MetricQuery *string `json:"q,omitempty"`
ApmQuery *WidgetApmOrLogQuery `json:"apm_query,omitempty"`
LogQuery *WidgetApmOrLogQuery `json:"log_query,omitempty"`
ProcessQuery *WidgetProcessQuery `json:"process_query,omitempty"`
MetricQuery *string `json:"q,omitempty"`
ApmQuery *WidgetApmOrLogQuery `json:"apm_query,omitempty"`
LogQuery *WidgetApmOrLogQuery `json:"log_query,omitempty"`
ProcessQuery *WidgetProcessQuery `json:"process_query,omitempty"`
RumQuery *WidgetApmOrLogQuery `json:"rum_query,omitempty"`
SecurityQuery *WidgetApmOrLogQuery `json:"security_query,omitempty"`
}

// EventStreamDefinition represents the definition for an Event Stream widget
Expand Down Expand Up @@ -238,10 +242,12 @@ type HeatmapDefinition struct {
type HeatmapRequest struct {
Style *WidgetRequestStyle `json:"style,omitempty"`
// A HeatmapRequest should implement exactly one of the following query types
MetricQuery *string `json:"q,omitempty"`
ApmQuery *WidgetApmOrLogQuery `json:"apm_query,omitempty"`
LogQuery *WidgetApmOrLogQuery `json:"log_query,omitempty"`
ProcessQuery *WidgetProcessQuery `json:"process_query,omitempty"`
MetricQuery *string `json:"q,omitempty"`
ApmQuery *WidgetApmOrLogQuery `json:"apm_query,omitempty"`
LogQuery *WidgetApmOrLogQuery `json:"log_query,omitempty"`
ProcessQuery *WidgetProcessQuery `json:"process_query,omitempty"`
RumQuery *WidgetApmOrLogQuery `json:"rum_query,omitempty"`
SecurityQuery *WidgetApmOrLogQuery `json:"security_query,omitempty"`
}

// HostmapDefinition represents the definition for a Hostmap widget
Expand All @@ -264,10 +270,12 @@ type HostmapRequests struct {
}
type HostmapRequest struct {
// A HostmapRequest should implement exactly one of the following query types
MetricQuery *string `json:"q,omitempty"`
ApmQuery *WidgetApmOrLogQuery `json:"apm_query,omitempty"`
LogQuery *WidgetApmOrLogQuery `json:"log_query,omitempty"`
ProcessQuery *WidgetProcessQuery `json:"process_query,omitempty"`
MetricQuery *string `json:"q,omitempty"`
ApmQuery *WidgetApmOrLogQuery `json:"apm_query,omitempty"`
LogQuery *WidgetApmOrLogQuery `json:"log_query,omitempty"`
ProcessQuery *WidgetProcessQuery `json:"process_query,omitempty"`
RumQuery *WidgetApmOrLogQuery `json:"rum_query,omitempty"`
SecurityQuery *WidgetApmOrLogQuery `json:"security_query,omitempty"`
}
type HostmapStyle struct {
Palette *string `json:"palette,omitempty"`
Expand Down Expand Up @@ -348,10 +356,12 @@ type QueryValueRequest struct {
ConditionalFormats []WidgetConditionalFormat `json:"conditional_formats,omitempty"`
Aggregator *string `json:"aggregator,omitempty"`
// A QueryValueRequest should implement exactly one of the following query types
MetricQuery *string `json:"q,omitempty"`
ApmQuery *WidgetApmOrLogQuery `json:"apm_query,omitempty"`
LogQuery *WidgetApmOrLogQuery `json:"log_query,omitempty"`
ProcessQuery *WidgetProcessQuery `json:"process_query,omitempty"`
MetricQuery *string `json:"q,omitempty"`
ApmQuery *WidgetApmOrLogQuery `json:"apm_query,omitempty"`
LogQuery *WidgetApmOrLogQuery `json:"log_query,omitempty"`
ProcessQuery *WidgetProcessQuery `json:"process_query,omitempty"`
RumQuery *WidgetApmOrLogQuery `json:"rum_query,omitempty"`
SecurityQuery *WidgetApmOrLogQuery `json:"security_query,omitempty"`
}

// QueryTableDefinition represents the definition for a Table widget
Expand All @@ -370,10 +380,12 @@ type QueryTableRequest struct {
Limit *int `json:"limit,omitempty"`
Order *string `json:"order,omitempty"`
// A QueryTableRequest should implement exactly one of the following query types
MetricQuery *string `json:"q,omitempty"`
ApmQuery *WidgetApmOrLogQuery `json:"apm_query,omitempty"`
LogQuery *WidgetApmOrLogQuery `json:"log_query,omitempty"`
ProcessQuery *WidgetProcessQuery `json:"process_query,omitempty"`
MetricQuery *string `json:"q,omitempty"`
ApmQuery *WidgetApmOrLogQuery `json:"apm_query,omitempty"`
LogQuery *WidgetApmOrLogQuery `json:"log_query,omitempty"`
ProcessQuery *WidgetProcessQuery `json:"process_query,omitempty"`
RumQuery *WidgetApmOrLogQuery `json:"rum_query,omitempty"`
SecurityQuery *WidgetApmOrLogQuery `json:"security_query,omitempty"`
}

// ScatterplotDefinition represents the definition for a Scatterplot widget
Expand All @@ -395,10 +407,12 @@ type ScatterplotRequests struct {
type ScatterplotRequest struct {
Aggregator *string `json:"aggregator,omitempty"`
// A ScatterplotRequest should implement exactly one of the following query types
MetricQuery *string `json:"q,omitempty"`
ApmQuery *WidgetApmOrLogQuery `json:"apm_query,omitempty"`
LogQuery *WidgetApmOrLogQuery `json:"log_query,omitempty"`
ProcessQuery *WidgetProcessQuery `json:"process_query,omitempty"`
MetricQuery *string `json:"q,omitempty"`
ApmQuery *WidgetApmOrLogQuery `json:"apm_query,omitempty"`
LogQuery *WidgetApmOrLogQuery `json:"log_query,omitempty"`
ProcessQuery *WidgetProcessQuery `json:"process_query,omitempty"`
RumQuery *WidgetApmOrLogQuery `json:"rum_query,omitempty"`
SecurityQuery *WidgetApmOrLogQuery `json:"security_query,omitempty"`
}

// ServiceLevelObjectiveDefinition represents the definition for a Service Level Objective widget
Expand Down Expand Up @@ -437,10 +451,12 @@ type TimeseriesRequest struct {
Metadata []WidgetMetadata `json:"metadata,omitempty"`
DisplayType *string `json:"display_type,omitempty"`
// A TimeseriesRequest should implement exactly one of the following query types
MetricQuery *string `json:"q,omitempty"`
ApmQuery *WidgetApmOrLogQuery `json:"apm_query,omitempty"`
LogQuery *WidgetApmOrLogQuery `json:"log_query,omitempty"`
ProcessQuery *WidgetProcessQuery `json:"process_query,omitempty"`
MetricQuery *string `json:"q,omitempty"`
ApmQuery *WidgetApmOrLogQuery `json:"apm_query,omitempty"`
LogQuery *WidgetApmOrLogQuery `json:"log_query,omitempty"`
ProcessQuery *WidgetProcessQuery `json:"process_query,omitempty"`
RumQuery *WidgetApmOrLogQuery `json:"rum_query,omitempty"`
SecurityQuery *WidgetApmOrLogQuery `json:"security_query,omitempty"`
}
type TimeseriesRequestStyle struct {
Palette *string `json:"palette,omitempty"`
Expand All @@ -461,10 +477,12 @@ type ToplistRequest struct {
ConditionalFormats []WidgetConditionalFormat `json:"conditional_formats,omitempty"`
Style *WidgetRequestStyle `json:"style,omitempty"`
// A ToplistRequest should implement exactly one of the following query types
MetricQuery *string `json:"q,omitempty"`
ApmQuery *WidgetApmOrLogQuery `json:"apm_query,omitempty"`
LogQuery *WidgetApmOrLogQuery `json:"log_query,omitempty"`
ProcessQuery *WidgetProcessQuery `json:"process_query,omitempty"`
MetricQuery *string `json:"q,omitempty"`
ApmQuery *WidgetApmOrLogQuery `json:"apm_query,omitempty"`
LogQuery *WidgetApmOrLogQuery `json:"log_query,omitempty"`
ProcessQuery *WidgetProcessQuery `json:"process_query,omitempty"`
RumQuery *WidgetApmOrLogQuery `json:"rum_query,omitempty"`
SecurityQuery *WidgetApmOrLogQuery `json:"security_query,omitempty"`
}

// TraceServiceDefinition represents the definition for a Trace Service widget
Expand Down
10 changes: 6 additions & 4 deletions dashboards.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ type GraphDefinitionRequest struct {
Metadata map[string]GraphDefinitionMetadata `json:"metadata,omitempty"`

// A Graph can only have one of these types of query.
Query *string `json:"q,omitempty"`
LogQuery *GraphApmOrLogQuery `json:"log_query,omitempty"`
ApmQuery *GraphApmOrLogQuery `json:"apm_query,omitempty"`
ProcessQuery *GraphProcessQuery `json:"process_query,omitempty"`
Query *string `json:"q,omitempty"`
LogQuery *GraphApmOrLogQuery `json:"log_query,omitempty"`
ApmQuery *GraphApmOrLogQuery `json:"apm_query,omitempty"`
ProcessQuery *GraphProcessQuery `json:"process_query,omitempty"`
RumQuery *GraphApmOrLogQuery `json:"rum_query,omitempty"`
SecurityQuery *GraphApmOrLogQuery `json:"security_query,omitempty"`
}

// GraphApmOrLogQuery represents an APM or a Log query
Expand Down
Loading