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

define a variable in custom-metrics.toml and pass it in a pl/sql function #375

Open
1 task
d-bhadra2 opened this issue Oct 27, 2023 · 1 comment
Open
1 task
Labels

Comments

@d-bhadra2
Copy link

d-bhadra2 commented Oct 27, 2023

I'm submitting a bug on adding a variable in custom-metrics.toml and passing it into a pl/sql function called from request

  • [ Y] bug report
  • feature request

What is the current behavior?

I can see the only a select query can be called from custom-metrics.toml without passing any variable

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

This code I have added in custom-metrics.toml .If I am providing a hard coded string in the function argument then it is returning
a value in the metrics variable but not working I am passing a variable
[[TABLE]]
TABLENAME = "Product"
[[metric]]
context = "count_of_product"
metricsdesc = {row_count ="total row_count from product tables."}
labels = ["row_count"]
request = "select oraexporter_row_count("${tablename}") as row_count"
metricstype = { row_count = "counter" }

if I am passing variable I am receiving error

level=error msg="Near line 16 (last key parsed 'metric'): expected a top-level item to end with a newline, comment, or EOF, but got '$' instead" source="main.go:525"

What is the expected behavior?

I can define a variable or environment variable in deployment file and pass it into the queries

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

Version: X.Y.Z

@Yannig
Copy link
Collaborator

Yannig commented Nov 22, 2023

You cant use at the same time a field as a metric (here row_count) and as a label. Could you try to remove the labels entry?

@Yannig Yannig added the invalid label Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants