graphite-project / graphite-web

A highly scalable real-time graphing system
http://graphite.readthedocs.org/
Apache License 2.0
5.87k stars 1.26k forks source link

UTF8 proble #2790

Closed anch665 closed 1 year ago

anch665 commented 1 year ago

Get ERROR UTF8 i'm uncomment UTF8_METRICS = True in webapp/graphite/local_settings.py but i get errol

2022-12-07,18:06:27.654 :: Failed CarbonLink query 'RTM.PROD.server3.nbo2.choice.offers.dynamic.segment.NBO_APP.BANNER.RTM_FINANCE_1.CAMP1017348.3827_ММ_Obeschanniy_platezh.273004.count' Traceback (most recent call last): File "/sas/graphite/webapp/graphite/readers/utils.py", line 110, in merge_with_carbonlink cached_datapoints = CarbonLink().query(metric) File "/sas/graphite/webapp/graphite/carbonlink.py", line 96, in query results = self.send_request(request) File "/sas/graphite/webapp/graphite/carbonlink.py", line 142, in send_request log.cache("CarbonLink finished receiving %s from %s" % (str(metric), str(host))) UnicodeEncodeError: 'ascii' codec can't encode characters in position 115-116: ordinal not in range(128) where ММ - is russian symbol whith code 1052

2022-12-07,16:15:12.025 :: Failed CarbonLink query 'collectd.PROD.server6.RtdmByPerl.1243__Приглашение_в_кампанию.gauge' Traceback (most recent call last): File "/sas/graphite/webapp/graphite/readers/utils.py", line 110, in merge_with_carbonlink cached_datapoints = CarbonLink().query(metric) File "/sas/graphite/webapp/graphite/carbonlink.py", line 96, in query results = self.send_request(request) File "/sas/graphite/webapp/graphite/carbonlink.py", line 142, in send_request log.cache("CarbonLink finished receiving %s from %s" % (str(metric), str(host))) UnicodeEncodeError: 'ascii' codec can't encode characters in position 69-79: ordinal not in range(128) where 1243__Приглашение_в_кампанию.gauge - russian string in UTF8

Environment (please complete the following information):

Additional context Add any other context about the problem here.

deniszh commented 1 year ago

Yes, looks like a bug. All str() where string can be UTF8 in log.cache should be replaced with encode('utf-8') Could you please check does LOG_CACHE_PERFORMANCE=False in local_settings.py fixing the issue?

anch665 commented 1 year ago

Денис, надеюсь вы не обидитесь на русский язык. включение LOG_CACHE_PERFORMANCE=False в local_settings.py проблему не исправляет

Что интересно без включения опции UTF8_METRICS = True метрики collectd.PROD.server6.RtdmByPerl.1243____Приглашение_в_кампанию.gauge отображает в графане, а при отображении RTM.PROD.server3.nbo2.choice.offers.dynamic.segment.NBO_APP.BANNER.RTM_FINANCE_1.CAMP1017348.3827_ММ_Obeschanniy_platezh.273004.count пишет ошибку

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.