Skip to content

docs: add per-route logging for Google Cloud Functions - #6907

Merged
ilteoood merged 4 commits into
fastify:mainfrom
slegarraga:docs/gcp-per-route-logging
Aug 9, 2026
Merged

ilteoood merged 4 commits into
fastify:mainfrom
slegarraga:docs/gcp-per-route-logging

Conversation

@slegarraga

Copy link
Copy Markdown
Contributor

Closes #4670.

Adds a per-route logging section to the Google Cloud Functions part of the serverless guide.

The section shows how to keep a single Fastify function while getting per-route visibility in Cloud Logging:

  • emit a structured onResponse log with the matched route pattern
  • use request.routeOptions.url so /users/123 and /users/456 group under /users/:id
  • build log-based metrics from jsonPayload.route

The same hook applies to Firebase Functions with onRequest.

Validated with markdownlint-cli2.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Aug 6, 2026
@Tony133
Tony133 requested a review from a team August 6, 2026 08:55

@Fdawgs Fdawgs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please link to appropriate Google Cloud documentation that supports this.

@slegarraga

Copy link
Copy Markdown
Contributor Author

Thanks for the review, @Fdawgs. I added the supporting Google Cloud references in ac092f5: structured logging, Cloud Functions logging, and log-based metrics. The section now links those docs where the approach is described. markdownlint passes.

@Fdawgs
Fdawgs requested a balanced review from Copilot August 6, 2026 16:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Signed-off-by: Sebastian Legarraga <[email protected]>
@slegarraga

Copy link
Copy Markdown
Contributor Author

Small follow-up: the Cloud Run quickstart reference now uses the canonical cloud.google.com URL instead of docs.cloud.google.com. markdownlint passes on the updated guide.

@Fdawgs
Fdawgs requested a balanced review from Copilot August 9, 2026 08:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@ilteoood
ilteoood merged commit 2e81c38 into fastify:main Aug 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to separate api endpoints in google cloud.

4 participants