[Python] Why can I not see the stacktrace for an error in Kibana -> Observability -> Errors...

Discussão em 'Python' iniciado por Stack, Janeiro 24, 2025.

  1. Stack

    Stack Membro Participativo

    Context: We're using Elastic APM with our Flask application. We have a managed Elastic Cloud instance.

    Problem: For an error in Kibana -> Observability -> Errors section, I only see the message: "No stack trace available.". However, when I look inside index logs-apm.error*, I see the stacktrace object with all details at path error.exception.stacktrace.

    My flask configuration:

    from flask import Flask
    from elasticapm.contrib.flask import ElasticAPM

    app = Flask(__name__)

    # Configure Elastic APM
    app.config['ELASTIC_APM'] = {
    'SERVICE_NAME': '<APP_NAME>',
    'SECRET_TOKEN': '<TOKEN>',
    'SERVER_URL': '<URL>',
    "ENVIRONMENT": "staging",
    }

    apm = ElasticAPM(app)


    def dummy():
    return 1 / 0

    @app.route('/test-me')
    def home():
    dummy()
    return 'Hello, World!'


    Kibana screenshot: enter image description here

    I tried the app with FLASK_ENV='production' and FLASK_DEBUG = 0 without success.

    Continue reading...

Compartilhe esta Página