Add dashboard variable to control AdHoc filter syntax #1464
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes a regression from #1369 (reported in #1434) by allowing users to configure per-dashboard whether their OTel labels are Map or JSON type. Basically reverting the AdHoc filter changes and making them opt-in.
TL;DR: To "opt in" to JSON AdHoc filters, add
clickhouse_adhoc_use_jsonas a constant variable (thevaluedoesn't matter) to your dashboard.Details
For OTel data, we merge and flatten
ResourceAttributes,LogAttributes, andScopeAttributesinto a singlelabelsfield. Thelabelsfield then has values such asResourceAttributes.host.name.This means for JSON type, we can use the
ResourceAttributes.host.namesyntax directly, while for the Map type we must change the syntax toResourceAttributes['host.name'].Because the above Ad-Hoc filter doesn't specify type, we must add a way to configure this syntax to interpret as JSON or Map. We can't add it at the top level config, since it may be different per dashboard. So instead a user can simply add
clickhouse_adhoc_use_jsonto enable the JSON syntax. If this is not present then it will default to Map.Let me know if you have any thoughts on how we might improve this solution.