question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't assign a variable to the Metric field

See original GitHub issue

Hi @simPod,

I think I bumped into the issue in v0.2.4, a fresh version (also in v0.2.3).

The metric value, which I want to assign to the variable (e.g. $project) once typed in, gets evaluated, disappears and then the empty value (“”) being passed to the subsequent API. The variable is resolved and the first request actually returns the result, but then it’s superseded by the empty string almost immediately.

metric

I was able to apply the workaround, by manually passing $project to the JSON and saving it via Query Inspector. This works well, unless someone opens panel settings. It then gets reevaluated immediately to empty string again.

I’ll probably handle empty string case differently for now (currently it’s a valid target, so it returns all the results and it’s quite a large dataset) to avoid issues.

But overall it be great if the created value for the metric would be stored in the field. I’m happy to provide any info, also can look into the issue myself. Just wanted to share the info.

Gif attached. Grafana version: v7.4.3

Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:23 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
burningalchemistcommented, Apr 4, 2021

Hey @simPod, just a quick update from my side: I’ve managed to fix the issue I had. Still there is a small thing to improve before submitting it as a PR. 😃👍

1reaction
youngdoucommented, May 8, 2021

@burningalchemist Thanks a lot! The workaround works well for us. Looking forward for your PR. 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Assign values to metric variables - SAP Signavio Documentation
Manually assign variable values to a single metric​​ Follow these steps: Open your process and in the sidebar, click Metrics.
Read more >
Cannot assign to struct field in a map - Stack Overflow
For those looking for a simpler example: This is wrong: type myStruct struct{ Field int } func main() { myMap := map[string]myStruct{ "key":{...
Read more >
Add and manage variables | Grafana documentation
Add a query variable. Query variables enable you to write a data source query that can return a list of metric names, tag...
Read more >
SPSS Tutorials: Defining Variables - LibGuides
This tutorial shows how to define variable properties in SPSS, especially custom missing values and value labels for categorical variables.
Read more >
Create a Metric Definition Based on RITM Variable?
I can't find much on this, but I'm wondering if it's at all possible to create a metric definition based on a specific...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found