mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-30 05:32:30 +08:00
12 lines
271 B
Python
12 lines
271 B
Python
import sys
|
|
import os
|
|
|
|
|
|
def get_application_name():
|
|
"""Attempts to find the application name using system arguments."""
|
|
if hasattr(sys, "argv") and sys.argv[0]:
|
|
app_name = os.path.basename(sys.argv[0])
|
|
else:
|
|
app_name = None
|
|
return app_name
|