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

Instrumentation: Add gauge of total number of requests in flight #281

Merged
merged 3 commits into from
Sep 13, 2021

Conversation

AgnesToulet
Copy link
Contributor

Add gauge of total number of requests in flight (only for /render/* routes).

Closes #234

@@ -17,13 +15,15 @@ export const metricsMiddleware = (config: MetricsConfig, log: Logger) => {
config.requestDurationBuckets.join(',')
);

const excludeRegExp = /^((?!(render)).)*$/;
Copy link
Contributor

Choose a reason for hiding this comment

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

how come these routes are excluded?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's to exclude all routes that don't contain render. I'm not sure it's really useful currently but it could be in the future (right now, the only route that is excluded is GET /)

src/service/metrics_middleware.ts Outdated Show resolved Hide resolved
@Clarity-89
Copy link
Contributor

Should I be able to see these metrics somewhere or are they just logged into console? I have this in my dev.json (default setup):

"metrics": {
  "enabled": true,
  "collectDefaultMetrics": true,
  "requestDurationBuckets": [1, 5, 7, 9, 11, 13, 15, 20, 30]
},

@AgnesToulet
Copy link
Contributor Author

Yes you can see them by calling the /metrics endpoint of the image renderer.

Copy link
Contributor

@Clarity-89 Clarity-89 left a comment

Choose a reason for hiding this comment

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

Looks good!

@AgnesToulet AgnesToulet merged commit 9dd2773 into master Sep 13, 2021
@AgnesToulet AgnesToulet deleted the add-in-flight-metric branch September 13, 2021 14:49
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.

Instrumentation: Add gauge of total number of requests in flight.
3 participants