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

fixes #485: add Watchman monitoring url #500

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

jaydonkrooss
Copy link
Contributor

test plan: check to see if the monitoring endpoint is available using your local ngrok or loophole URL at /watchman/

The requested resource should be a report and response on the status of database, cache, etc.

@jaydonkrooss jaydonkrooss linked an issue Jan 29, 2025 that may be closed by this pull request
@pushyamig pushyamig requested a review from jonespm January 29, 2025 21:46
},
'watchman': {
'handlers': ['console'],
'level': 'DEBUG',
Copy link
Member

Choose a reason for hiding this comment

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

This feels like it should maybe use os.getenv('DJANGO_LOG_LEVEL', 'INFO') like above rather than everything at DEBUG level? Does this cause a lot of log messages when accessing watchman?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see these debug logs when the /watchman/ url is called

ccm_web    | [2025-02-13 21:48:46 +0000] [DEBUG] [decorators.py:26] Checking '_check_database' for 'default'
ccm_web    | [2025-02-13 21:48:46 +0000] [DEBUG] [decorators.py:26] Checking '_check_database' for 'default'
ccm_web    | [2025-02-13 21:48:46 +0000] [DEBUG] [decorators.py:26] Checking '_check_cache' for 'default'
ccm_web    | [2025-02-13 21:48:46 +0000] [DEBUG] [decorators.py:26] Checking '_check_cache' for 'default'

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure why duplicate logs of same check, since these are debug might now be noise in prod

Copy link
Member

Choose a reason for hiding this comment

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

Yeah we'd want it to be able to run at INFO or WARNING probably in prod. Just seemed fine to match the DJANGO level.

@pushyamig
Copy link
Contributor

I see this working when called https://fd8e-68-36-190-34.ngrok-free.app/watchman/ and it is responding with

{
  "databases": [
    {
      "default": {
        "ok": true
      }
    }
  ],
  "caches": [
    {
      "default": {
        "ok": true
      }
    }
  ]
}

@pushyamig
Copy link
Contributor

@jonespm Do you want the /bare_status/ url, since with Myla it is configured?

@jonespm
Copy link
Member

jonespm commented Feb 13, 2025

Zabbix is currently using /bare_status/ for MyLA, so I guess it's worth adding. It's not included in the default urls.

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

Successfully merging this pull request may close these issues.

Monitoring with Django Watchman
3 participants