@app.cli.command()
def create_index():
"""Create or re-create the Elasticsearch index."""
basedir = os.path.abspath(os.path.dirname(__file__))
sys.path.append(f"{basedir}/../")
from data import index_data
index_data.main()
Describe the solution you'd like
I would like to see an internal (likely root) span with the same name as the function.
Describe alternatives you've considered
I would like to have an auto-instrumentation alternative to creating a span for an app.cli.command like so:
@app.cli.command()
# Currently, flask auto-instrumentation does not trace CLI commands
@tracer.start_as_current_span("create_index")
def create_index():
"""Create or re-create the Elasticsearch index."""
basedir = os.path.abspath(os.path.dirname(__file__))
sys.path.append(f"{basedir}/../")
from data import index_data
index_data.main()
What problem do you want to solve?
app.cli.command are not instrumented
Describe the solution you'd like
I would like to see an internal (likely root) span with the same name as the function.
Describe alternatives you've considered
I would like to have an auto-instrumentation alternative to creating a span for an app.cli.command like so:
Additional Context
No response
Would you like to implement a fix?
No