CuBoulder / express_mono

Monolithic Express Profile - contains all bundles
GNU General Public License v2.0
1 stars 2 forks source link

new: Endpoint for Prometheus metrics gathering #816

Closed AlanBCole closed 3 years ago

AlanBCole commented 3 years ago

new Express Site Metrics module

Here is a new metrics module that provides endpoints for gathering site metrics data.

Included features of in this PR:

  1. endpoints for gathering metrics data
    1. admin/express/metrics/json -> Intended for Prometheus. Requires a web token to access. Returns simple JSON encoded metrics data.
    2. admin/express/metrics -> Pretty prints JSON to screen. User must have 'administer modules' permission.
  2. endpoint for creating a token (if ever needed)
    • admin/express/metrics/token -> User must have 'administer modules' permission.
  3. Simple Json Web Token implementation. Right now I have used some code (the JWT class) so we don't have to use Composer to manage this code dependency.

What still needs to be done

  1. Coordination with Atlas so that a token for Prometheus is created that all express sites will accept.
    • Right now I am planning that a hashing secret string and a userId array('Prometheus') could be declared in the settingings.php file.
    • When this new module is installed these are copied to the variable database table so that they can be used as expected.
  2. Right now I am using code from atlas, cu_atlas and atlas_statistics modules. This will probably need to be changed as we go through the following item
  3. Revisions as needed...
AlanBCole commented 3 years ago

@jwfuller How should we handle the secret and initial prometheus token with it? We mentioned the settings.php file before for creating the hashing secret and for creating an array of token userIds. But what we still need to get Prometheus a token made with the secret and Prometheus userId.

jwfuller commented 3 years ago

@AlanBCole @jeor0980 can help open an issue in Atlas to add the information to the settings file.

AlanBCole commented 3 years ago

A partner PR for this is in our atlas repository