Skip to content

change path to route for metrics#50

Merged
Manuel-Pol merged 1 commit intomainfrom
grafana-tweaks
Jun 7, 2025
Merged

change path to route for metrics#50
Manuel-Pol merged 1 commit intomainfrom
grafana-tweaks

Conversation

@mbianchif
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request updates the metrics middleware to record the route using req.route instead of req.path.

  • Replaced req.path with req.route in metrics calls for better route tracking.
Comments suppressed due to low confidence (2)

src/main.ts:42

  • Switching from req.path to req.route may yield an object rather than the expected string for metrics. If a string representation is required, consider using req.route.path or converting the object accordingly.
end({ method: req.method, route: req.route, status: res.statusCode.toString() });

src/main.ts:43

  • Switching from req.path to req.route may yield an object rather than the expected string for metrics. If a string representation is required, consider using req.route.path or converting the object accordingly.
requestCounter.inc({ method: req.method, route: req.route, status: res.statusCode.toString() });

@codecov
Copy link
Copy Markdown

codecov bot commented Jun 7, 2025

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/main.ts 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Manuel-Pol Manuel-Pol merged commit f7a9d8f into main Jun 7, 2025
1 of 2 checks passed
@s-g-u s-g-u deleted the grafana-tweaks branch June 25, 2025 10:56
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.

3 participants