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

Grouping routes and changing log level. #3

Closed
thearegee opened this Issue May 30, 2018 · 8 comments

Comments

Projects
None yet
2 participants
@thearegee
Collaborator

thearegee commented May 30, 2018

As mentioned on Fastify issues: fastify/fastify#830

I thought it might be worth repeating here. I think two useful features to look at might be:

  1. A way to change logging level.
  2. A way to group routes, for example:
[2018-05-30T15:17:46.825Z] INFO (59443 on MLWES34975): routes stats
    stats: {
      "/en-gb/homepage": {
        "mean": 3073.37433,
        "mode": 3073.37433,
        "median": 3073.37433,
        "max": 3073.37433,
        "min": 3073.37433,
        "sd": null
      },
      "/en-it/homepage": {
        "mean": 2563.871048,
        "mode": 2563.871048,
        "median": 2563.871048,
        "max": 2563.871048,
        "min": 2563.871048,
        "sd": null
      }
    }

These are actually the same page just localisation makes the route differ, you might want to group these together.

@mcollina

This comment has been minimized.

Member

mcollina commented May 30, 2018

Definitely we should make the log level customizable. Would you like to send a PR?
Regarding grouping routes.. it might be too costly. How would you group them (what logic)?

@thearegee

This comment has been minimized.

Collaborator

thearegee commented May 30, 2018

Yeah I can, I wanted to on the other ticket just didn't get a chance... would like to here though.

With grouping, like above the path for instance: /en-gb/homepage the localisation param en-gb I may not care about it because if the website has 30 countries and 4 language thats 120 permutations of homepage. I want to know the average performance of all those permutations.

So I was wondering about giving the routes some kind of identifier? Then you have two options this could either aggregate the metrics, probably too costly or just add the identifier into the stats object then whatever monitoring tool you use could do the hardwork?

@mcollina

This comment has been minimized.

Member

mcollina commented May 30, 2018

We might stick something into https://github.com/fastify/fastify/blob/master/docs/Routes.md#config and use that instead of the URL. What do you think?

@thearegee

This comment has been minimized.

Collaborator

thearegee commented May 30, 2018

I think that could would be perfect!

@mcollina

This comment has been minimized.

Member

mcollina commented May 30, 2018

Would you like to send a PR?

@thearegee

This comment has been minimized.

Collaborator

thearegee commented May 30, 2018

So two things:

  1. Change logging level.
  2. Look for something like: reply.context.config.id if available else use the URL? Does this also need a Fastify change?
@mcollina

This comment has been minimized.

Member

mcollina commented Jun 10, 2018

Look for something like: reply.context.config.id if available else use the URL? Does this also need a Fastify change?

I would use config.statsId if available. It does not need a fastify change.

@thearegee

This comment has been minimized.

Collaborator

thearegee commented Jul 2, 2018

Grouping is now complete, log level option would still be nice, but closing this and will investigate later

@thearegee thearegee closed this Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment