Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
ocelotl committed Aug 25, 2021
1 parent a32481f commit ab549d7
Showing 1 changed file with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@
logger = getLogger(__file__)


def parse_args():
def load_config_from_cli_args(args):
if args.trace_exporter:
environ[OTEL_TRACES_EXPORTER] = args.trace_exporter
if args.id_generator:
environ[OTEL_PYTHON_ID_GENERATOR] = args.id_generator


def run() -> None:

parser = argparse.ArgumentParser(
description="""
opentelemetry-instrument automatically instruments a Python
Expand Down Expand Up @@ -68,18 +76,9 @@ def parse_args():
help="Arguments for your application.",
nargs=argparse.REMAINDER,
)
return parser.parse_args()

args = parser.parse_args()

def load_config_from_cli_args(args):
if args.trace_exporter:
environ[OTEL_TRACES_EXPORTER] = args.trace_exporter
if args.id_generator:
environ[OTEL_PYTHON_ID_GENERATOR] = args.id_generator


def run() -> None:
args = parse_args()
load_config_from_cli_args(args)

python_path = environ.get("PYTHONPATH")
Expand Down

0 comments on commit ab549d7

Please sign in to comment.