Thank you so much for your replies
After following what you posted we have managed to get transactions into APM using ecs log formatter and filebeat. However, now we have gone full circle and can't seem to get our ERRORS to be reported as ERRORS.
Are there specific fields that APM requires to associate a transaction as an ERROR?
This is an example of one of our Error messages that appear in APM:
{
"@timestamp": "2023-09-27T10:55:28.855Z",
"log.level": "error",
"message": "Unexpected 500 error happened - ",
"ecs": {
"version": "1.6.0"
},
"error": {
"message": "",
"stack_trace": " File \"/var/app/venv/staging-LQM1lest/lib64/python3.11/site-packages/flask/app.py\", line 1484, in full_dispatch_request\n rv = self.dispatch_request()\n ^^^^^^^^^^^^^^^^^^^^^^^\n File \"/var/app/venv/staging-LQM1lest/lib64/python3.11/site-packages/flask/app.py\", line 1469, in dispatch_request\n return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/var/app/venv/staging-LQM1lest/lib64/python3.11/site-packages/flask/views.py\", line 109, in view\n return current_app.ensure_sync(self.dispatch_request)(**kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/var/app/venv/staging-LQM1lest/lib64/python3.11/site-packages/flask/views.py\", line 190, in dispatch_request\n return current_app.ensure_sync(meth)(**kwargs)\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/var/app/current/api/api_error.py\", line 27, in get\n raise ZeroDivisionError\n",
"type": "ZeroDivisionError"
},
"log": {
"logger": "python_poc_api",
"origin": {
"file": {
"line": 371,
"name": "__init__.py"
},
"function": "internal_exception"
},
"original": "Unexpected 500 error happened - "
},
"log_context": "LogContext(service_host='python-poc-api-10.0.0.1', service_id='python_poc_api', service_application='python_poc_api', user_guid='', service_function='', transaction_id='', log_prefix='', log_message='', log_level=20, timestamp='')",
"process": {
"name": "MainProcess",
"pid": 3844,
"thread": {
"id": 139772232603200,
"name": "ThreadPoolExecutor-0_0"
}
},
"service": {
"environment": "dev",
"name": "python_poc_api"
},
"trace": {
"id": "905c8e027d1dd87400e79125e2a899e5"
},
"transaction": {
"id": "474af35450149f1a"
}
}
Are we missing any required fields? error.culprit
perhaps? Is this something the plugin/handler should handle for us?
Or should we go back to using the Agent for shipping ERROR or above logs and continue to use filebeat for INFO. I would be apprehensive of doing that if you were to remove the Flask log sending as you mentioned.
Thanks in Advance,
Jason!