Skip to content

fix(root): remove healthcheck option in docker-compose.yml #7929

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

Merged
merged 2 commits into from
Mar 18, 2025
Merged

Conversation

jainpawan21
Copy link
Member

What changed? Why was the change needed?

closes #7478

  • removes the health check in docker-compose.yml file
  • adds default values for new relic env values
  • updates default value for mongo db pool connections

Screenshots

Expand for optional sections

Related enterprise PR

Special notes for your reviewer

Copy link

netlify bot commented Mar 17, 2025

Deploy Preview for dashboard-v2-novu-staging canceled.

Name Link
🔨 Latest commit 46b4793
🔍 Latest deploy log https://app.netlify.com/sites/dashboard-v2-novu-staging/deploys/67d7b12babe9c30008f9faaf

Copy link
Member

@merrcury merrcury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@merrcury merrcury changed the title fix: remove healthcheck option in docker-compose.yml fix(root): remove healthcheck option in docker-compose.yml Mar 17, 2025
Copy link

netlify bot commented Mar 17, 2025

Deploy Preview for dashboard-v2-novu-staging canceled.

Name Link
🔨 Latest commit 9344ab7
🔍 Latest deploy log https://app.netlify.com/sites/dashboard-v2-novu-staging/deploys/67d7b136fd4e240008af7458

@zettlrobert
Copy link

I just set this up for my current project dev environment and wrote a simple health check that uses a node expression which would integrate without the curl dependency or any additional modification

Should I open an additional PR or make the adjustment here?

@jainpawan21
Copy link
Member Author

I just set this up for my current project dev environment and wrote a simple health check that uses a node expression which would integrate without the curl dependency or any additional modification

Should I open an additional PR or make the adjustment here?

cc: @merrcury

@jainpawan21 jainpawan21 merged commit 088a0dc into next Mar 18, 2025
26 of 28 checks passed
@jainpawan21 jainpawan21 deleted the NV-5160 branch March 18, 2025 00:11
@Aaron-Ritter
Copy link
Contributor

Aaron-Ritter commented Mar 18, 2025

In addition to the comment for the pool size changes.

Why are health checks removed from the configuration?

These have nothing to do with monitoring in the sense of New Relic but more in relationship to container dependency. e.g.

    depends_on:
      mongodb:
        condition: service_healthy
      redis:
        condition: service_healthy

If implemented correctly could even improve this dependency with a health condition https://github.com/novuhq/novu/blob/next/docker%2Fcommunity%2Fdocker-compose.yml#L144-L148

In addition to that the expectation that New Relic is used everywhere is surprising to me, especially in a community config.

I will create a PR on how to properly disable New Relic as not everyone in the community uses or even knows it:

.env.example

# change these values
NEW_RELIC_ENABLED=false
NEW_RELIC_APP_NAME="NEW_RELIC_APP_NAME"
NEW_RELIC_LICENSE_KEY="NEW_RELIC_LICENSE_KEY"

compose.yml sections

      NEW_RELIC_ENABLED: ${NEW_RELIC_ENABLED}
      NEW_RELIC_APP_NAME: ${NEW_RELIC_APP_NAME}
      NEW_RELIC_LICENSE_KEY: ${NEW_RELIC_LICENSE_KEY}

@Aaron-Ritter
Copy link
Contributor

Aaron-Ritter commented Mar 18, 2025

@zettlrobert

I just set this up for my current project dev environment and wrote a simple health check that uses a node expression which would integrate without the curl dependency or any additional modification

Should I open an additional PR or make the adjustment here?

From my side this would be much appreciated and in my opinion a better solution to #7478. @jainpawan21 @merrcury

@Aaron-Ritter
Copy link
Contributor

@jainpawan21 @merrcury I've created a PR and related issue for a better handling of New Relic #7943

@merrcury
Copy link
Member

I just set this up for my current project dev environment and wrote a simple health check that uses a node expression which would integrate without the curl dependency or any additional modification

Should I open an additional PR or make the adjustment here?

Sure, Please go ahead. We'll integrate if we found it useful

@merrcury
Copy link
Member

@jainpawan21 @merrcury I've created a PR and related issue for a better handling of New Relic #7943

That looks like a good idea, Thanks

@zettlrobert
Copy link

zettlrobert commented Mar 18, 2025

I just set this up for my current project dev environment and wrote a simple health check that uses a node expression which would integrate without the curl dependency or any additional modification
Should I open an additional PR or make the adjustment here?

Sure, Please go ahead. We'll integrate if we found it useful

There are in theory multiple ways to go about that.

Proposal One

For reusability and maintainability, I would recommend a healthchecks directory in the docker/community directory which could be bind mounted into the container instance.

This would allow writing any form of js/mjs script and execute it as healthcheck.

Possible issues

After a quick look at the Dockerfile and build stages, I think there will be missing executable permissions on the mounted files.
The simplest solution probably is including a health check script in the image, to be executed in the compose file with already applied permissions...

Edit

Based on the structure, I would place the healthcheck directory in the individual widgets so for example, for the web application in apps/web/healthchecks

Same for the other widgets to keep it modular but it would not strictly be 'DRY'

Proposal Two

Try to make it an onliner, executed via the available node runtime

@Aaron-Ritter
Copy link
Contributor

@zettlrobert In my opinion, healtcheck endpoints (Scripts/Commands) should always be part of the container image. A few good examples which have very stable health endpoints are:

  • redis: redis-cli ping
  • postgres: pg_isready
  • clamav: clamdcheck.sh

@zettlrobert
Copy link

#7953 just a draft of the approach i would take, let me know if I should continue.

@Aaron-Ritter
Copy link
Contributor

@jainpawan21 @merrcury I'd appreciate your insights on the significant reduction - a factor of 15-20 - in MongoDB's PoolSize.

@merrcury
Copy link
Member

@Aaron-Ritter Regarding the reduction in MongoDB pool size: For a small setup and initial usage, you likely don’t need hundreds of connections, especially since most operations are fairly quick. Maintaining a large number of connections increases RAM and CPU usage on MongoDB, which can be inefficient.

@Aaron-Ritter
Copy link
Contributor

@merrcury thanks a lot for the clarification, do you have any sizing guidelines documented?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Bug Report: ghcr.io/novuhq/novu/web:2.1.0 docker container STATUS (unhealthy) - curl: not found
4 participants