Describe the bug
I'm trying to create a middleware for an express app, using @promster/express
' createMiddleware
function. Before the package moved to TS, the following worked
createMiddleware({ options: { metricTypes: ['countOfGcs', 'durationOfGc', 'reclaimedInGc'] } });
and gave me the metrics I wanted. Now, however, after the move, I get an error from TS stating that buckets
and percentiles
are missing.
To Reproduce
Steps to reproduce the behavior:
Using TS 3.9, the following shows the error
import { createMiddleware } from '@promster/express';
createMiddleware({ options: { metricTypes: ['countOfGcs', 'durationOfGc', 'reclaimedInGc'] } });
Expected behavior
No TypeScript errors should occur
Additional context
Any place I found in the source code that uses either of these values has a fallback default value, so shouldn't these two be optional?
Right now, TPromsterOptions
is defined with
buckets: [number];
percentiles: [number];
}
From what I saw, these can be optional in the interface. I can open a PR with this small change, if that would be deemed appropriate, and would help