Traceback (most recent call last):
File "/usr/local/python3/lib/python3.7/logging/init.py", line 983, in emit
msg = self.format(record)
File "/usr/local/python3/lib/python3.7/logging/init.py", line 829, in format
return fmt.format(record)
File "/usr/local/python3/lib/python3.7/logging/init.py", line 569, in format
record.message = record.getMessage()
File "/usr/local/python3/lib/python3.7/logging/init.py", line 331, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "/usr/local/python3/bin/aliyun-exporter", line 11, in
sys.exit(main())
File "/usr/local/python3/lib/python3.7/site-packages/aliyun_exporter/init.py", line 45, in main
httpd.serve_forever()
File "/usr/local/python3/lib/python3.7/socketserver.py", line 234, in serve_forever
self._handle_request_noblock()
File "/usr/local/python3/lib/python3.7/socketserver.py", line 313, in handle_request_noblock
self.process_request(request, client_address)
File "/usr/local/python3/lib/python3.7/socketserver.py", line 344, in process_request
self.finish_request(request, client_address)
File "/usr/local/python3/lib/python3.7/socketserver.py", line 357, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/local/python3/lib/python3.7/socketserver.py", line 717, in init
self.handle()
File "/usr/local/python3/lib/python3.7/wsgiref/simple_server.py", line 133, in handle
handler.run(self.server.get_app())
File "/usr/local/python3/lib/python3.7/wsgiref/handlers.py", line 137, in run
self.result = application(self.environ, self.start_response)
File "/usr/local/python3/lib/python3.7/site-packages/werkzeug/wsgi.py", line 826, in call
return app(environ, start_response)
File "/usr/local/python3/lib/python3.7/site-packages/prometheus_client/exposition.py", line 45, in prometheus_app
output = encoder(r)
File "/usr/local/python3/lib/python3.7/site-packages/prometheus_client/openmetrics/exposition.py", line 14, in generate_latest
for metric in registry.collect():
File "/usr/local/python3/lib/python3.7/site-packages/prometheus_client/registry.py", line 75, in collect
for metric in collector.collect():
File "/usr/local/python3/lib/python3.7/site-packages/aliyun_exporter/collector.py", line 133, in collect
yield from self.metric_generator(project, metric)
File "/usr/local/python3/lib/python3.7/site-packages/aliyun_exporter/collector.py", line 115, in metric_generator
logging.error('Error query metrics for {}{}'.format(project, metric_name), e)
Message: 'Error query metrics for acs_ecs_dashboard_memory_usedutilization'
Arguments: (KeyError('Datapoints'),)
--- Logging error ---
Traceback (most recent call last):
File "/usr/local/python3/lib/python3.7/site-packages/aliyun_exporter/collector.py", line 113, in metric_generator
points = self.query_metric(project, metric_name, period)
File "/usr/local/python3/lib/python3.7/site-packages/aliyun_exporter/collector.py", line 89, in query_metric
points = json.loads(data['Datapoints'])
KeyError: 'Datapoints'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/python3/lib/python3.7/logging/init.py", line 983, in emit
msg = self.format(record)
File "/usr/local/python3/lib/python3.7/logging/init.py", line 829, in format
return fmt.format(record)
File "/usr/local/python3/lib/python3.7/logging/init.py", line 569, in format
record.message = record.getMessage()
File "/usr/local/python3/lib/python3.7/logging/init.py", line 331, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
File "/usr/local/python3/bin/aliyun-exporter", line 11, in
sys.exit(main())
File "/usr/local/python3/lib/python3.7/site-packages/aliyun_exporter/init.py", line 45, in main
httpd.serve_forever()
File "/usr/local/python3/lib/python3.7/socketserver.py", line 234, in serve_forever
self._handle_request_noblock()
File "/usr/local/python3/lib/python3.7/socketserver.py", line 313, in handle_request_noblock
self.process_request(request, client_address)
File "/usr/local/python3/lib/python3.7/socketserver.py", line 344, in process_request
self.finish_request(request, client_address)
File "/usr/local/python3/lib/python3.7/socketserver.py", line 357, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/local/python3/lib/python3.7/socketserver.py", line 717, in init
self.handle()
File "/usr/local/python3/lib/python3.7/wsgiref/simple_server.py", line 133, in handle
handler.run(self.server.get_app())
File "/usr/local/python3/lib/python3.7/wsgiref/handlers.py", line 137, in run
self.result = application(self.environ, self.start_response)
File "/usr/local/python3/lib/python3.7/site-packages/werkzeug/wsgi.py", line 826, in call
return app(environ, start_response)
File "/usr/local/python3/lib/python3.7/site-packages/prometheus_client/exposition.py", line 45, in prometheus_app
output = encoder(r)
File "/usr/local/python3/lib/python3.7/site-packages/prometheus_client/openmetrics/exposition.py", line 14, in generate_latest
for metric in registry.collect():
File "/usr/local/python3/lib/python3.7/site-packages/prometheus_client/registry.py", line 75, in collect
for metric in collector.collect():
File "/usr/local/python3/lib/python3.7/site-packages/aliyun_exporter/collector.py", line 133, in collect
yield from self.metric_generator(project, metric)
File "/usr/local/python3/lib/python3.7/site-packages/aliyun_exporter/collector.py", line 115, in metric_generator
logging.error('Error query metrics for {}{}'.format(project, metric_name), e)
Message: 'Error query metrics for acs_ecs_dashboard_net_tcpconnection'
Arguments: (KeyError('Datapoints'),)
抱歉这么晚才注意到
问题在于响应体的 json 中没有 Datapoints 字段, 推断是阿里云那边因为限流或其他原因返回了非正常的返回体😅
下一个版本会修复这个问题, 正确打印出阿里云返回异常结果的原因
For anyone who encountered the same issue:
This is a bad error handling for bad responses from the Cloud Monitor API, and this will be addressed in next release hopefully.
I'm facing the same issue, looking forward to the next release.
Thanks aylei!
i have tried the newest 0.3.1 ,this problem is still there.
facing the same issue,because my accesskeys no privileges to access, After I add priveleges ,everything is ok
@t1ger Thanks for you help!
@jinxiao @jsimanjuntak @gitzh2017
I’ve addressed this issue in aylei/aliyun-exporter:0.3.2-rc
, now the error handling is much more friendly. Unfortunately, I don't have aliyun resources to test my fix recently, could you please try this image again?
@t1ger Thanks for you help!
@jinxiao @jsimanjuntak @gitzh2017
I’ve addressed this issue in aylei/aliyun-exporter:0.3.2-rc
, now the error handling is much more friendly. Unfortunately, I don't have aliyun resources to test my fix recently, could you please try this image again?
i do it.
@t1ger Thanks for you help!
@jinxiao @jsimanjuntak @gitzh2017
I’ve addressed this issue in aylei/aliyun-exporter:0.3.2-rc
, now the error handling is much more friendly. Unfortunately, I don't have aliyun resources to test my fix recently, could you please try this image again?
i do it.
Thanks! Could you please confirm whether the problem has been solved?