metricsql | Standalone PromQL and MetricsQL parser | Parser library
kandi X-RAY | metricsql Summary
kandi X-RAY | metricsql Summary
Package metricsql implements MetricsQL and PromQL parser in Go.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- expandWithExpr expands an expression to a BinaryOpExpr .
- simplifyConstants recursively simplifies the constant expressions .
- binaryOpEvalNumber evaluates binary op .
- scanPositiveNumber returns the value of a numeric number .
- getMetricExprForOptimization returns the MetricExpr if possible .
- expandModifierArgs expands args and returns a slice of args .
- removeParensExpr removes all parens from e .
- scanSingleDuration returns the number of milliseconds in s .
- Optimize evaluates an Expr .
- DurationValue parses s as a duration value .
metricsql Key Features
metricsql Examples and Code Snippets
Community Discussions
Trending Discussions on metricsql
QUESTION
I am evaluating VictoriaMetrics for an IoT application where we sometimes have gaps in a series due to hardware or communication issues. In some time series reporting situations it is helpful for us to interpolate values for the missing time intervals. I see that MetricsQL (which extends PromQL) has a keep_last_value()
function that will fill gaps by holding the last observed value until a new one appears (which will be helpful to us) but in some situations a linear interpolation between the values before and after the gap is a more realistic estimate for the missing portion. Is there a function in PromQL or MetricsQL that will do linear interpolation of missing data in a series, or is it possible to construct a more complex query that will achieve this?
Clarifying the desired interpolation
What I would like is a simple interpolation between the points immediately before and after the gap; this is, I believe, what TimescaleDB's interpolate() function does. In other words, if my time series is:
...ANSWER
Answered 2020-Jul-08 at 22:21Final answer
Use the interpolate
function, now available in VictoriaMetrics starting from v1.38.0.
Original suggestion
This does not achieve the exact interpolation requested in the revised question, but may be useful for others with slightly different requirements
Try combining predict_linear function with default
operator from MetricsQL in the following way:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install metricsql
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page