-
Notifications
You must be signed in to change notification settings - Fork 109
Fix metric_custom_indicator
's good
and total
metrics array
#545
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
Fix metric_custom_indicator
's good
and total
metrics array
#545
Conversation
@@ -541,6 +542,17 @@ func getSloFromResourceData(d *schema.ResourceData) (models.Slo, diag.Diagnostic | |||
} | |||
|
|||
case "metric_custom_indicator": | |||
goodMetricsRaw := d.Get(indicatorType + ".0.good.0.metrics").([]interface{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reverts commit ef01b30.
@wandergeek are you able to take a look over this one? |
indicator = slo.SloResponseIndicator{ | ||
IndicatorPropertiesCustomMetric: &slo.IndicatorPropertiesCustomMetric{ | ||
Type: indicatorAddressToType[indicatorType], | ||
Params: slo.IndicatorPropertiesCustomMetricParams{ | ||
Filter: getOrNilString(indicatorType+".0.filter", d), | ||
Index: d.Get(indicatorType + ".0.index").(string), | ||
TimestampField: d.Get(indicatorType + ".0.timestamp_field").(string), | ||
Total: slo.IndicatorPropertiesCustomMetricParamsTotal{ | ||
Equation: d.Get(indicatorType + ".0.total.0.equation").(string), | ||
Metrics: []slo.IndicatorPropertiesCustomMetricParamsTotalMetricsInner{ //are there actually instances where there are more than one 'good' / 'total'? Need to build array if so. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes there are 😄
metric_custom_indicator
's good metrics arraymetric_custom_indicator
's good
and total
metrics array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, man! Thanks for the contribution.
Ensure that the all metrics specified in the array are applied to the SLO resource
Close #544