Skip to content

Formatting of multi-valued variables fails #149

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

Open
otaconix opened this issue May 3, 2025 · 0 comments · May be fixed by #150
Open

Formatting of multi-valued variables fails #149

otaconix opened this issue May 3, 2025 · 0 comments · May be fixed by #150

Comments

@otaconix
Copy link

otaconix commented May 3, 2025

I'm trying to use a query-typed dashboard variable, for which the datasource plugin has a custom formatting function. Unfortunately, the formatting function attempts to find the name of the field the variable is for (in order to be able to construct a query of the form field:value1 OR field:value2 ...), and in doing so, it runs into a runtime error, because it attempts to lookup a field on the variable which is undefined.

Screenshot of the variable definition:

Image

Screenshot of Firefox debugger to show where it goes wrong:

Image

Message in Firefox console:

PanelQueryRunner Error SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
    Ue base.ts:371
    we sceneInterpolator.js:59
    on sceneInterpolator.js:24
    on sceneInterpolator.js:14
    Mc sceneGraph.js:31
    replace template_srv.ts:264
    interpolateLuceneQuery base.ts:312
    applyTemplateVariables base.ts:343
    K DataSourceWithBackend.ts:178
    query DataSourceWithBackend.ts:141
    query base.ts:87
    F runRequest.ts:239
    U runRequest.ts:200
    I runRequest.ts:146
    runWithTimeRangeAndScopes SceneQueryRunner.js:322
    _timeSub SceneQueryRunner.js:261
    subscribeToState SceneObjectBase.js:80
    RxJS 3
    c EventBus.ts:39
    emit index.js:202
    publish EventBus.ts:29
    publishEvent SceneObjectBase.js:166
    setState SceneObjectBase.js:99
    refreshRange SceneTimeRange.js:137
    onRefresh SceneTimeRange.js:62
    onRefresh SceneRefreshPicker.js:43
    onRefresh SceneRefreshPicker.js:169
    React 11
SceneQueryRunner.js:338:14

Extra information

  • Grafana version: v11.6.1 (ae23ead4d9)
  • Quickwit datasource version: 0.4.5
@otaconix otaconix changed the title Formatting of multi-valued variables fail Formatting of multi-valued variables fails May 3, 2025
otaconix pushed a commit to otaconix/quickwit-datasource that referenced this issue May 3, 2025
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 a pull request may close this issue.

1 participant