Skip to content

feature request: add opt-in support for special handling the metric label in time-series queries #205

Open
@eraac

Description

@eraac

summary by @gabor : there is a special behavior in a special situation in postgres. the bigquery datasource does not do this special handling currently. we do not want to change the default behavior in bigquery, but it may be useful to offer this as an opti-in behavior. there are many open questions, like how exactly should it behave (100% mirror of the postgres behavior?), how exactly would you enable it (both in query-editor and in raw-query-editor) etc.
see discussion in grafana/sqlds#109 too.


An image is probably better to explain the problem, but I've switch from the old plugin to this plugin and with the same query I've different result. I don't mind update my queries to reproduce the previous behavior but I'm not sure this is possible

New plugin
image

Old plugin
image

Not the presence of "cost" for the name with the new plugin

My query

SELECT 
  $__timeGroup(usage_start_time, $interval),
  service.description AS metric, 
  sum(cost / currency_conversion_rate) AS cost
FROM 
  `$from_dataset`,
  UNNEST(project.labels)
WHERE 
  $__timeFilter(usage_start_time)
  AND key = "environment" AND value IN ($environment)
GROUP BY 1, 2 
ORDER BY 1, 2

For the new plugin, the behavior can be reproduce via this simple query

SELECT
  CURRENT_TIMESTAMP(),
  "sku" AS metric,
  1 AS cost

I've try to remove the AS cost, but the prefix is now f1_

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions