Skip to content

Conversation

@kibertoad
Copy link
Contributor

This provides readable names for hook invocations in stacktraces and observability tools like New Relic.

@kibertoad kibertoad requested a review from SkeLLLa as a code owner November 27, 2023 16:15
@kibertoad
Copy link
Contributor Author

kibertoad commented Nov 27, 2023

@SkeLLLa None of the CI errors seem to relate to changes in the PR. Do builds work on main OK?

@kibertoad
Copy link
Contributor Author

Update: #95 is passing, so this is something that I broke. Will check.

@kibertoad kibertoad marked this pull request as draft November 27, 2023 16:21
@SkeLLLa
Copy link
Owner

SkeLLLa commented Nov 27, 2023

Yeah, failing check look weird. Maybe there's some this binding is lost during the transition from arrow functions to plain functions.

Maybe as workaround you could try just named arrow functions like const onSomething = () => { ... }

@kibertoad kibertoad marked this pull request as ready for review November 27, 2023 16:33
@kibertoad
Copy link
Contributor Author

sure, if current version doesn't work, will use named arrow functions!

@kibertoad kibertoad marked this pull request as draft November 27, 2023 16:34
return { routeHist, routeSum, labelNames };
}

/** Collect per-route metrics */

Check notice

Code scanning / CodeQL

Syntax error

Error: ',' expected.
@kibertoad
Copy link
Contributor Author

@SkeLLLa problem with const namedArrowFunction is that this approach requires making quite a few FastifyMetrics fields/methods to become public :-/. Wonder if there even exists a good solution here.

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.

2 participants