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

Add support for Graphite web's aliasQuery() function #6

Closed
wants to merge 3 commits into from

Conversation

carrieedwards
Copy link
Collaborator

@carrieedwards carrieedwards commented Jun 9, 2022

This PR adds support for Graphite web's aliasQuery() function.

The aliasQuery() function is defined as:

aliasQuery(seriesList, search, replace, newName)
Performs a query to alias the metrics in seriesList.

&target=aliasQuery(channel.power.*,"channel\.power\.([0-9]+)","channel.frequency.\1", "Channel %d MHz")
The series in seriesList will be aliased by first translating the series names using the search & replace parameters, then using the last value of the resulting series to construct the alias using sprintf-style syntax.

@CLAassistant
Copy link

CLAassistant commented Jun 16, 2022

CLA assistant check
All committers have signed the CLA.

@npazosmendez
Copy link

I think the expected behavior is a little bit more complex. The documentation is not very clear, but this is the original issue that requested the functionality: graphite-project/graphite-web#1936

If I understand correctly, the search+replace in the metric name results in another query that should be evaluated. Then get that series to construct the printf-like string; that will be the alias for the original series.

This requires evaluating an expression and re-querying the metric store in the middle of the processing.

@npazosmendez
Copy link

Closing this for now as a more complicated approach is needed. We will track this task here #5

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

Successfully merging this pull request may close these issues.

None yet

3 participants