[GH-ISSUE #222] The Metrics menu isn't displaying after Prometheus integrated #754

Closed
opened 2026-03-15 21:29:00 +03:00 by kerem · 4 comments
Owner

Originally created by @raecoo on GitHub (Mar 17, 2022).
Original GitHub issue: https://github.com/hibiken/asynqmon/issues/222

I’m tried to integrate the Prometheus with asynqmon to monitor our tasks by the following command, the Metrics menu doesn't appear in the sidebar, but I can access using the http://localhost:8080/q/metrics?duration=86400 to access the metrics chart.

./asynqmon -redis-addr="127.0.0.1:6379" -enable-metrics-exporter=true -prometheus-addr=http://127.0.0.1:9090 -redis-db=1

asynqmon-metrics-issue

I read the relevant code of the UI part and found it seems like a bug.
https://github.com/hibiken/asynqmon/blob/master/ui/src/parseFlags.ts#L14

  if (window.FLAG_PROMETHEUS_SERVER_ADDRESS === undefined) {
    console.log(
      "PROMETHEUS_SERVER_ADDRESS is not defined. Falling back to emtpy string"
    );
    window.PROMETHEUS_SERVER_ADDRESS = "";
  } else if (
    window.FLAG_PROMETHEUS_SERVER_ADDRESS.startsWith(goTmplActionPrefix)
  ) {
    console.log(
      "PROMETHEUS_SERVER_ADDRESS was not evaluated by the server. Falling back to empty string"
    );
    window.PROMETHEUS_SERVER_ADDRESS = "";
  } else {
  }

I think it should be assigned in the last else block, otherwise, it won't show.
https://github.com/hibiken/asynqmon/blob/master/ui/src/App.tsx#L244

{window.PROMETHEUS_SERVER_ADDRESS && (
    <ListItemLink
    to={paths.QUEUE_METRICS}
    primary="Metrics"
    icon={<TimelineIcon />}
    />
)}

Please correct me if anything wrong.

Originally created by @raecoo on GitHub (Mar 17, 2022). Original GitHub issue: https://github.com/hibiken/asynqmon/issues/222 I’m tried to integrate the Prometheus with asynqmon to monitor our tasks by the following command, the Metrics menu doesn't appear in the sidebar, but I can access using the `http://localhost:8080/q/metrics?duration=86400` to access the metrics chart. `./asynqmon -redis-addr="127.0.0.1:6379" -enable-metrics-exporter=true -prometheus-addr=http://127.0.0.1:9090 -redis-db=1` <img width="1165" alt="asynqmon-metrics-issue" src="https://user-images.githubusercontent.com/4910/158776579-9658328e-cad3-44dc-9963-8742483ac766.png"> I read the relevant code of the UI part and found it seems like a bug. https://github.com/hibiken/asynqmon/blob/master/ui/src/parseFlags.ts#L14 ``` // PROMETHEUS_SERVER_ADDRESS if (window.FLAG_PROMETHEUS_SERVER_ADDRESS === undefined) { console.log( "PROMETHEUS_SERVER_ADDRESS is not defined. Falling back to emtpy string" ); window.PROMETHEUS_SERVER_ADDRESS = ""; } else if ( window.FLAG_PROMETHEUS_SERVER_ADDRESS.startsWith(goTmplActionPrefix) ) { console.log( "PROMETHEUS_SERVER_ADDRESS was not evaluated by the server. Falling back to empty string" ); window.PROMETHEUS_SERVER_ADDRESS = ""; } else { } ``` I think it should be assigned in the last else block, otherwise, it won't show. https://github.com/hibiken/asynqmon/blob/master/ui/src/App.tsx#L244 ``` {window.PROMETHEUS_SERVER_ADDRESS && ( <ListItemLink to={paths.QUEUE_METRICS} primary="Metrics" icon={<TimelineIcon />} /> )} ``` Please correct me if anything wrong.
kerem closed this issue 2026-03-15 21:29:05 +03:00
Author
Owner

@hibiken commented on GitHub (Mar 17, 2022):

@raecoo Thank you for reporting this!

You are right, I somehow managed to have an empty else block in the committed code 😆
I'll fix this now, and release a new version of the Web UI with the fix!

<!-- gh-comment-id:1070898612 --> @hibiken commented on GitHub (Mar 17, 2022): @raecoo Thank you for reporting this! You are right, I somehow managed to have an empty else block in the committed code 😆 I'll fix this now, and release a new version of the Web UI with the fix!
Author
Owner

@hibiken commented on GitHub (Mar 17, 2022):

Just released a new version v.0.6.1. Please let me know if you are still seeing the issue!

<!-- gh-comment-id:1070917449 --> @hibiken commented on GitHub (Mar 17, 2022): Just released a new version v.0.6.1. Please let me know if you are still seeing the issue!
Author
Owner

@raecoo commented on GitHub (Mar 17, 2022):

Pretty cool, I've tested and the problem resolved.
Thank you for the fast response.

<!-- gh-comment-id:1070926939 --> @raecoo commented on GitHub (Mar 17, 2022): Pretty cool, I've tested and the problem resolved. Thank you for the fast response.
Author
Owner

@piperck commented on GitHub (Mar 17, 2022):

Very helpful thank you. @hibiken

<!-- gh-comment-id:1070932523 --> @piperck commented on GitHub (Mar 17, 2022): Very helpful thank you. @hibiken
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asynqmon#754
No description provided.