cdk-monitoring-constructs
cdk-monitoring-constructs copied to clipboard
[core] Support query metrics
Currently MetricsFactory has createMetricMath, createMetricSearch, createMetricAnomaly. It doesn't have createMetricQuery.
Why I need this?
I have metric with dimension: [Program, Operation, EntityType, StatusFamily, StatusCode]
Now to compute availability metrics, it will be 1- count(fault_request)/count(valid_request)
success_request: StatusFamily=SUCCESSFUL fault_request: StatusFamily=SERVER_ERROR error_request: StatusFamily=CLIENT_ERROR
Now, in each family there can be multiple statusCode. This can be better done using query metrics.
Let me please clarify. So there would be a new method, taking a string query as an input, and returning an IMetric object to be used in metric math, like this?
The original requester had requested it a while back, but they were likely referring to Metric Insights, which are usable with MathExpression
s.
It might be possible that you can just pass a query to createMetricMath
and have it work, but would need to be confirmed.