Skip to content
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

Error Unknown key for a VALUE_NUMBER when using EWMA/Holt-Winter with Moving Average #98

Closed
winglot opened this issue Feb 8, 2023 · 0 comments · Fixed by #99
Closed
Assignees

Comments

@winglot
Copy link

winglot commented Feb 8, 2023

When trying to use Moving Average aggregation with EWMA or Holt-Winters model (https://opensearch.org/docs/latest/opensearch/pipeline-agg/#moving_avg), the query fails with:

OpenSearch error: Unknown key for a VALUE_NUMBER in [3]: [alpha].

Tried this on both Grafana 8 and plugin version v1.2.4 and Grafana 9 with plugin v2.0.4, with the same error.

I have tracked down the error and it seems it is caused by using parseInt for alpha/betta/gamma parameters while OpenSearch expects a float.
(https://github.com/grafana/opensearch-datasource/blob/v2.0.5/src/components/QueryEditor/MetricAggregationsEditor/SettingsEditor/MovingAverageSettingsEditor.tsx#L44).
I think that changing the parseInt to parseFloat should fix the problem.

The Elasticsearch plugin works fine with the same query using Moving Average with EWMA as they do not use parseInt when getting the value for alpha/beta/gamma settings (https://github.com/grafana/grafana/blob/v9.3.6/public/app/plugins/datasource/elasticsearch/components/QueryEditor/MetricAggregationsEditor/SettingsEditor/MovingAverageSettingsEditor.tsx#L50).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants