Core: Remove thema and kindsys dependencies (#84499)
* Move some thema code inside grafana * Use new codegen instead of thema for core kinds * Replace TS generator * Use new generator for go types * Remove thema from oapi generator * Remove thema from generators * Don't use kindsys/thema for core kinds * Remove kindsys/thema from plugins * Remove last thema related * Remove most of cuectx and move utils_ts into codegen. It also deletes wire dependency * Merge plugins generators * Delete thema dependency 🎉 * Fix CODEOWNERS * Fix package name * Fix TS output names * More path fixes * Fix mod codeowners * Use original plugin's name * Remove kindsys dependency 🎉 * Modify oapi schema and create an apply function to fix elasticsearch errors * cue.mod was deleted by mistake * Fix TS panels * sort imports * Fixing elasticsearch output * Downgrade oapi-codegen library * Update output ts files * More fixes * Restore old elasticsearch generated file and skip its generation. Remove core imports into plugins * More lint fixes * Add codeowners * restore embed.go file * Fix embed.go
This commit is contained in:
@@ -105,14 +105,11 @@ const (
|
||||
QueryEditorPropertyTypeString QueryEditorPropertyType = "string"
|
||||
)
|
||||
|
||||
// CloudWatchAnnotationQuery defines model for CloudWatchAnnotationQuery.
|
||||
// Shape of a CloudWatch Annotation query
|
||||
//
|
||||
// TS type is CloudWatchDefaultQuery = Omit<CloudWatchLogsQuery, 'queryMode'> & CloudWatchMetricsQuery, declared in veneer
|
||||
// #CloudWatchDefaultQuery: #CloudWatchLogsQuery & #CloudWatchMetricsQuery @cuetsy(kind="type")
|
||||
type CloudWatchAnnotationQuery struct {
|
||||
// DataQuery These are the common properties available to all queries in all datasources.
|
||||
// Specific implementations will *extend* this interface, adding the required
|
||||
// properties for the given context.
|
||||
DataQuery
|
||||
MetricStat
|
||||
|
||||
// The ID of the AWS account to query for the metric, specifying `all` will query all accounts that the monitoring account is permitted to query.
|
||||
AccountId *string `json:"accountId,omitempty"`
|
||||
|
||||
@@ -149,14 +146,14 @@ type CloudWatchAnnotationQuery struct {
|
||||
MetricName *string `json:"metricName,omitempty"`
|
||||
|
||||
// A namespace is a container for CloudWatch metrics. Metrics in different namespaces are isolated from each other, so that metrics from different applications are not mistakenly aggregated into the same statistics. For example, Amazon EC2 uses the AWS/EC2 namespace.
|
||||
Namespace string `json:"namespace"`
|
||||
Namespace *string `json:"namespace,omitempty"`
|
||||
|
||||
// The length of time associated with a specific Amazon CloudWatch statistic. Can be specified by a number of seconds, 'auto', or as a duration string e.g. '15m' being 15 minutes
|
||||
Period *string `json:"period,omitempty"`
|
||||
|
||||
// Enable matching on the prefix of the action name or alarm name, specify the prefixes with actionPrefix and/or alarmNamePrefix
|
||||
PrefixMatching *bool `json:"prefixMatching,omitempty"`
|
||||
QueryMode CloudWatchQueryMode `json:"queryMode"`
|
||||
PrefixMatching *bool `json:"prefixMatching,omitempty"`
|
||||
QueryMode *CloudWatchQueryMode `json:"queryMode,omitempty"`
|
||||
|
||||
// Specify the query flavor
|
||||
// TODO make this required and give it a default
|
||||
@@ -165,10 +162,10 @@ type CloudWatchAnnotationQuery struct {
|
||||
// A unique identifier for the query within the list of targets.
|
||||
// In server side expressions, the refId is used as a variable name to identify results.
|
||||
// By default, the UI will assign A->Z; however setting meaningful names may be useful.
|
||||
RefId string `json:"refId"`
|
||||
RefId *string `json:"refId,omitempty"`
|
||||
|
||||
// AWS region to query for the metric
|
||||
Region string `json:"region"`
|
||||
Region *string `json:"region,omitempty"`
|
||||
|
||||
// Metric data aggregations over specified periods of time. For detailed definitions of the statistics supported by CloudWatch, see https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Statistics-definitions.html.
|
||||
Statistic *string `json:"statistic,omitempty"`
|
||||
@@ -180,13 +177,8 @@ type CloudWatchAnnotationQuery struct {
|
||||
// CloudWatchDataQuery defines model for CloudWatchDataQuery.
|
||||
type CloudWatchDataQuery = map[string]any
|
||||
|
||||
// CloudWatchLogsQuery defines model for CloudWatchLogsQuery.
|
||||
// Shape of a CloudWatch Logs query
|
||||
type CloudWatchLogsQuery struct {
|
||||
// DataQuery These are the common properties available to all queries in all datasources.
|
||||
// Specific implementations will *extend* this interface, adding the required
|
||||
// properties for the given context.
|
||||
DataQuery
|
||||
|
||||
// For mixed data sources the selected datasource is on the query level.
|
||||
// For non mixed scenarios this is undefined.
|
||||
// TODO find a better way to do this ^ that's friendly to schema
|
||||
@@ -199,15 +191,15 @@ type CloudWatchLogsQuery struct {
|
||||
// Hide true if query is disabled (ie should not be returned to the dashboard)
|
||||
// Note this does not always imply that the query should not be executed since
|
||||
// the results from a hidden query may be used as the input to other queries (SSE etc)
|
||||
Hide *bool `json:"hide,omitempty"`
|
||||
Id string `json:"id"`
|
||||
Hide *bool `json:"hide,omitempty"`
|
||||
Id *string `json:"id,omitempty"`
|
||||
|
||||
// @deprecated use logGroups
|
||||
LogGroupNames []string `json:"logGroupNames,omitempty"`
|
||||
|
||||
// Log groups to query
|
||||
LogGroups []LogGroup `json:"logGroups,omitempty"`
|
||||
QueryMode CloudWatchQueryMode `json:"queryMode"`
|
||||
LogGroups []LogGroup `json:"logGroups,omitempty"`
|
||||
QueryMode *CloudWatchQueryMode `json:"queryMode,omitempty"`
|
||||
|
||||
// Specify the query flavor
|
||||
// TODO make this required and give it a default
|
||||
@@ -216,23 +208,17 @@ type CloudWatchLogsQuery struct {
|
||||
// A unique identifier for the query within the list of targets.
|
||||
// In server side expressions, the refId is used as a variable name to identify results.
|
||||
// By default, the UI will assign A->Z; however setting meaningful names may be useful.
|
||||
RefId string `json:"refId"`
|
||||
RefId *string `json:"refId,omitempty"`
|
||||
|
||||
// AWS region to query for the logs
|
||||
Region string `json:"region"`
|
||||
Region *string `json:"region,omitempty"`
|
||||
|
||||
// Fields to group the results by, this field is automatically populated whenever the query is updated
|
||||
StatsGroups []string `json:"statsGroups,omitempty"`
|
||||
}
|
||||
|
||||
// CloudWatchMetricsQuery defines model for CloudWatchMetricsQuery.
|
||||
// Shape of a CloudWatch Metrics query
|
||||
type CloudWatchMetricsQuery struct {
|
||||
// DataQuery These are the common properties available to all queries in all datasources.
|
||||
// Specific implementations will *extend* this interface, adding the required
|
||||
// properties for the given context.
|
||||
DataQuery
|
||||
MetricStat
|
||||
|
||||
// The ID of the AWS account to query for the metric, specifying `all` will query all accounts that the monitoring account is permitted to query.
|
||||
AccountId *string `json:"accountId,omitempty"`
|
||||
|
||||
@@ -258,7 +244,7 @@ type CloudWatchMetricsQuery struct {
|
||||
Hide *bool `json:"hide,omitempty"`
|
||||
|
||||
// ID can be used to reference other queries in math expressions. The ID can include numbers, letters, and underscore, and must start with a lowercase letter.
|
||||
Id string `json:"id"`
|
||||
Id *string `json:"id,omitempty"`
|
||||
|
||||
// Change the time series legend names using dynamic labels. See https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/graph-dynamic-labels.html for more details.
|
||||
Label *string `json:"label,omitempty"`
|
||||
@@ -272,7 +258,7 @@ type CloudWatchMetricsQuery struct {
|
||||
MetricQueryType *MetricQueryType `json:"metricQueryType,omitempty"`
|
||||
|
||||
// A namespace is a container for CloudWatch metrics. Metrics in different namespaces are isolated from each other, so that metrics from different applications are not mistakenly aggregated into the same statistics. For example, Amazon EC2 uses the AWS/EC2 namespace.
|
||||
Namespace string `json:"namespace"`
|
||||
Namespace *string `json:"namespace,omitempty"`
|
||||
|
||||
// The length of time associated with a specific Amazon CloudWatch statistic. Can be specified by a number of seconds, 'auto', or as a duration string e.g. '15m' being 15 minutes
|
||||
Period *string `json:"period,omitempty"`
|
||||
@@ -285,10 +271,10 @@ type CloudWatchMetricsQuery struct {
|
||||
// A unique identifier for the query within the list of targets.
|
||||
// In server side expressions, the refId is used as a variable name to identify results.
|
||||
// By default, the UI will assign A->Z; however setting meaningful names may be useful.
|
||||
RefId string `json:"refId"`
|
||||
RefId *string `json:"refId,omitempty"`
|
||||
|
||||
// AWS region to query for the metric
|
||||
Region string `json:"region"`
|
||||
Region *string `json:"region,omitempty"`
|
||||
Sql *SQLExpression `json:"sql,omitempty"`
|
||||
|
||||
// When the metric query type is `metricQueryType` is set to `Query`, this field is used to specify the query string.
|
||||
|
||||
Reference in New Issue
Block a user