question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exporter/Prometheus: Error on registering multiple views

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
odeke-emcommented, Oct 11, 2018

@odeke-em I think @PikBot added the link here:

Oh I see that’s from an edit, I hadn’t seen it. Thanks @songy23 and sorry for that @PikBot.

0reactions
PikBotcommented, Oct 12, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling of conflicting metric values · Issue #63 - GitHub
We can't register both conflicting metrics and export them. Just logging the error and continuing would result in silently ignoring all ...
Read more >
Troubleshooting Managed Service for Prometheus
The error message "Too many concurrent edits to the project configuration" is usually transient, resolving after a few minutes. It is usually caused...
Read more >
Understanding and using the multi-target exporter pattern
This guide will introduce you to the multi-target exporter pattern. To achieve this we will: describe the multi-target exporter pattern and why it...
Read more >
[Part 1] How To Setup Prometheus And Exporters For Alerts ...
Prometheus Grafana: While Prometheus has its own UI to check any metrics. But, many prefer Grafana with Prometheus which gives you better ...
Read more >
Prometheus - Go Packages
Package prometheus contains a Prometheus exporter that supports exporting OpenCensus views as Prometheus metrics.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found