Skip to content

Commit f6a06be

Browse files
committed
fix: The spec doesn't set upper limit for ec=1 if code>=500
Signed-off-by: Ferenc Géczi <[email protected]>
1 parent b625b37 commit f6a06be

File tree

13 files changed

+14
-14
lines changed

13 files changed

+14
-14
lines changed

instana/instrumentation/aiohttp/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ async def stan_request_end(session, trace_config_ctx, params):
5151
if custom_header in params.response.headers:
5252
scope.span.set_tag("http.header.%s" % custom_header, params.response.headers[custom_header])
5353

54-
if 500 <= params.response.status <= 599:
54+
if 500 <= params.response.status:
5555
scope.span.mark_as_errored({"http.error": params.response.reason})
5656

5757
scope.close()

instana/instrumentation/aiohttp/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async def stan_middleware(request, handler):
5252

5353
if response is not None:
5454
# Mark 500 responses as errored
55-
if 500 <= response.status <= 511:
55+
if 500 <= response.status:
5656
scope.span.mark_as_errored()
5757

5858
scope.span.set_tag("http.status_code", response.status)

instana/instrumentation/asgi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ async def send_wrapper(response):
7878
try:
7979
status_code = response.get('status')
8080
if status_code is not None:
81-
if 500 <= int(status_code) <= 511:
81+
if 500 <= int(status_code):
8282
span.mark_as_errored()
8383
span.set_tag('http.status_code', status_code)
8484

instana/instrumentation/django/middleware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def process_request(self, request):
5858
def process_response(self, request, response):
5959
try:
6060
if request.iscope is not None:
61-
if 500 <= response.status_code <= 511:
61+
if 500 <= response.status_code:
6262
request.iscope.span.assure_errored()
6363
# for django >= 2.2
6464
if request.resolver_match is not None and hasattr(request.resolver_match, 'route'):

instana/instrumentation/fastapi_inst.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ async def instana_exception_handler(request, exc):
3535
span = async_tracer.active_span
3636

3737
if span is not None:
38-
if hasattr(exc, 'detail') and (500 <= exc.status_code <= 599):
38+
if hasattr(exc, 'detail') and 500 <= exc.status_code:
3939
span.set_tag('http.error', exc.detail)
4040
span.set_tag('http.status_code', exc.status_code)
4141
except Exception:

instana/instrumentation/flask/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def handle_user_exception_with_instana(wrapped, instance, argv, kwargs):
5858
else:
5959
status_code = response.status_code
6060

61-
if 500 <= status_code <= 511:
61+
if 500 <= status_code:
6262
span.log_exception(exc)
6363

6464
span.set_tag(ext.HTTP_STATUS_CODE, int(status_code))

instana/instrumentation/flask/vanilla.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def after_request_with_instana(response):
6464
if scope is not None:
6565
span = scope.span
6666

67-
if 500 <= response.status_code <= 511:
67+
if 500 <= response.status_code:
6868
span.mark_as_errored()
6969

7070
span.set_tag(ext.HTTP_STATUS_CODE, int(response.status_code))

instana/instrumentation/flask/with_blinker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def request_finished_with_instana(sender, response, **extra):
6464
if scope is not None:
6565
span = scope.span
6666

67-
if 500 <= response.status_code <= 511:
67+
if 500 <= response.status_code:
6868
span.mark_as_errored()
6969

7070
span.set_tag(ext.HTTP_STATUS_CODE, int(response.status_code))

instana/instrumentation/pyramid/tweens.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def __call__(self, request):
6565
if response:
6666
scope.span.set_tag("http.status", response.status_int)
6767

68-
if 500 <= response.status_int <= 511:
68+
if 500 <= response.status_int:
6969
if response.exception is not None:
7070
message = str(response.exception)
7171
scope.span.log_exception(response.exception)

instana/instrumentation/sanic_inst.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def exception_with_instana(wrapped, instance, args, kwargs):
2222
status_code = kwargs.get("status_code")
2323
span = async_tracer.active_span
2424

25-
if all([span, status_code, message]) and (500 <= status_code <= 599):
25+
if all([span, status_code, message]) and 500 <= status_code:
2626
span.set_tag("http.error", message)
2727
try:
2828
wrapped(*args, **kwargs)
@@ -39,7 +39,7 @@ def response_details(span, response):
3939
try:
4040
status_code = response.status
4141
if status_code is not None:
42-
if 500 <= int(status_code) <= 511:
42+
if 500 <= int(status_code):
4343
span.mark_as_errored()
4444
span.set_tag('http.status_code', status_code)
4545

0 commit comments

Comments
 (0)