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 aliasQuery function #5

Closed
carrieedwards opened this issue Jun 9, 2022 · 1 comment · Fixed by #148
Closed

Add support for Graphite web aliasQuery function #5

carrieedwards opened this issue Jun 9, 2022 · 1 comment · Fixed by #148
Labels
enhancement New feature or request

Comments

@carrieedwards
Copy link
Collaborator

carrieedwards commented Jun 9, 2022

Is your feature request related to a problem? Please describe.
The aliasQuery() function is implemented in Graphite web, but is missing from CarbonAPI. In order to enable users to be able to use the aliasQuery() function, it needs to be implemented in CarbonAPI.

Describe the solution you'd like
The aliasQuery() function should be implemented in CarbonAPI, with the same functionality as the Graphite web function. The description of the function is as follows:

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.

Additional context
Tests should be added to verify that the functionality matches that of the Graphite web aliasQuery() function.

@carrieedwards carrieedwards added the enhancement New feature or request label Jun 9, 2022
@carrieedwards carrieedwards changed the title Add support for Graphite web's aliasQuery() function Add support for Graphite web's aliasQuery function Jun 13, 2022
@carrieedwards carrieedwards changed the title Add support for Graphite web's aliasQuery function Add support for Graphite web aliasQuery function Jun 13, 2022
@npazosmendez
Copy link

Some details: 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, which is something we can't do with our current code structure. Similar to applyByNode

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

Successfully merging a pull request may close this issue.

2 participants