Error span on 5xx only

This commit is contained in:
Kevin Crawley 2021-04-14 05:20:03 -05:00 committed by GitHub
parent fe6acdf4d2
commit be81ce244e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -348,7 +348,7 @@ It is therefore necessary to update [RBAC](../reference/dynamic-configuration/ku
### Non-ASCII Domain Names ### Non-ASCII Domain Names
In `v2.4.8` we introduced a new check on domain names used in HTTP router rule `Host` and `HostRegexp` expressions, In `v2.4.8`, we introduced a new check on domain names used in HTTP router rule `Host` and `HostRegexp` expressions,
and in TCP router rule `HostSNI` expression. and in TCP router rule `HostSNI` expression.
This check ensures that provided domain names don't contain non-ASCII characters. This check ensures that provided domain names don't contain non-ASCII characters.
If not, an error is raised, and the associated router will be shown as invalid in the dashboard. If not, an error is raised, and the associated router will be shown as invalid in the dashboard.
@ -358,3 +358,9 @@ It doesn't change the support for non-ASCII domain names in routers rules, which
In order to use non-ASCII domain names in a router's rule, one should use the Punycode form of the domain name. In order to use non-ASCII domain names in a router's rule, one should use the Punycode form of the domain name.
For more information, please read the [HTTP routers rule](../routing/routers/index.md#rule) part or [TCP router rules](../routing/routers/index.md#rule_1) part of the documentation. For more information, please read the [HTTP routers rule](../routing/routers/index.md#rule) part or [TCP router rules](../routing/routers/index.md#rule_1) part of the documentation.
## v2.4.8 to v2.4.9
### Tracing Span
In `v2.4.9`, we changed span error to log only server errors (>= 500).

View file

@ -117,7 +117,7 @@ func LogRequest(span opentracing.Span, r *http.Request) {
func LogResponseCode(span opentracing.Span, code int) { func LogResponseCode(span opentracing.Span, code int) {
if span != nil { if span != nil {
ext.HTTPStatusCode.Set(span, uint16(code)) ext.HTTPStatusCode.Set(span, uint16(code))
if code >= 400 { if code >= http.StatusInternalServerError {
ext.Error.Set(span, true) ext.Error.Set(span, true)
} }
} }