Exporter/Prometheus: Error on registering multiple views
See original GitHub issueI got the example with one view to work, but once I start registering multiple views it gives me the following error:
Traceback (most recent call last): File "repl.py", line 122, in <module> main() File "repl.py", line 66, in main readEvaluateProcessLine() File "repl.py", line 119, in readEvaluateProcessLine mmap.record(tmap) File "/Users/prakritibansal/Opencensus/opencensus-python/opencensus/stats/measurement_map.py", line 87, in record attachments=self.attachments File "/Users/prakritibansal/Opencensus/opencensus-python/opencensus/stats/measure_to_view_map.py", line 110, in record self.export(view_datas) File "/Users/prakritibansal/Opencensus/opencensus-python/opencensus/stats/measure_to_view_map.py", line 116, in export e.export(view_datas) File "/Users/prakritibansal/Opencensus/opencensus-python/opencensus/stats/exporters/prometheus_exporter.py", line 314, in export self.transport.export(view_data) File "/Users/prakritibansal/Opencensus/opencensus-python/opencensus/common/transports/sync.py", line 23, in export self.exporter.emit(datas) File "/Users/prakritibansal/Opencensus/opencensus-python/opencensus/stats/exporters/prometheus_exporter.py", line 329, in emit self.collector.add_view_data(v_data) File "/Users/prakritibansal/Opencensus/opencensus-python/opencensus/stats/exporters/prometheus_exporter.py", line 135, in add_view_data self.register_view(view_data.view) File "/Users/prakritibansal/Opencensus/opencensus-python/opencensus/stats/exporters/prometheus_exporter.py", line 130, in register_view self.registry.register(self) File "/Users/prakritibansal/anaconda2/lib/python2.7/site-packages/prometheus_client/core.py", line 54, in register names = self._get_names(collector) File "/Users/prakritibansal/anaconda2/lib/python2.7/site-packages/prometheus_client/core.py", line 91, in _get_names for metric in desc_func(): File "/Users/prakritibansal/Opencensus/opencensus-python/opencensus/stats/exporters/prometheus_exporter.py", line 242, in describe signature = view_signature(self.options.namespace, v_data.view) AttributeError: 'str' object has no attribute 'view'
I am registering the view like so:
view_manager.register_view(latency_view)
view_manager.register_view(line_count_view)
view_manager.register_view(error_count_view)
view_manager.register_view(line_length_view)
Full code available here
Any ideas on why this could be happening? @odeke-em
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (5 by maintainers)
Top GitHub Comments
Oh I see that’s from an edit, I hadn’t seen it. Thanks @songy23 and sorry for that @PikBot.
Thanks @mayurkale22 ! There must have been some version update of the OC python library. I was using 0.1.7. Updating it resolved the issue for me.