I have a Flask API, and I want to log responses body using APM. I used this example code:
from elasticapm.contrib.flask import ElasticAPM from flask import Flask app = Flask(__name__) apm = ElasticAPM(app, server_url='http://localhost:8200', service_name='flask-app-1', logging=True) @app.route('/') def hello_world(): resp = "Hello, World!" return resp if __name__ == '__main__': app.run()
I have seen
set_custom_context in here, but I don't know how to use in above code to send also the
resp to APM.