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

Error saving existing metrics in UI #532

Closed
ondar opened this issue Aug 28, 2024 Discussed in #530 · 5 comments · Fixed by #534
Closed

Error saving existing metrics in UI #532

ondar opened this issue Aug 28, 2024 Discussed in #530 · 5 comments · Fixed by #534
Assignees
Labels
bug Something isn't working webui Admin UI related issues

Comments

@ondar
Copy link
Contributor

ondar commented Aug 28, 2024

Discussed in #530

Originally posted by ondar August 27, 2024

Error "ERROR: malformed array literal: "["is_failing_int","seconds_since_last_failure"]" (SQLSTATE 22P02)" saving existing metrics "archiver". So it seems it have something to do with saving the field "Gauges" in tab "SETTINGS".

@cybertec-postgresql cybertec-postgresql deleted a comment Aug 28, 2024
@pashagolub pashagolub added bug Something isn't working webui Admin UI related issues labels Aug 28, 2024
@ondar
Copy link
Contributor Author

ondar commented Aug 28, 2024

I see in DB that field have value of "{is_failing_int,seconds_since_last_failure}" but save payload sends value "Gauges":["is_failing_int","seconds_since_last_failure"]. So maybe its only wrong type of parenthesis?

@ondar
Copy link
Contributor Author

ondar commented Aug 28, 2024

@pashagolub seems to be backend error after all. This is error I got from backend log. Seems it updates column of type[] with value in [] and not in {}:

2024-08-28 12:10:12.292 [ERROR] [sql:UPDATE pgwatch.metric SET 
2024-08-28T12:10:12.293087984Z 	sqls = $2, init_sql = $3, description = $4, node_status = $5, gauges = $6, is_instance_level = $7, storage_name = $8
2024-08-28T12:10:12.293091130Z 	WHERE name = $1] [args:[archiver {"11":"select /* pgwatch_generated */\n  (extract(epoch from now (truncated 406 bytes)    ["is_failing_int","seconds_since_last_failure"] true ]] [err:ERROR: malformed array literal: "["is_failing_int","seconds_since_last_failure"]" (SQLSTATE 22P02)] [pid:19617] [time:788.58µs] Query

@ondar
Copy link
Contributor Author

ondar commented Aug 28, 2024

Found it in internal/metrics/postgres.go method UpdateMetric, but I have no idea how to marshal that metric.Gauges array better so it is actually saved.

@pashagolub
Copy link
Collaborator

Would you please provide steps to reproduce the issue? I'm kinda lost in discussion. Is this a prometheus related, right?

@ondar
Copy link
Contributor Author

ondar commented Aug 29, 2024

No, its again UI related. Navigate to metrics tab, press edit on metric named "archiver" and press button "Update". Will be probably the same on any metric that have something in field "Gauges".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working webui Admin UI related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants