Problem/Motivation

Currently Vitals does not allow modules to modify the response that will be sent when viewing the /vitals/{token} url.

Consider the following example:

  • The vitals endpoint for a site is monitored and an alert is raised if any modules show pending security updates.
  • A security release was recently issued for a module.
  • Due to the complexity of the update, the security release cannot be applied quickly. However, a patch has been added to resolve the security vulnerability.

In this scenario, there is no simple way to prevent the patched module from appearing in the vitals reponse. A developer could technically create their own VitalsCheck plugin to override the "updates" VitalsCheck plugin, but it would be much easier if the VitalsCheck plugins could instead allow other modules a chance to alter their response.

Steps to reproduce

N/A

Proposed resolution

My current thought is to have a $this->moduleHandler->alter('my_custom_data', $my_data); in some sort of base VitalsCheck class.

I may also consider a second alter hook for the complete vitals response before it is sent. That could potentially be useful to add in some extra data without needing to implement a complete VitalsCheck plugin.

Remaining tasks

  • Plan the implementation
  • Implementation
  • Documentation
  • Add tests

User interface changes

N/A

API changes

I don't think there will be any official API changes, but will update this section if that changes.

Data model changes

N/A

Issue fork vitals-3609720

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

daceej created an issue. See original summary.

daceej changed the visibility of the branch 3609720-allow-other-modules to hidden.

daceej changed the visibility of the branch 3609720-allow-other-modules to active.

  • daceej committed c9d8cf03 on 2.x
    Issue #3609720: Add hooks to allow other modules to modify Vitals...
daceej’s picture

Issue summary: View changes
Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

daceej’s picture

Status: Fixed » Active

  • daceej committed 12343462 on 2.x
    Issue #3609720: Add an API file to demonstrate how to use the new hooks.
    
daceej’s picture

Issue summary: View changes
Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.