diff --git a/CHANGELOG.md b/CHANGELOG.md index a28baa6..3f72043 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ ## Unreleased +### Added +* Add `PARENT_SERVICE`, `PARENT_OPERATION`, `ROOT_SERVICE`, and `ROOT_OPERATION` group-by key types to `v1/config/TraceMetricsRules`. + +### Changed +* Replace the `trace_filter` field on `v1/config/ConsumptionConfig` partition filter conditions with a repeated `trace_span_filters` field: a list of `ConsumptionSpanFilter` carried directly on the condition (the previous `ConsumptionTraceFilter` wrapper is gone). Matching happens at the span level: a span matches the condition only if it satisfies every span filter in the list (match alternatives with an `IN` string filter or with separate conditions). This field is in preview and gated by the `enable-consumption-trace-api` feature flag. (The previous shape was never operative: the field has always been gated by the `enable-consumption-trace-api` flag, which was never enabled for any customer tenant while the old shape existed, so no existing manifest is affected.) Manifests containing the new `trace_span_filters` shape require this release or newer; older chronoctl versions reject them at decode and render the filter as empty when reading entities. + +### Removed +* Remove the deprecated `sku_group` field from `v1/config/ConsumptionBudget` thresholds in favor of `resource_group`. **This is a breaking change**. + ## v1.28.0 ### Added diff --git a/src/generated/cli/configv1/consumption_budgets.gen.go b/src/generated/cli/configv1/consumption_budgets.gen.go index 249a72a..f3b5dfc 100644 --- a/src/generated/cli/configv1/consumption_budgets.gen.go +++ b/src/generated/cli/configv1/consumption_budgets.gen.go @@ -537,7 +537,6 @@ spec: # Value of the fixed rate threshold. fixed_value_per_sec: resource_group: - sku_group: type: unit: volume: diff --git a/src/generated/cli/configv1/consumption_config.gen.go b/src/generated/cli/configv1/consumption_config.gen.go index 85d1432..4599aec 100644 --- a/src/generated/cli/configv1/consumption_config.gen.go +++ b/src/generated/cli/configv1/consumption_config.gen.go @@ -363,7 +363,7 @@ spec: filters: - # Conditions for the query to match. conditions: - - # Deprecated. Use 'log_filter', 'metric_filters', or 'trace_filter' instead. + - # Deprecated. Use 'log_filter', 'metric_filters', or 'trace_span_filters' instead. dataset_slug: # If set, matches incoming metric data by label. If multiple label # filters are specified, an incoming metric must match every label @@ -371,157 +371,80 @@ spec: # including matching multiple patterns with an 'OR', such as # 'service:{svc1,svc2}'. - # Exactly one of 'log_filter', 'metric_filters', or 'trace_filter' must be set. + # Exactly one of 'log_filter', 'metric_filters', or 'trace_span_filters' must be set. metric_filters: - # The name of the label to match. name: # The glob value of the label to match. value_glob: - log_filter: - # Returns logs that match this query. The query can include only top-level - # operations. Nested clauses aren't supported. Only one type of 'AND' or 'OR' - # operator is allowed. - query: - trace_filter: - # Specifies the span conditions to match on. All conditions must be true in a - # single span for the span to be considered a match. If 'span_count' is specified, - # the number of spans within the trace that match span conditions must be within - # '[min, max]'. You can specify multiple span conditions, and each can be - # satisfied by any number of spans within the trace. - span: - - # Matches the tags of the candidate span. - tags: - - # The key or name of the span tag that this filter inspects. - key: - numeric_value: - # The filter value used in comparison against match candidates. - value: - comparison: - value: - # The value of the filter compared to the target trace or span field. - value: - # Values the filter tests against when using 'IN' or 'NOT_IN' match type. - in_values: - - - match: - duration: - # Minimum duration, in seconds, required for a span or trace to match. - min_secs: - # Maximum duration, in seconds, required for a span or trace to match. - max_secs: - error: - # The value of the filter compared to the target trace or span field. - value: - is_root_span: - # The value of the filter compared to the target trace or span field. - value: - match_type: - operation: - # The value of the filter compared to the target trace or span field. - value: - # Values the filter tests against when using 'IN' or 'NOT_IN' match type. - in_values: - - - match: - parent_operation: + # If set, matches incoming trace data at the span level: a span + # matches the condition only if it satisfies every span filter. + # Match alternatives with an 'IN' string filter or with separate + # conditions. + + # Exactly one of 'log_filter', 'metric_filters', or 'trace_span_filters' must be set. + trace_span_filters: + - # Matches the tags of the candidate span. A numeric matcher also + # compares numeric-looking string tag values. To match alternatives, + # use separate conditions. + tags: + - # The key or name of the span tag that this filter inspects. + key: + numeric_value: + # The filter value used in comparison against match candidates. + value: + comparison: + value: # The value of the filter compared to the target trace or span field. value: # Values the filter tests against when using 'IN' or 'NOT_IN' match type. in_values: - match: - parent_service: - # The value of the filter compared to the target trace or span field. - value: - # Values the filter tests against when using 'IN' or 'NOT_IN' match type. - in_values: - - - match: - service: - # The value of the filter compared to the target trace or span field. - value: - # Values the filter tests against when using 'IN' or 'NOT_IN' match type. - in_values: - - - match: - span_count: - # Minimum number of spans that must match a span query, inclusive. - min: - # Maximum number of spans that must match a span query, inclusive. - max: - scope_filter: - # Specifies the span filters that define which spans contribute to the metrics calculation. - # Only spans matching these filters will be included in the metrics aggregation. - span_scopes: - - # Matches the tags of the candidate span. - tags: - - # The key or name of the span tag that this filter inspects. - key: - numeric_value: - # The filter value used in comparison against match candidates. - value: - comparison: - value: - # The value of the filter compared to the target trace or span field. - value: - # Values the filter tests against when using 'IN' or 'NOT_IN' match type. - in_values: - - - match: - duration: - # Minimum duration, in seconds, required for a span or trace to match. - min_secs: - # Maximum duration, in seconds, required for a span or trace to match. - max_secs: - error: - # The value of the filter compared to the target trace or span field. - value: - is_root_span: - # The value of the filter compared to the target trace or span field. - value: - match_type: - operation: - # The value of the filter compared to the target trace or span field. - value: - # Values the filter tests against when using 'IN' or 'NOT_IN' match type. - in_values: - - - match: - parent_operation: - # The value of the filter compared to the target trace or span field. - value: - # Values the filter tests against when using 'IN' or 'NOT_IN' match type. - in_values: - - - match: - parent_service: - # The value of the filter compared to the target trace or span field. - value: - # Values the filter tests against when using 'IN' or 'NOT_IN' match type. - in_values: - - - match: - service: - # The value of the filter compared to the target trace or span field. - value: - # Values the filter tests against when using 'IN' or 'NOT_IN' match type. - in_values: - - - match: - span_count: - # Minimum number of spans that must match a span query, inclusive. - min: - # Maximum number of spans that must match a span query, inclusive. - max: - trace: - duration: - # Minimum duration, in seconds, required for a span or trace to match. - min_secs: - # Maximum duration, in seconds, required for a span or trace to match. - max_secs: - error: - # The value of the filter compared to the target trace or span field. - value: + duration: + # Minimum duration, in seconds, required for a span or trace to match. + min_secs: + # Maximum duration, in seconds, required for a span or trace to match. + max_secs: + error: + # The value of the filter compared to the target trace or span field. + value: + is_root_span: + # The value of the filter compared to the target trace or span field. + value: + operation: + # The value of the filter compared to the target trace or span field. + value: + # Values the filter tests against when using 'IN' or 'NOT_IN' match type. + in_values: + - + match: + parent_operation: + # The value of the filter compared to the target trace or span field. + value: + # Values the filter tests against when using 'IN' or 'NOT_IN' match type. + in_values: + - + match: + parent_service: + # The value of the filter compared to the target trace or span field. + value: + # Values the filter tests against when using 'IN' or 'NOT_IN' match type. + in_values: + - + match: + service: + # The value of the filter compared to the target trace or span field. + value: + # Values the filter tests against when using 'IN' or 'NOT_IN' match type. + in_values: + - + match: + log_filter: + # Returns logs that match this query. The query can include only top-level + # operations. Nested clauses aren't supported. Only one type of 'AND' or 'OR' + # operator is allowed. + query: operator: # Optional. Child partitions of this partition. If set, requests that match the # current partition are allocated to the first child partition that matches. diff --git a/src/generated/cli/configv1/trace_metrics_rules.gen.go b/src/generated/cli/configv1/trace_metrics_rules.gen.go index 081c6e0..89895c1 100644 --- a/src/generated/cli/configv1/trace_metrics_rules.gen.go +++ b/src/generated/cli/configv1/trace_metrics_rules.gen.go @@ -519,7 +519,11 @@ spec: # - SERVICE: The service to group by. # - OPERATION: The operation to group by. # - TAG: The span tag to group by. - type: + # - PARENT_SERVICE: The parent service to group by. + # - PARENT_OPERATION: The parent operation to group by. + # - ROOT_SERVICE: The root service to group by. + # - ROOT_OPERATION: The root operation to group by. + type: scope_filter: # Specifies the span filters that define which spans contribute to the metrics calculation. # Only spans matching these filters will be included in the metrics aggregation. diff --git a/src/generated/swagger/configv1/models/configv1_consumption_budget_threshold.go b/src/generated/swagger/configv1/models/configv1_consumption_budget_threshold.go index 6202833..57f0a55 100644 --- a/src/generated/swagger/configv1/models/configv1_consumption_budget_threshold.go +++ b/src/generated/swagger/configv1/models/configv1_consumption_budget_threshold.go @@ -30,9 +30,6 @@ type Configv1ConsumptionBudgetThreshold struct { // volume Volume *ThresholdVolume `json:"volume,omitempty"` - // sku group - SkuGroup ConsumptionBudgetResourceGroup `json:"sku_group,omitempty"` - // unit Unit ConsumptionBudgetUnit `json:"unit,omitempty"` @@ -60,10 +57,6 @@ func (m *Configv1ConsumptionBudgetThreshold) Validate(formats strfmt.Registry) e res = append(res, err) } - if err := m.validateSkuGroup(formats); err != nil { - res = append(res, err) - } - if err := m.validateUnit(formats); err != nil { res = append(res, err) } @@ -150,23 +143,6 @@ func (m *Configv1ConsumptionBudgetThreshold) validateVolume(formats strfmt.Regis return nil } -func (m *Configv1ConsumptionBudgetThreshold) validateSkuGroup(formats strfmt.Registry) error { - if swag.IsZero(m.SkuGroup) { // not required - return nil - } - - if err := m.SkuGroup.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sku_group") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sku_group") - } - return err - } - - return nil -} - func (m *Configv1ConsumptionBudgetThreshold) validateUnit(formats strfmt.Registry) error { if swag.IsZero(m.Unit) { // not required return nil @@ -221,10 +197,6 @@ func (m *Configv1ConsumptionBudgetThreshold) ContextValidate(ctx context.Context res = append(res, err) } - if err := m.contextValidateSkuGroup(ctx, formats); err != nil { - res = append(res, err) - } - if err := m.contextValidateUnit(ctx, formats); err != nil { res = append(res, err) } @@ -317,24 +289,6 @@ func (m *Configv1ConsumptionBudgetThreshold) contextValidateVolume(ctx context.C return nil } -func (m *Configv1ConsumptionBudgetThreshold) contextValidateSkuGroup(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.SkuGroup) { // not required - return nil - } - - if err := m.SkuGroup.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sku_group") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sku_group") - } - return err - } - - return nil -} - func (m *Configv1ConsumptionBudgetThreshold) contextValidateUnit(ctx context.Context, formats strfmt.Registry) error { if swag.IsZero(m.Unit) { // not required diff --git a/src/generated/swagger/configv1/models/configv1_consumption_span_filter.go b/src/generated/swagger/configv1/models/configv1_consumption_span_filter.go new file mode 100644 index 0000000..824c510 --- /dev/null +++ b/src/generated/swagger/configv1/models/configv1_consumption_span_filter.go @@ -0,0 +1,480 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package models + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Configv1ConsumptionSpanFilter configv1 consumption span filter +// +// swagger:model configv1ConsumptionSpanFilter +type Configv1ConsumptionSpanFilter struct { + + // service + Service *TraceSearchFilterStringFilter `json:"service,omitempty"` + + // operation + Operation *TraceSearchFilterStringFilter `json:"operation,omitempty"` + + // parent service + ParentService *TraceSearchFilterStringFilter `json:"parent_service,omitempty"` + + // parent operation + ParentOperation *TraceSearchFilterStringFilter `json:"parent_operation,omitempty"` + + // duration + Duration *TraceSearchFilterDurationFilter `json:"duration,omitempty"` + + // error + Error *TraceSearchFilterBoolFilter `json:"error,omitempty"` + + // Matches the tags of the candidate span. A numeric matcher also + // compares numeric-looking string tag values. To match alternatives, + // use separate conditions. + Tags []*TraceSearchFilterTagFilter `json:"tags"` + + // is root span + IsRootSpan *TraceSearchFilterBoolFilter `json:"is_root_span,omitempty"` +} + +// Validate validates this configv1 consumption span filter +func (m *Configv1ConsumptionSpanFilter) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateService(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOperation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParentService(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParentOperation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDuration(formats); err != nil { + res = append(res, err) + } + + if err := m.validateError(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTags(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIsRootSpan(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Configv1ConsumptionSpanFilter) validateService(formats strfmt.Registry) error { + if swag.IsZero(m.Service) { // not required + return nil + } + + if m.Service != nil { + if err := m.Service.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service") + } + return err + } + } + + return nil +} + +func (m *Configv1ConsumptionSpanFilter) validateOperation(formats strfmt.Registry) error { + if swag.IsZero(m.Operation) { // not required + return nil + } + + if m.Operation != nil { + if err := m.Operation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("operation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("operation") + } + return err + } + } + + return nil +} + +func (m *Configv1ConsumptionSpanFilter) validateParentService(formats strfmt.Registry) error { + if swag.IsZero(m.ParentService) { // not required + return nil + } + + if m.ParentService != nil { + if err := m.ParentService.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent_service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parent_service") + } + return err + } + } + + return nil +} + +func (m *Configv1ConsumptionSpanFilter) validateParentOperation(formats strfmt.Registry) error { + if swag.IsZero(m.ParentOperation) { // not required + return nil + } + + if m.ParentOperation != nil { + if err := m.ParentOperation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent_operation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parent_operation") + } + return err + } + } + + return nil +} + +func (m *Configv1ConsumptionSpanFilter) validateDuration(formats strfmt.Registry) error { + if swag.IsZero(m.Duration) { // not required + return nil + } + + if m.Duration != nil { + if err := m.Duration.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("duration") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("duration") + } + return err + } + } + + return nil +} + +func (m *Configv1ConsumptionSpanFilter) validateError(formats strfmt.Registry) error { + if swag.IsZero(m.Error) { // not required + return nil + } + + if m.Error != nil { + if err := m.Error.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("error") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("error") + } + return err + } + } + + return nil +} + +func (m *Configv1ConsumptionSpanFilter) validateTags(formats strfmt.Registry) error { + if swag.IsZero(m.Tags) { // not required + return nil + } + + for i := 0; i < len(m.Tags); i++ { + if swag.IsZero(m.Tags[i]) { // not required + continue + } + + if m.Tags[i] != nil { + if err := m.Tags[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Configv1ConsumptionSpanFilter) validateIsRootSpan(formats strfmt.Registry) error { + if swag.IsZero(m.IsRootSpan) { // not required + return nil + } + + if m.IsRootSpan != nil { + if err := m.IsRootSpan.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("is_root_span") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("is_root_span") + } + return err + } + } + + return nil +} + +// ContextValidate validate this configv1 consumption span filter based on the context it is used +func (m *Configv1ConsumptionSpanFilter) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateService(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOperation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateParentService(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateParentOperation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDuration(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateError(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTags(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIsRootSpan(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Configv1ConsumptionSpanFilter) contextValidateService(ctx context.Context, formats strfmt.Registry) error { + + if m.Service != nil { + + if swag.IsZero(m.Service) { // not required + return nil + } + + if err := m.Service.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service") + } + return err + } + } + + return nil +} + +func (m *Configv1ConsumptionSpanFilter) contextValidateOperation(ctx context.Context, formats strfmt.Registry) error { + + if m.Operation != nil { + + if swag.IsZero(m.Operation) { // not required + return nil + } + + if err := m.Operation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("operation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("operation") + } + return err + } + } + + return nil +} + +func (m *Configv1ConsumptionSpanFilter) contextValidateParentService(ctx context.Context, formats strfmt.Registry) error { + + if m.ParentService != nil { + + if swag.IsZero(m.ParentService) { // not required + return nil + } + + if err := m.ParentService.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent_service") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parent_service") + } + return err + } + } + + return nil +} + +func (m *Configv1ConsumptionSpanFilter) contextValidateParentOperation(ctx context.Context, formats strfmt.Registry) error { + + if m.ParentOperation != nil { + + if swag.IsZero(m.ParentOperation) { // not required + return nil + } + + if err := m.ParentOperation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("parent_operation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("parent_operation") + } + return err + } + } + + return nil +} + +func (m *Configv1ConsumptionSpanFilter) contextValidateDuration(ctx context.Context, formats strfmt.Registry) error { + + if m.Duration != nil { + + if swag.IsZero(m.Duration) { // not required + return nil + } + + if err := m.Duration.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("duration") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("duration") + } + return err + } + } + + return nil +} + +func (m *Configv1ConsumptionSpanFilter) contextValidateError(ctx context.Context, formats strfmt.Registry) error { + + if m.Error != nil { + + if swag.IsZero(m.Error) { // not required + return nil + } + + if err := m.Error.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("error") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("error") + } + return err + } + } + + return nil +} + +func (m *Configv1ConsumptionSpanFilter) contextValidateTags(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Tags); i++ { + + if m.Tags[i] != nil { + + if swag.IsZero(m.Tags[i]) { // not required + return nil + } + + if err := m.Tags[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tags" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tags" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *Configv1ConsumptionSpanFilter) contextValidateIsRootSpan(ctx context.Context, formats strfmt.Registry) error { + + if m.IsRootSpan != nil { + + if swag.IsZero(m.IsRootSpan) { // not required + return nil + } + + if err := m.IsRootSpan.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("is_root_span") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("is_root_span") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Configv1ConsumptionSpanFilter) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Configv1ConsumptionSpanFilter) UnmarshalBinary(b []byte) error { + var res Configv1ConsumptionSpanFilter + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/src/generated/swagger/configv1/models/group_by_key_group_by_key_type.go b/src/generated/swagger/configv1/models/group_by_key_group_by_key_type.go index fb69087..622b669 100644 --- a/src/generated/swagger/configv1/models/group_by_key_group_by_key_type.go +++ b/src/generated/swagger/configv1/models/group_by_key_group_by_key_type.go @@ -17,6 +17,10 @@ import ( // GroupByKeyGroupByKeyType - SERVICE: The service to group by. // - OPERATION: The operation to group by. // - TAG: The span tag to group by. +// - PARENT_SERVICE: The parent service to group by. +// - PARENT_OPERATION: The parent operation to group by. +// - ROOT_SERVICE: The root service to group by. +// - ROOT_OPERATION: The root operation to group by. // // swagger:model GroupByKeyGroupByKeyType type GroupByKeyGroupByKeyType string @@ -40,6 +44,18 @@ const ( // GroupByKeyGroupByKeyTypeTAG captures enum value "TAG" GroupByKeyGroupByKeyTypeTAG GroupByKeyGroupByKeyType = "TAG" + + // GroupByKeyGroupByKeyTypePARENTSERVICE captures enum value "PARENT_SERVICE" + GroupByKeyGroupByKeyTypePARENTSERVICE GroupByKeyGroupByKeyType = "PARENT_SERVICE" + + // GroupByKeyGroupByKeyTypePARENTOPERATION captures enum value "PARENT_OPERATION" + GroupByKeyGroupByKeyTypePARENTOPERATION GroupByKeyGroupByKeyType = "PARENT_OPERATION" + + // GroupByKeyGroupByKeyTypeROOTSERVICE captures enum value "ROOT_SERVICE" + GroupByKeyGroupByKeyTypeROOTSERVICE GroupByKeyGroupByKeyType = "ROOT_SERVICE" + + // GroupByKeyGroupByKeyTypeROOTOPERATION captures enum value "ROOT_OPERATION" + GroupByKeyGroupByKeyTypeROOTOPERATION GroupByKeyGroupByKeyType = "ROOT_OPERATION" ) // for schema @@ -47,7 +63,7 @@ var groupByKeyGroupByKeyTypeEnum []interface{} func init() { var res []GroupByKeyGroupByKeyType - if err := json.Unmarshal([]byte(`["SERVICE","OPERATION","TAG"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["SERVICE","OPERATION","TAG","PARENT_SERVICE","PARENT_OPERATION","ROOT_SERVICE","ROOT_OPERATION"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/src/generated/swagger/configv1/models/partition_filter_condition.go b/src/generated/swagger/configv1/models/partition_filter_condition.go index 4823e6c..1e403ef 100644 --- a/src/generated/swagger/configv1/models/partition_filter_condition.go +++ b/src/generated/swagger/configv1/models/partition_filter_condition.go @@ -19,7 +19,7 @@ import ( // swagger:model PartitionFilterCondition type PartitionFilterCondition struct { - // Deprecated. Use `log_filter`, `metric_filters`, or `trace_filter` instead. + // Deprecated. Use `log_filter`, `metric_filters`, or `trace_span_filters` instead. DatasetSlug string `json:"dataset_slug,omitempty"` // log filter @@ -31,11 +31,16 @@ type PartitionFilterCondition struct { // including matching multiple patterns with an `OR`, such as // `service:{svc1,svc2}`. // - // Exactly one of `log_filter`, `metric_filters`, or `trace_filter` must be set. + // Exactly one of `log_filter`, `metric_filters`, or `trace_span_filters` must be set. MetricFilters []*Configv1LabelFilter `json:"metric_filters"` - // trace filter - TraceFilter *Configv1TraceSearchFilter `json:"trace_filter,omitempty"` + // If set, matches incoming trace data at the span level: a span + // matches the condition only if it satisfies every span filter. + // Match alternatives with an `IN` string filter or with separate + // conditions. + // + // Exactly one of `log_filter`, `metric_filters`, or `trace_span_filters` must be set. + TraceSpanFilters []*Configv1ConsumptionSpanFilter `json:"trace_span_filters"` } // Validate validates this partition filter condition @@ -50,7 +55,7 @@ func (m *PartitionFilterCondition) Validate(formats strfmt.Registry) error { res = append(res, err) } - if err := m.validateTraceFilter(formats); err != nil { + if err := m.validateTraceSpanFilters(formats); err != nil { res = append(res, err) } @@ -105,20 +110,27 @@ func (m *PartitionFilterCondition) validateMetricFilters(formats strfmt.Registry return nil } -func (m *PartitionFilterCondition) validateTraceFilter(formats strfmt.Registry) error { - if swag.IsZero(m.TraceFilter) { // not required +func (m *PartitionFilterCondition) validateTraceSpanFilters(formats strfmt.Registry) error { + if swag.IsZero(m.TraceSpanFilters) { // not required return nil } - if m.TraceFilter != nil { - if err := m.TraceFilter.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("trace_filter") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("trace_filter") + for i := 0; i < len(m.TraceSpanFilters); i++ { + if swag.IsZero(m.TraceSpanFilters[i]) { // not required + continue + } + + if m.TraceSpanFilters[i] != nil { + if err := m.TraceSpanFilters[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("trace_span_filters" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("trace_span_filters" + "." + strconv.Itoa(i)) + } + return err } - return err } + } return nil @@ -136,7 +148,7 @@ func (m *PartitionFilterCondition) ContextValidate(ctx context.Context, formats res = append(res, err) } - if err := m.contextValidateTraceFilter(ctx, formats); err != nil { + if err := m.contextValidateTraceSpanFilters(ctx, formats); err != nil { res = append(res, err) } @@ -192,22 +204,26 @@ func (m *PartitionFilterCondition) contextValidateMetricFilters(ctx context.Cont return nil } -func (m *PartitionFilterCondition) contextValidateTraceFilter(ctx context.Context, formats strfmt.Registry) error { +func (m *PartitionFilterCondition) contextValidateTraceSpanFilters(ctx context.Context, formats strfmt.Registry) error { - if m.TraceFilter != nil { + for i := 0; i < len(m.TraceSpanFilters); i++ { - if swag.IsZero(m.TraceFilter) { // not required - return nil - } + if m.TraceSpanFilters[i] != nil { - if err := m.TraceFilter.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("trace_filter") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("trace_filter") + if swag.IsZero(m.TraceSpanFilters[i]) { // not required + return nil + } + + if err := m.TraceSpanFilters[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("trace_span_filters" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("trace_span_filters" + "." + strconv.Itoa(i)) + } + return err } - return err } + } return nil diff --git a/src/generated/swagger/configv1/spec.json b/src/generated/swagger/configv1/spec.json index fc027b1..2318584 100644 --- a/src/generated/swagger/configv1/spec.json +++ b/src/generated/swagger/configv1/spec.json @@ -1144,11 +1144,15 @@ "type": "object" }, "GroupByKeyGroupByKeyType": { - "description": " - SERVICE: The service to group by.\n - OPERATION: The operation to group by.\n - TAG: The span tag to group by.", + "description": " - SERVICE: The service to group by.\n - OPERATION: The operation to group by.\n - TAG: The span tag to group by.\n - PARENT_SERVICE: The parent service to group by.\n - PARENT_OPERATION: The parent operation to group by.\n - ROOT_SERVICE: The root service to group by.\n - ROOT_OPERATION: The root operation to group by.", "enum": [ "SERVICE", "OPERATION", - "TAG" + "TAG", + "PARENT_SERVICE", + "PARENT_OPERATION", + "ROOT_SERVICE", + "ROOT_OPERATION" ], "type": "string" }, @@ -2080,21 +2084,25 @@ "PartitionFilterCondition": { "properties": { "dataset_slug": { - "description": "Deprecated. Use `log_filter`, `metric_filters`, or `trace_filter` instead.", + "description": "Deprecated. Use `log_filter`, `metric_filters`, or `trace_span_filters` instead.", "type": "string" }, "log_filter": { "$ref": "#/definitions/configv1LogSearchFilter" }, "metric_filters": { - "description": "If set, matches incoming metric data by label. If multiple label\nfilters are specified, an incoming metric must match every label\nfilter to match the condition. Label values support glob patterns,\nincluding matching multiple patterns with an `OR`, such as\n`service:{svc1,svc2}`.\n\nExactly one of `log_filter`, `metric_filters`, or `trace_filter` must be set.", + "description": "If set, matches incoming metric data by label. If multiple label\nfilters are specified, an incoming metric must match every label\nfilter to match the condition. Label values support glob patterns,\nincluding matching multiple patterns with an `OR`, such as\n`service:{svc1,svc2}`.\n\nExactly one of `log_filter`, `metric_filters`, or `trace_span_filters` must be set.", "items": { "$ref": "#/definitions/configv1LabelFilter" }, "type": "array" }, - "trace_filter": { - "$ref": "#/definitions/configv1TraceSearchFilter" + "trace_span_filters": { + "description": "If set, matches incoming trace data at the span level: a span\nmatches the condition only if it satisfies every span filter.\nMatch alternatives with an `IN` string filter or with separate\nconditions.\n\nExactly one of `log_filter`, `metric_filters`, or `trace_span_filters` must be set.", + "items": { + "$ref": "#/definitions/configv1ConsumptionSpanFilter" + }, + "type": "array" } }, "type": "object" @@ -3338,9 +3346,6 @@ "volume": { "$ref": "#/definitions/ThresholdVolume" }, - "sku_group": { - "$ref": "#/definitions/ConsumptionBudgetResourceGroup" - }, "unit": { "$ref": "#/definitions/ConsumptionBudgetUnit" }, @@ -3374,6 +3379,39 @@ }, "type": "object" }, + "configv1ConsumptionSpanFilter": { + "properties": { + "service": { + "$ref": "#/definitions/TraceSearchFilterStringFilter" + }, + "operation": { + "$ref": "#/definitions/TraceSearchFilterStringFilter" + }, + "parent_service": { + "$ref": "#/definitions/TraceSearchFilterStringFilter" + }, + "parent_operation": { + "$ref": "#/definitions/TraceSearchFilterStringFilter" + }, + "duration": { + "$ref": "#/definitions/TraceSearchFilterDurationFilter" + }, + "error": { + "$ref": "#/definitions/TraceSearchFilterBoolFilter" + }, + "tags": { + "description": "Matches the tags of the candidate span. A numeric matcher also\ncompares numeric-looking string tag values. To match alternatives,\nuse separate conditions.", + "items": { + "$ref": "#/definitions/TraceSearchFilterTagFilter" + }, + "type": "array" + }, + "is_root_span": { + "$ref": "#/definitions/TraceSearchFilterBoolFilter" + } + }, + "type": "object" + }, "configv1CreateAzureMetricsIntegrationRequest": { "properties": { "azure_metrics_integration": {