Example shown in the document https://opentelemetry-python.readthedocs.io/en/stable/getting-started.html#adding-metrics doesn't work. #1390
Labels
1.10.0rc1
release candidate 1 for metrics GA
bug
Something isn't working
metrics
release:required-for-ga
To be resolved before GA release
Describe your environment Describe any aspect of your environment relevant to the problem, including your Python version, platform, version numbers of installed dependencies, information about your cloud hosting provider, etc. If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on master.
I am using Python 3.8.1. Below are the details of the packages
opentelemetry-api 0.15b0
opentelemetry-exporter-jaeger 0.15b0
opentelemetry-instrumentation 0.15b0
opentelemetry-instrumentation-flask 0.15b0
opentelemetry-instrumentation-requests 0.15b0
opentelemetry-instrumentation-wsgi 0.15b0
opentelemetry-sdk 0.15b0
Steps to reproduce
I have just copied the code for the below URL
https://opentelemetry-python.readthedocs.io/en/stable/getting-started.html#adding-metrics
while executing it is giving me below error
File "metrics.py", line 19, in
requests_counter = meter.create_metric(
AttributeError: 'Meter' object has no attribute 'create_metric'
Below are few pointers to the issue
Output of print(type(meter)) : <class 'opentelemetry.sdk.metrics.Meter'>
Output of print(dir(meter)) : ['abstractmethods', 'class', 'delattr', 'dict', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'gt', 'hash', 'init', 'init_subclass', 'le', 'lt', 'module', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'setattr', 'sizeof', 'slots', 'str', 'subclasshook', 'weakref', '_abc_impl', '_collect_metrics', '_collect_observers', 'collect', 'create_counter', 'create_updowncounter', 'create_valuerecorder', 'record_batch', 'register_sumobserver', 'register_updownsumobserver', 'register_valueobserver', 'register_view', 'unregister_observer', 'unregister_view']
Basically meter doesn't have a function "create_metric".
I checked the functions available for the object by using dir()
The text was updated successfully, but these errors were encountered: