ejhayes / bull-monitor

All in one bull monitoring and reporting utility
https://hub.docker.com/r/ejhayes/nodejs-bull-monitor
57 stars 27 forks source link

Queues not detected #130

Closed celianvdb closed 1 year ago

celianvdb commented 1 year ago

Hey ! First, thx for creating this tool !

I'm using since few months bull-dashboard but I was searching an alternative with more features. So on the paper your tool is perfect for my case :) So I started by adding it to my stack in my docker-compose file.

bullmonitor:
    image: ejhayes/nodejs-bull-monitor
    restart: always
    ports:
      - 3003:3000
    environment:
      REDIS_HOST: redis-jobs
      REDIS_PORT: 6379

Here was my config for bullboard :

bullboard:
    image: deadly0/bull-board
    restart: always
    ports:
      - 3004:3000
    environment:
      REDIS_HOST: redis-jobs 

When I start my stack, everything looks fine, the dashboard is starting etc.. but it never detect my queues. ( It tested with bull-master UI, same issue ).

image

If I check on my old bullboard at the same time, the queues are here and I can see the jobs etc...

I only found a tricky method ( maybe more witchcraft ) to make it work. I restart my old bullboard while bull-monitor is running and then my queues are detected by bull-monitor. I don't have enough knowledge in bull to explain why but it works :shrug:

So my question is, how can I fix that ? Did I do something wrong in my configuration ? Here are the logs of bull-monitor.

Thx in advance :) Have a good day !

➜  api git:(dev) ✗ docker logs c0b
OAuth2 Proxy Disabled
{"@timestamp":"2022-11-07T13:27:50","context":"Daemon","label":"bull-monitor","log":{"level":"info"},"message":"Starting bull-monitor process","timestampDiff":""}
{"@timestamp":"2022-11-07T13:27:52","context":"NestFactory","label":"bull-monitor","log":{"level":"info"},"message":"Starting Nest application...","timestampDiff":""}
{"@timestamp":"2022-11-07T13:27:52","context":"InjectorLogger","label":"bull-monitor","log":{"level":"info"},"message":"Nest encountered an undefined dependency. This may be due to a circular import or a missing dependency declaration.","timestampDiff":"+81ms"}
{"@timestamp":"2022-11-07T13:27:52","context":"InjectorLogger","label":"bull-monitor","log":{"level":"info"},"message":"Nest encountered an undefined dependency. This may be due to a circular import or a missing dependency declaration.","timestampDiff":"+16ms"}
{"@timestamp":"2022-11-07T13:27:52","context":"InjectorLogger","label":"bull-monitor","log":{"level":"info"},"message":"Nest encountered an undefined dependency. This may be due to a circular import or a missing dependency declaration.","timestampDiff":"+1ms"}
{"@timestamp":"2022-11-07T13:27:52","context":"InjectorLogger","label":"bull-monitor","log":{"level":"info"},"message":"Nest encountered an undefined dependency. This may be due to a circular import or a missing dependency declaration.","timestampDiff":"+0ms"}
{"@timestamp":"2022-11-07T13:27:52","context":"InjectorLogger","label":"bull-monitor","log":{"level":"info"},"message":"Nest encountered an undefined dependency. This may be due to a circular import or a missing dependency declaration.","timestampDiff":"+1ms"}
{"@timestamp":"2022-11-07T13:27:52","context":"InjectorLogger","label":"bull-monitor","log":{"level":"info"},"message":"Nest encountered an undefined dependency. This may be due to a circular import or a missing dependency declaration.","timestampDiff":"+1ms"}
{"@timestamp":"2022-11-07T13:27:52","context":"InstanceLoader","label":"bull-monitor","log":{"level":"info"},"message":"AppModule dependencies initialized","timestampDiff":"+16ms"}
{"@timestamp":"2022-11-07T13:27:52","context":"InstanceLoader","label":"bull-monitor","log":{"level":"info"},"message":"ConfigModule dependencies initialized","timestampDiff":"+1ms"}
{"@timestamp":"2022-11-07T13:27:52","context":"InstanceLoader","label":"bull-monitor","log":{"level":"info"},"message":"RedisModule dependencies initialized","timestampDiff":"+1ms"}
{"@timestamp":"2022-11-07T13:27:52","context":"InstanceLoader","label":"bull-monitor","log":{"level":"info"},"message":"HealthModule dependencies initialized","timestampDiff":"+2ms"}
{"@timestamp":"2022-11-07T13:27:52","context":"InstanceLoader","label":"bull-monitor","log":{"level":"info"},"message":"DiscoveryModule dependencies initialized","timestampDiff":"+1ms"}
{"@timestamp":"2022-11-07T13:27:52","context":"InstanceLoader","label":"bull-monitor","log":{"level":"info"},"message":"LoggerModule dependencies initialized","timestampDiff":"+12ms"}
{"@timestamp":"2022-11-07T13:27:52","context":"InstanceLoader","label":"bull-monitor","log":{"level":"info"},"message":"VersionModule dependencies initialized","timestampDiff":"+12ms"}
{"@timestamp":"2022-11-07T13:27:52","context":"InstanceLoader","label":"bull-monitor","log":{"level":"info"},"message":"EventEmitterModule dependencies initialized","timestampDiff":"+2ms"}
{"@timestamp":"2022-11-07T13:27:52","context":"InstanceLoader","label":"bull-monitor","log":{"level":"info"},"message":"MetricsModule dependencies initialized","timestampDiff":"+5ms"}
{"@timestamp":"2022-11-07T13:27:52","context":"InstanceLoader","label":"bull-monitor","log":{"level":"info"},"message":"RedisCoreModule dependencies initialized","timestampDiff":"+1ms"}
{"@timestamp":"2022-11-07T13:27:52","context":"InstanceLoader","label":"bull-monitor","log":{"level":"info"},"message":"BullModule dependencies initialized","timestampDiff":"+2ms"}
{"@timestamp":"2022-11-07T13:27:54","context":"bootstrap","label":"bull-monitor","log":{"level":"info"},"message":"Listening on HTTP port 3000","timestampDiff":"+1949ms"}
{"@timestamp":"2022-11-07T13:27:54","context":"RoutesResolver","label":"bull-monitor","log":{"level":"info"},"message":"HealthController {/health}:","timestampDiff":"+6ms"}
{"@timestamp":"2022-11-07T13:27:54","context":"RouterExplorer","label":"bull-monitor","log":{"level":"info"},"message":"Mapped {/health, GET} route","timestampDiff":"+7ms"}
{"@timestamp":"2022-11-07T13:27:54","context":"RoutesResolver","label":"bull-monitor","log":{"level":"info"},"message":"MetricsController {/metrics}:","timestampDiff":"+1ms"}
{"@timestamp":"2022-11-07T13:27:54","context":"RouterExplorer","label":"bull-monitor","log":{"level":"info"},"message":"Mapped {/metrics, GET} route","timestampDiff":"+2ms"}
{"@timestamp":"2022-11-07T13:27:54","context":"RoutesResolver","label":"bull-monitor","log":{"level":"info"},"message":"VersionController {/version}:","timestampDiff":"+1ms"}
{"@timestamp":"2022-11-07T13:27:54","context":"RouterExplorer","label":"bull-monitor","log":{"level":"info"},"message":"Mapped {/version, GET} route","timestampDiff":"+1ms"}
{"@timestamp":"2022-11-07T13:27:54","context":"BullQueuesService","label":"bull-monitor","log":{"level":"info"},"message":"Bootstrapping","timestampDiff":"+5ms"}
{"@timestamp":"2022-11-07T13:27:54","context":"NestApplication","label":"bull-monitor","log":{"level":"info"},"message":"Nest application successfully started","timestampDiff":"+17ms"}
{"@timestamp":"2022-11-07T13:27:54","context":"BullQueuesService","label":"bull-monitor","log":{"level":"info"},"message":"[subscriber] ready","timestampDiff":"+71ms"}
{"@timestamp":"2022-11-07T13:27:54","context":"BullQueuesService","label":"bull-monitor","log":{"level":"info"},"message":"[publish] ready","timestampDiff":"+7ms"}
{"@timestamp":"2022-11-07T13:27:54","context":"BullQueuesService","label":"bull-monitor","log":{"level":"info"},"message":"Subscribed to 1 keyspace event(s) for 'bull'","timestampDiff":"+4ms"}
{"@timestamp":"2022-11-07T13:27:54","context":"BullQueuesService","label":"bull-monitor","log":{"level":"info"},"message":"Registering pmessage listener","timestampDiff":"+0ms"}
{"@timestamp":"2022-11-07T13:27:54","context":"BullQueuesService","label":"bull-monitor","log":{"level":"info"},"message":"Redis connection READY! Configuring watchers for bull queues.","timestampDiff":"+2ms"}
{"@timestamp":"2022-11-07T13:27:54","context":"BullQueuesService","label":"bull-monitor","log":{"level":"info"},"message":"Redis config for notify-keyspace-events: ''","timestampDiff":"+3ms"}
{"@timestamp":"2022-11-07T13:27:54","context":"BullQueuesService","label":"bull-monitor","log":{"level":"info"},"message":"Updating notify-keyspace-events to '$AK'","timestampDiff":"+1ms"}
{"@timestamp":"2022-11-07T13:27:54","context":"BullQueuesService","label":"bull-monitor","log":{"level":"info"},"message":"Loading queues from queuePrefix: 'bull'","timestampDiff":"+0ms"}
{"@timestamp":"2022-11-07T13:27:54","context":"BullQueuesService","label":"bull-monitor","log":{"level":"info"},"message":"Pruning unused queues: <none>","timestampDiff":"+5ms"}
datrinh commented 1 year ago

Facing the same issue. This doesn't seem to run following the installation steps.

ejhayes commented 1 year ago

Hey @celianvdb - this does seem like strange behavior. Can you provide a little more info:

ejhayes commented 1 year ago

@datrinh if you could provide some more details that'd be really helpful (see my questions above for @celianvdb).

celianvdb commented 1 year ago

Hey, Thank you for your answer ! I finally could fix my issue by moving from bull to bullmq. But here is the answers ( before I moved to bullmq of course ) in case it could help to support bull too.

{"@timestamp":"2022-12-03T21:21:55","context":"BullQueuesService","label":"bull-monitor","log":{"level":"info"},"message":"Redis connection READY! Configuring watchers for bull queues.","timestampDiff":"+1ms"}
{"@timestamp":"2022-12-03T21:21:55","context":"BullQueuesService","label":"bull-monitor","log":{"level":"info"},"message":"Redis config for notify-keyspace-events: ''","timestampDiff":"+1ms"}
{"@timestamp":"2022-12-03T21:21:55","context":"BullQueuesService","label":"bull-monitor","log":{"level":"info"},"message":"Updating notify-keyspace-events to '$AK'","timestampDiff":"+0ms"}
{"@timestamp":"2022-12-03T21:21:55","context":"BullQueuesService","label":"bull-monitor","log":{"level":"info"},"message":"Loading queues from queuePrefix: 'bull'","timestampDiff":"+1ms"}
{"@timestamp":"2022-12-03T21:21:55","context":"BullQueuesService","label":"bull-monitor","log":{"level":"info"},"message":"Pruning unused queues: <none>","timestampDiff":"+3ms"}
{"@timestamp":"2022-12-03T21:24:59","context":"BullQueuesService","label":"bull-monitor","log":{"level":"info"},"message":"Adding queue: bull:::payment","timestampDiff":"+0ms"}
{"@timestamp":"2022-12-03T21:24:59","context":"BullUiService","label":"bull-monitor","log":{"level":"info"},"message":"Adding queue to dashboard: payment","timestampDiff":"+5ms"}
{"@timestamp":"2022-12-03T21:24:59","context":"BullMetricsService","label":"bull-monitor","log":{"level":"info"},"message":"Adding queue metrics for bull-payment","timestampDiff":"+0ms"}
{"@timestamp":"2022-12-03T21:24:59","context":"BullQueuesService","label":"bull-monitor","log":{"level":"info"},"message":"Adding queue: bull:::notification","timestampDiff":"+0ms"}
{"@timestamp":"2022-12-03T21:24:59","context":"BullUiService","label":"bull-monitor","log":{"level":"info"},"message":"Adding queue to dashboard: notification","timestampDiff":"+1ms"}
{"@timestamp":"2022-12-03T21:24:59","context":"BullMetricsService","label":"bull-monitor","log":{"level":"info"},"message":"Adding queue metrics for bull-notification","timestampDiff":"+0ms"}
{"@timestamp":"2022-12-03T21:24:59","context":"BullQueuesService","label":"bull-monitor","log":{"level":"info"},"message":"Adding queue: bull:::stripeWebhook","timestampDiff":"+0ms"}
{"@timestamp":"2022-12-03T21:24:59","context":"BullUiService","label":"bull-monitor","log":{"level":"info"},"message":"Adding queue to dashboard: stripeWebhook","timestampDiff":"+0ms"}
{"@timestamp":"2022-12-03T21:24:59","context":"BullMetricsService","label":"bull-monitor","log":{"level":"info"},"message":"Adding queue metrics for bull-stripeWebhook","timestampDiff":"+0ms"}
ejhayes commented 1 year ago

Thanks for the info @celianvdb — yep this only works with bullmq queues. There’s no reason why this couldn’t be expanded to support bull (and bull pro which seems like it might not work either). A PR would be welcome—the code that looks for queues is located here:

https://github.com/ejhayes/bull-monitor/blob/main/src/bull/bull-queues.service.ts#L379

Since this looks to be sorted out now I’m going to go ahead and close this issue.

huyjack178 commented 9 months ago

Hey I run keys bull:*:meta but got empty array. Do you have any idea?

ejhayes commented 9 months ago

Hey @huyjack178 what version bull or bullmq are you using? This utility only supports bullmq

huyjack178 commented 9 months ago

@ejhayes I used https://github.com/nestjs/bull