add tracing tags

This commit is contained in:
Peter Maquiran
2024-07-31 09:35:35 +01:00
parent edcaf951c2
commit 2d2f00cb4c
9 changed files with 51 additions and 53 deletions
+2 -1
View File
@@ -45,15 +45,16 @@ export class HttpService {
return ok (result as T)
} catch (e) {
tracing?.setAttribute('url', url)
if(isHttpError(e)) {
tracing?.setAttribute('status.code', e.status.toString())
if (e.status == 400) {
tracing?.setAttribute('outcome', 'failed')
}
} else {
tracing.setAttribute('outcome', 'failed')
tracing?.setAttribute('map.error', 'true')
tracing?.setAttribute('map.error.context', JSON.stringify(e))
tracing.setAttribute('outcome', 'failed')
}
return err(e as HttpErrorResponse)
}