Skip to content

Conversation

@crazyuploader
Copy link
Contributor

Closes: #99

@crazyuploader crazyuploader self-assigned this Oct 14, 2025
@crazyuploader crazyuploader added the documentation Improvements or additions to documentation label Oct 14, 2025
@vercel
Copy link

vercel bot commented Oct 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
signoz-web Ready Ready Preview Comment Oct 14, 2025 6:25pm

@crazyuploader
Copy link
Contributor Author

@claude /review

@claude
Copy link
Contributor

claude bot commented Nov 17, 2025

Claude finished @crazyuploader's task —— View job


PR Review Complete

I've reviewed the documentation changes for excluding HTTP endpoints in Node.js. The content is technically accurate and well-structured overall, with a few minor improvements suggested.

Review Summary

What was reviewed:

  • ✅ Navigation changes in constants/docsSideNav.ts - correctly added to JavaScript instrumentation section
  • ✅ New documentation file structure and content
  • ✅ Technical accuracy verified against official OpenTelemetry sources
  • ✅ Code examples and implementation guide
  • ✅ Image asset (webp format - correct per guidelines)

Findings:

I've provided 5 inline comments with specific suggestions:

  1. Missing imports (line 9): Add Tabs and TabItem imports like other docs in this directory
  2. Clarity improvement (lines 23-25): Make the explanation of ignoreIncomingRequestHook behavior more precise
  3. Technical accuracy (line 34): Specify that the function receives an IncomingMessage object
  4. Code robustness (line 42): Add optional chaining for safer null handling
  5. Grammar fix (line 242): "make" → "making"

Strengths:

  • Clear, step-by-step implementation guide
  • Good use of code examples with explanations
  • Proper troubleshooting section included
  • Technically accurate configuration examples
  • Follows SigNoz documentation structure (Overview, Prerequisites, Implementation, Validation, Troubleshooting, What's Next)
  • Uses regex patterns correctly for path matching
  • Image provided in correct webp format

Sources consulted:

The documentation provides valuable guidance for developers who need to exclude health checks and other non-business endpoints from tracing, which is a common requirement in production environments.


tags: [SigNoz Cloud, Self-Host]
---

import GetHelp from '@/components/shared/get-help.md'
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing import statement for Tabs component. Other documentation files in this directory include:

import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'

Add these imports after the GetHelp import.

Comment on lines +23 to +25
The `ignoreIncomingRequestHook(req)` callback runs before spans are created for each request.

If this function returns `true`, that specific request will be ignored and no span will be generated for that endpoint.
Copy link
Contributor

Choose a reason for hiding this comment

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

The explanation could be more precise. According to the official OpenTelemetry types, ignoreIncomingRequestHook returns a boolean where true means "exclude this request from tracing."

Suggested change
The `ignoreIncomingRequestHook(req)` callback runs before spans are created for each request.
If this function returns `true`, that specific request will be ignored and no span will be generated for that endpoint.
The `ignoreIncomingRequestHook(req)` function evaluates each incoming HTTP request before span creation.
When this function returns `true`, the request is excluded from tracing and no span will be created for that endpoint.

Source: https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/packages/opentelemetry-instrumentation-http/src/types.ts


## Exclude HTTP Endpoints

The `ignoreIncomingRequestHook(req)` function gives access to each incoming request. We can match `req.url`, headers, or methods (GET, POST, etc.) to decide which request should be ignored from traces.
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor clarification: The function receives an IncomingMessage object, not just any request. Consider being more specific:

Suggested change
The `ignoreIncomingRequestHook(req)` function gives access to each incoming request. We can match `req.url`, headers, or methods (GET, POST, etc.) to decide which request should be ignored from traces.
The `ignoreIncomingRequestHook(req)` function gives access to each incoming HTTP request's `IncomingMessage` object. You can inspect `req.url`, headers, or HTTP methods (GET, POST, etc.) to decide which requests should be excluded from traces.

Source: https://github.com/open-telemetry/opentelemetry-js/blob/main/experimental/packages/opentelemetry-instrumentation-http/src/types.ts

// Ignore any requests starting with /internal or /health
const httpInstrumentation = new HttpInstrumentation({
ignoreIncomingRequestHook(req) {
return req.url.startsWith('/health') || req.url.startsWith('/internal')
Copy link
Contributor

Choose a reason for hiding this comment

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

Note: Using req.url.startsWith() without null checking could cause issues if req.url is undefined. Consider using optional chaining:

Suggested change
return req.url.startsWith('/health') || req.url.startsWith('/internal')
const httpInstrumentation = new HttpInstrumentation({
ignoreIncomingRequestHook(req) {
return req.url?.startsWith('/health') || req.url?.startsWith('/internal')
},
})

This makes the code more defensive against edge cases.


## Validate Traces in SigNoz

After running your app and make a few HTTP requests to endpoints such as `http://localhost:3002/`, `http://localhost:3002/health`, `http://localhost:3002/api/data`, etc.
Copy link
Contributor

Choose a reason for hiding this comment

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

Grammar issue:

Suggested change
After running your app and make a few HTTP requests to endpoints such as `http://localhost:3002/`, `http://localhost:3002/health`, `http://localhost:3002/api/data`, etc.
After running your app and making a few HTTP requests to endpoints such as `http://localhost:3002/`, `http://localhost:3002/health`, `http://localhost:3002/api/data`, etc.

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.

Doc on Exclude http endpoints from tracing

1 participant