Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cloud monitoring exporter doesn't work #830

Closed
@marianhromiak

Description

@marianhromiak

Hi,
when I tried example for Cloud Monitoring exporter for OpenTelemetry it doesn't work.
Describe your environment
Platform: 'Linux-5.3.0-53-generic-x86_64-with-Ubuntu-18.04-bionic'
Version: Python 3.6.9
Installed packages:

Package                                 Version
--------------------------------------- ----------
aiocontextvars                          0.2.2
cachetools                              4.1.0
certifi                                 2020.4.5.2
chardet                                 3.0.4
click                                   7.1.2
contextvars                             2.4
ddtrace                                 0.38.1
ddtrace-aiomisc                         1.0.3
Flask                                   1.1.2
google-api-core                         1.19.1
google-auth                             1.16.1
google-cloud-core                       1.3.0
google-cloud-monitoring                 0.36.0
google-cloud-trace                      0.23.0
googleapis-common-protos                1.52.0
grpcio                                  1.29.0
idna                                    2.9
immutables                              0.14
itsdangerous                            1.1.0
Jinja2                                  2.11.2
kubernetes                              11.0.0
MarkupSafe                              1.1.1
msgpack                                 1.0.0
oauthlib                                3.1.0
opencensus                              0.7.7
opencensus-context                      0.1.1
opencensus-ext-flask                    0.7.3
opencensus-ext-httplib                  0.7.3
opencensus-ext-postgresql               0.1.2
opencensus-ext-requests                 0.7.3
opencensus-ext-stackdriver              0.7.2
opencensus-ext-threading                0.1.2
opentelemetry-api                       0.9b0
opentelemetry-exporter-cloud-monitoring 0.9b0
opentelemetry-ext-datadog               0.9b0
opentelemetry-sdk                       0.9b0
pip                                     20.1.1
protobuf                                3.12.2
psycopg2                                2.8.5
psycopg2-binary                         2.8.5
pyasn1                                  0.4.8
pyasn1-modules                          0.2.8
python-dateutil                         2.8.1
pytz                                    2020.1
PyYAML                                  5.3.1
requests                                2.23.0
requests-oauthlib                       1.3.0
rsa                                     4.0
setuptools                              46.4.0
six                                     1.15.0
urllib3                                 1.25.9
websocket-client                        0.57.0
Werkzeug                                1.0.1
wheel                                   0.34.2
wrapt                                   1.12.1

Steps to reproduce
Download and run file:
https://github.com/open-telemetry/opentelemetry-python/blob/stable/docs/examples/cloud_monitoring/basic_metrics.py

What is the expected behavior?
Send metrics to Cloud monitoring.

What is the actual behavior?
Raise exception AttributeError:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/home/majo/work/tmp/trace-live-demo/lib/python3.6/site-packages/opentelemetry/sdk/metrics/export/controller.py", line 48, in run
    self.tick()
  File "/home/majo/work/tmp/trace-live-demo/lib/python3.6/site-packages/opentelemetry/sdk/metrics/export/controller.py", line 60, in tick
    self.exporter.export(self.meter.batcher.checkpoint_set())
  File "/home/majo/work/tmp/trace-live-demo/lib/python3.6/site-packages/opentelemetry/exporter/cloud_monitoring/__init__.py", line 132, in export
    metric_descriptor = self._get_metric_descriptor(record)
  File "/home/majo/work/tmp/trace-live-demo/lib/python3.6/site-packages/opentelemetry/exporter/cloud_monitoring/__init__.py", line 71, in _get_metric_descriptor
    record.metric.name
AttributeError: 'MetricRecord' object has no attribute 'metric'

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinginstrumentationRelated to the instrumentation of third party libraries or frameworks

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions