rajesh-bijja opened a new issue, #28391:
URL: https://github.com/apache/superset/issues/28391

   ### Bug description
   
   This ticket reports the same issue that was reported in 
https://github.com/apache/superset/issues/21067 and which was closed as stale. 
   
   We are trying to uptake the superset statsd logging capability as mentioned 
in the document: 
https://superset.apache.org/docs/configuration/event-logging/#statsd-logging
   
   ```
   from superset.stats_logger import StatsdStatsLogger
   STATS_LOGGER = StatsdStatsLogger(host='localhost', port=8125, 
prefix='superset')
   ```
   
   
   But we are running into below error while starting the superset docker 
container:
   
   ```
   Found but failed to import local superset_config
   Traceback (most recent call last):
     File "/app/superset/config.py", line 1704, in <module>
       import superset_config
     File "/app/docker/pythonpath_dev/superset_config.py", line 119, in <module>
       from superset.stats_logger import StatsdStatsLogger
   ImportError: cannot import name 'StatsdStatsLogger' from 
'superset.stats_logger' (/app/superset/stats_logger.py)
   Found but failed to import local superset_config
   
   
   superset_app          | During handling of the above exception, another 
exception occurred:
   superset_app          |
   superset_app          | Traceback (most recent call last):
   superset_app          |   File "/app/superset/config.py", line 1704, in 
<module>
   superset_app          |     import superset_config
   superset_app          |   File 
"/app/docker/pythonpath_dev/superset_config.py", line 119, in <module>
   superset_app          |     from superset.stats_logger import 
StatsdStatsLogger
   superset_app          | ImportError: cannot import name 'StatsdStatsLogger' 
from 'superset.stats_logger' (/app/superset/stats_logger.py)
   superset_app          | Failed to create app
   superset_app          | Traceback (most recent call last):
   superset_app          |   File "/app/superset/app.py", line 37, in create_app
   superset_app          |     app.config.from_object(config_module)
   superset_app          |   File 
"/usr/local/lib/python3.10/site-packages/flask/config.py", line 227, in 
from_object
   superset_app          |     obj = import_string(obj)
   superset_app          |   File 
"/usr/local/lib/python3.10/site-packages/werkzeug/utils.py", line 611, in 
import_string
   superset_app          |     raise ImportStringError(import_name, 
e).with_traceback(
   superset_app          |   File 
"/usr/local/lib/python3.10/site-packages/werkzeug/utils.py", line 603, in 
import_string
   superset_app          |     module = __import__(module_name, globals(), 
locals(), [obj_name])
   superset_app          |   File "/app/superset/config.py", line 1704, in 
<module>
   superset_app          |     import superset_config
   superset_app          |   File 
"/app/docker/pythonpath_dev/superset_config.py", line 119, in <module>
   superset_app          |     from superset.stats_logger import 
StatsdStatsLogger
   superset_app          | werkzeug.utils.ImportStringError: import_string() 
failed for 'superset.config'. Possible reasons are:
   superset_app          |
   superset_app          | - missing __init__.py in a package;
   superset_app          | - package or module path not included in sys.path;
   superset_app          | - duplicated package or module name taking 
precedence in sys.path;
   superset_app          | - missing module, class, function or variable;
   superset_app          |
   superset_app          | Debugged import:
   superset_app          |
   superset_app          | - 'superset' found in '/app/superset/__init__.py'.
   superset_app          | - 'superset.config' not found.
   superset_app          |
   
   
   ```
   
   **Superset version** - v4.0.0  
   **Superset instance** - On docker
   statsd==3.3.0
   python-statsd==2.1.0
   
   
   
   
   ### How to reproduce the bug
   
   1. Add the following two lines at the end of the file: superset_config.py
   
   ```
   from superset.stats_logger import StatsdStatsLogger
   STATS_LOGGER = StatsdStatsLogger(host='localhost', port=8125, 
prefix='superset')
   ```
   
   2. Start superset docker container and the above error will be thrown.
   
   ### Screenshots/recordings
   
   _No response_
   
   ### Superset version
   
   4.0.0
   
   ### Python version
   
   3.10
   
   ### Node version
   
   Not applicable
   
   ### Browser
   
   Not applicable
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [X] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [X] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [ ] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to