praphi-git opened a new issue, #49039:
URL: https://github.com/apache/airflow/issues/49039

   ### Apache Airflow version
   
   2.10.5
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   I am trying to run Airflow 2.10.5. 
   
   i am trying to use an OTLP endpoint which doesn't have a port. it looks like 
this  `https://otlp-ingest/ot/v1/`
   
   i tried to provide empty port in airflow configuration, but Airflow doesn't 
start.
   
   ### What you think should happen instead?
   
   When we start Airflow with otel_on=True in airflow configuration, it tries 
to read the port to send a trace.
   
   in venv/lib/python3.12/site-packages/airflow/traces/otel_tracer.py
   
   functon: def get_otel_tracer(cls) -> OtelTrace:
   
   At line    port = conf.getint("traces", "otel_port")
   
   Below is the full stacktrace
   
   ```
   Traceback (most recent call last):
     File "<mywork-dir>/work/airflow/otel/venv/bin/airflow", line 8, in <module>
       sys.exit(main())
                ^^^^^^
     File 
"<mywork-dir>/work/airflow/otel/venv/lib/python3.12/site-packages/airflow/__main__.py",
 line 62, in main
       args.func(args)
     File 
"<mywork-dir>/work/airflow/otel/venv/lib/python3.12/site-packages/airflow/cli/cli_config.py",
 line 49, in command
       return func(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^
     File 
"<mywork-dir>/work/airflow/otel/venv/lib/python3.12/site-packages/airflow/utils/cli.py",
 line 116, in wrapper
       return f(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^
     File 
"<mywork-dir>/work/airflow/otel/venv/lib/python3.12/site-packages/airflow/utils/providers_configuration_loader.py",
 line 55, in wrapped_function
       return func(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^
     File 
"<mywork-dir>/work/airflow/otel/venv/lib/python3.12/site-packages/airflow/cli/commands/scheduler_command.py",
 line 56, in scheduler
       run_command_with_daemon_option(
     File 
"<mywork-dir>/work/airflow/otel/venv/lib/python3.12/site-packages/airflow/cli/commands/daemon_utils.py",
 line 86, in run_command_with_daemon_option
       callback()
     File 
"<mywork-dir>/work/airflow/otel/venv/lib/python3.12/site-packages/airflow/cli/commands/scheduler_command.py",
 line 59, in <lambda>
       callback=lambda: _run_scheduler_job(args),
                        ^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"<mywork-dir>/work/airflow/otel/venv/lib/python3.12/site-packages/airflow/cli/commands/scheduler_command.py",
 line 47, in _run_scheduler_job
       run_job(job=job_runner.job, execute_callable=job_runner._execute)
     File 
"<mywork-dir>/work/airflow/otel/venv/lib/python3.12/site-packages/airflow/utils/session.py",
 line 97, in wrapper
       return func(*args, session=session, **kwargs)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"<mywork-dir>/work/airflow/otel/venv/lib/python3.12/site-packages/airflow/jobs/job.py",
 line 421, in run_job
       return execute_job(job, execute_callable=execute_callable)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"<mywork-dir>/work/airflow/otel/venv/lib/python3.12/site-packages/airflow/jobs/job.py",
 line 450, in execute_job
       ret = execute_callable()
             ^^^^^^^^^^^^^^^^^^
     File 
"<mywork-dir>/work/airflow/otel/venv/lib/python3.12/site-packages/airflow/jobs/scheduler_job_runner.py",
 line 999, in _execute
       self._run_scheduler_loop()
     File 
"<mywork-dir>/work/airflow/otel/venv/lib/python3.12/site-packages/airflow/jobs/scheduler_job_runner.py",
 line 1123, in _run_scheduler_loop
       with Trace.start_span(
            ^^^^^^^^^^^^^^^^
     File 
"<mywork-dir>/work/airflow/otel/venv/lib/python3.12/site-packages/airflow/traces/tracer.py",
 line 253, in __getattr__
       cls.instance = cls.factory()
                      ^^^^^^^^^^^^^
     File 
"<mywork-dir>/work/airflow/otel/venv/lib/python3.12/site-packages/airflow/traces/otel_tracer.py",
 line 259, in get_otel_tracer
       port = conf.getint("traces", "otel_port")
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     File 
"<mywork-dir>/work/airflow/otel/venv/lib/python3.12/site-packages/airflow/configuration.py",
 line 1187, in getint
       raise AirflowConfigException(
   airflow.exceptions.AirflowConfigException: Failed to convert value to int. 
Please check "otel_port" key in "traces" section. Current value: "".
   ```
   
   
   
   ### How to reproduce
   
   Start Airflow scheduler with following in airflow configuration 
   
   otel_on = True 
   otel_host = otlp-ingest/ot
   otel_service = fgt-airflow-test
   otel_ssl_active = True
   otel_port =
   
   You can oobserve that it fails to start
   
   ### Operating System
   
   MacOS
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Virtualenv installation
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to