Skip to content

feat(http): added configurable 4xx error classification for exit spans#2636

Merged
aryamohanan merged 10 commits into
mainfrom
feat-http-4xx-error
Jul 10, 2026
Merged

feat(http): added configurable 4xx error classification for exit spans#2636
aryamohanan merged 10 commits into
mainfrom
feat-http-4xx-error

Conversation

@aryamohanan

@aryamohanan aryamohanan commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Added support for configurable HTTP 4xx error classification for HTTP exit (client) spans.

Configuration

Classify all 4xx responses as errors

env var

INSTANA_TRACING_HTTP_EXIT_CLASSIFY_ALL_4XX_AS_ERRORS=true

In code

tracing: {
  http: {
    exit: {
      classifyAll4xxAsErrors: true
    }
  }
}

agent.yaml

com.instana.tracing:
  http:
    exit:
      classify-all-4xx-as-errors: true

Classify only specific 4xx responses as errors

env var

INSTANA_TRACING_HTTP_EXIT_CLASSIFY_AS_ERRORS=401,403

In code

tracing: {
  http: {
    exit: {
      classifyAsErrors: [401, 403]
    }
  }
}

agent.yaml

com.instana.tracing:
  http:
    exit:
      classify-as-errors:
        - 401
        - 403

Precedence

classify-as-errors takes precedence over classify-all-4xx-as-errors. When a non-empty list is configured, only the listed status codes are marked as errors.

TODO

ref https://jsw.ibm.com/browse/INSTA-100637

@aryamohanan aryamohanan added the WIP label Jul 7, 2026
@aryamohanan aryamohanan changed the title feat(http): add configurable 4xx error classification for HTTP exit spans feat(http): added configurable 4xx error classification for HTTP exit spans Jul 7, 2026
@aryamohanan aryamohanan removed the WIP label Jul 7, 2026
@aryamohanan aryamohanan marked this pull request as ready for review July 8, 2026 04:21
@aryamohanan aryamohanan requested a review from a team as a code owner July 8, 2026 04:21
Comment thread packages/collector/src/announceCycle/unannounced.js Outdated
Comment thread packages/collector/src/announceCycle/unannounced.js
Comment thread packages/collector/src/announceCycle/unannounced.js Outdated
@aryamohanan aryamohanan force-pushed the feat-http-4xx-error branch 2 times, most recently from 93bda54 to b8580f0 Compare July 8, 2026 14:32
@aryamohanan aryamohanan requested a review from kirrg001 July 8, 2026 14:34
Comment thread packages/collector/test/apps/agentStub.js Outdated
Comment thread packages/collector/test/apps/agentStubControls.js Outdated
Comment thread packages/collector/test/integration/currencies/protocols/http/client/test_base.js Outdated
Comment thread packages/core/src/config/index.js Outdated
Comment thread packages/core/src/tracing/instrumentation/protocols/http2Client.js Outdated
Comment thread packages/core/src/tracing/instrumentation/protocols/nativeFetch.js Outdated
Comment thread packages/core/src/config/index.js Outdated
Comment thread packages/core/src/config/index.js Outdated
@aryamohanan aryamohanan force-pushed the feat-http-4xx-error branch from a87d1a8 to 960c79b Compare July 9, 2026 09:23
@sonarqubecloud

sonarqubecloud Bot commented Jul 9, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@kirrg001 kirrg001 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.

Great work!

Suggestion:

feat(http): added configurable 4xx error classification for exit spans

@aryamohanan aryamohanan force-pushed the feat-http-4xx-error branch from 90eb346 to 72031f0 Compare July 10, 2026 04:15
@aryamohanan aryamohanan changed the title feat(http): added configurable 4xx error classification for HTTP exit spans feat(http): added configurable 4xx error classification for exit spans Jul 10, 2026
@aryamohanan aryamohanan merged commit 79a3e93 into main Jul 10, 2026
2 checks passed
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