[GH-ISSUE #187] Unable to host dashboard through echo http framework #46

Closed
opened 2026-03-02 05:18:22 +03:00 by kerem · 4 comments
Owner

Originally created by @swagftw on GitHub (Oct 21, 2021).
Original GitHub issue: https://github.com/hibiken/asynqmon/issues/187

I will try to keep it simple and short

  • Using echo http framework
  • Redis is up and running
  • When trying to hit localhost:8080/events/dashboard/ blank page is returned with multiple 404 responses as shown below
    • "/events/dashboard/static/js/2.980b0c32.chunk.js"
    • "/events/dashboard/static/js/main.090c4a40.chunk.js"
    • "/events/dashboard/apple-touch-icon.png"

Check the code below

// events queue 
mon := asynqmon.New(asynqmon.Options{
		RootPath:     "/events/dashboard",
		RedisConnOpt: asynq.RedisClientOpt{Addr: ":6379"},

// registering endpoint
e.GET(mon.RootPath(), func(c echo.Context) error {
		c.Response().Header().Set("Content-Type", "text/html; charset=utf-8")
		c.Response().Header().Set("Transfer-Encoding", "chunked")
		mon.ServeHTTP(c.Response(), c.Request())
		return nil
})

OR

// events queue 
mon := asynqmon.New(asynqmon.Options{
		RootPath:     "/events/dashboard",
		RedisConnOpt: asynq.RedisClientOpt{Addr: ":6379"},

// registering endpoint
e.GET(mon.RootPath(), echo.WrapHandler(mon))
Originally created by @swagftw on GitHub (Oct 21, 2021). Original GitHub issue: https://github.com/hibiken/asynqmon/issues/187 I will try to keep it simple and short - Using echo http framework - Redis is up and running - When trying to hit `localhost:8080/events/dashboard/` blank page is returned with multiple 404 responses as shown below - "/events/dashboard/static/js/2.980b0c32.chunk.js" - "/events/dashboard/static/js/main.090c4a40.chunk.js" - "/events/dashboard/apple-touch-icon.png" **Check the code below** ``` // events queue mon := asynqmon.New(asynqmon.Options{ RootPath: "/events/dashboard", RedisConnOpt: asynq.RedisClientOpt{Addr: ":6379"}, // registering endpoint e.GET(mon.RootPath(), func(c echo.Context) error { c.Response().Header().Set("Content-Type", "text/html; charset=utf-8") c.Response().Header().Set("Transfer-Encoding", "chunked") mon.ServeHTTP(c.Response(), c.Request()) return nil }) ``` OR ``` // events queue mon := asynqmon.New(asynqmon.Options{ RootPath: "/events/dashboard", RedisConnOpt: asynq.RedisClientOpt{Addr: ":6379"}, // registering endpoint e.GET(mon.RootPath(), echo.WrapHandler(mon)) ```
kerem closed this issue 2026-03-02 05:18:22 +03:00
Author
Owner

@hibiken commented on GitHub (Oct 22, 2021):

@swagftw Thank you for opening an issue!

I'm not familiar with the framework but it seems like requests for static assets are not routed to asynqmon.HTTPHandler.
Is there a way to configure router in echo to route all the HTTP request with the path prefix /events/dashboard?

<!-- gh-comment-id:949794573 --> @hibiken commented on GitHub (Oct 22, 2021): @swagftw Thank you for opening an issue! I'm not familiar with the framework but it seems like requests for static assets are not routed to `asynqmon.HTTPHandler`. Is there a way to configure router in echo to route all the HTTP request with the path prefix `/events/dashboard`?
Author
Owner

@zijiwork commented on GitHub (Nov 10, 2021):

Hello, How to integrate dashboards in gin framework

<!-- gh-comment-id:964875580 --> @zijiwork commented on GitHub (Nov 10, 2021): Hello, How to integrate dashboards in gin framework
Author
Owner

@tempor1s commented on GitHub (Dec 14, 2021):

If anyone runs into this same issue, you are able to integrate Echo and Asynqmon with the following code snippet:

e := echo.New()

mon := asynqmon.New(asynqmon.Options{
		RootPath: "/monitoring/tasks",
		RedisConnOpt: asynq.RedisClientOpt{
			Addr: "localhost:6379",
			Password: "",
			DB: 0,
		},
	})

e.Any("/monitoring/tasks/*", echo.WrapHandler(mon))

e.Start(":8080")

You should then be able to navigate to http://localhost:8080/monitoring/tasks/ and view the dashboard.

<!-- gh-comment-id:993250390 --> @tempor1s commented on GitHub (Dec 14, 2021): If anyone runs into this same issue, you are able to integrate Echo and Asynqmon with the following code snippet: ```go e := echo.New() mon := asynqmon.New(asynqmon.Options{ RootPath: "/monitoring/tasks", RedisConnOpt: asynq.RedisClientOpt{ Addr: "localhost:6379", Password: "", DB: 0, }, }) e.Any("/monitoring/tasks/*", echo.WrapHandler(mon)) e.Start(":8080") ``` You should then be able to navigate to `http://localhost:8080/monitoring/tasks/` and view the dashboard.
Author
Owner

@hibiken commented on GitHub (Dec 16, 2021):

Thank you @tempor1s!

<!-- gh-comment-id:995311092 --> @hibiken commented on GitHub (Dec 16, 2021): Thank you @tempor1s!
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#46
No description provided.