# Question about community.general.opentelemetry callback

**URL:** <https://forum.ansible.com/t/question-about-community-general-opentelemetry-callback/37277>\
**Category:** Ansible Project\
**Created:** [October 28, 2022, 2:58pm UTC](https://forum.ansible.com/t/question-about-community-general-opentelemetry-callback/37277 "2022-10-28T14:58:33Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Barros](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@Daniel\_Barros](https://forum.ansible.com/u/Daniel_Barros)\
**Post date:** [October 28, 2022, 2:58pm UTC](https://forum.ansible.com/t/question-about-community-general-opentelemetry-callback/37277/1 "2022-10-28T14:58:33Z")

</div>

Hi group, good day, how are you?

I have a question about using community.general.opentelemetry to send data to APM.

I have set my ansible.cfg like this.

[defaults]

callbacks\_enabled = community.general.opentelemetry

[callback\_opentelemetry]

enable\_from\_environment = ANSIBLE\_OPENTELEMETRY\_ENABLED

And then environment variables like this.

OTEL\_EXPORTER\_OTLP\_ENDPOINT=[http://elk-server:8200](http://elk-server:8200)

OTEL\_EXPORTER\_OTLP\_HEADERS=“authorization=Bearer xxxxxx”

OTEL\_SERVICE\_NAME=ansible

I have also installed the telemetry python packages

pip list | grep opentele  
opentelemetry-api 1.13.0  
opentelemetry-exporter-otlp 1.13.0  
opentelemetry-exporter-otlp-proto-grpc 1.13.0  
opentelemetry-exporter-otlp-proto-http 1.13.0  
opentelemetry-instrumentation 0.34b0  
opentelemetry-proto 1.13.0  
opentelemetry-sdk 1.13.0  
opentelemetry-semantic-conventions 0.34b0

But still getting this error, does anyone have some ideas?

Appreciate it

[WARNING]: Skipping callback ‘community.general.opentelemetry’, unable to load due to: The `opentelemetry-api`,  
`opentelemetry-exporter-otlp` or `opentelemetry-sdk` must be installed to use this plugin

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [October 28, 2022, 3:19pm UTC](https://forum.ansible.com/t/question-about-community-general-opentelemetry-callback/37277/2 "2022-10-28T15:19:52Z")

</div>

What does ‘ansible --version’ say?  
And ‘pip --version’

---

<div class="post-metadata">

**Author:** ![Daniel\_Barros](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@Daniel\_Barros](https://forum.ansible.com/u/Daniel_Barros)\
**Post date:** [October 28, 2022, 3:23pm UTC](https://forum.ansible.com/t/question-about-community-general-opentelemetry-callback/37277/3 "2022-10-28T15:23:27Z")

</div>

Hi man, thanks for the time.

Please see the information as requested

ansible --version  
ansible [core 2.13.2]

pip --version  
pip 22.3 from /home/daniel/py\_venvs/ansible\_2.13/lib/python3.9/site-packages/pip (python 3.9)

python --version  
Python 3.9.13

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [October 29, 2022, 3:49pm UTC](https://forum.ansible.com/t/question-about-community-general-opentelemetry-callback/37277/4 "2022-10-29T15:49:04Z")

</div>

> Hi man, thanks for the time.
> 
> Please see the information as requested
> 
> ansible --version  
> ansible [core 2.13.2]

This is not the entire output. It should like this like this:

ansible [core 2.11.7]  
config file = /Users/dick.visser/git/[github.com/dnmvisser/tienhuis\_ansible/ansible.cfg](http://github.com/dnmvisser/tienhuis_ansible/ansible.cfg)  
configured module search path = [‘/Users/dick.visser/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]  
ansible python module location = /Users/dick.visser/git/[github.com/dnmvisser/tienhuis\_ansible/venv/lib/python3.9/site-packages/ansible](http://github.com/dnmvisser/tienhuis_ansible/venv/lib/python3.9/site-packages/ansible)  
ansible collection location = /Users/dick.visser/.ansible/collections:/usr/share/ansible/collections  
executable location = /Users/dick.visser/git/[github.com/dnmvisser/tienhuis\_ansible/venv/bin/ansible](http://github.com/dnmvisser/tienhuis_ansible/venv/bin/ansible)  
python version = 3.9.9 (main, Jan 25 2022, 23:02:06) [Clang 13.0.0 (clang-1300.0.29.30)]  
jinja version = 3.0.3  
libyaml = True

---

<div class="post-metadata">

**Author:** ![Daniel\_Barros](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@Daniel\_Barros](https://forum.ansible.com/u/Daniel_Barros)\
**Post date:** [November 7, 2022, 9:57am UTC](https://forum.ansible.com/t/question-about-community-general-opentelemetry-callback/37277/5 "2022-11-07T09:57:56Z")

</div>

Hi man.

This is the entire output

ansible --version  
ansible [core 2.13.2]  
config file = None  
configured module search path = [‘/home/daniel/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]  
ansible python module location = /home/daniel/py\_venvs/ansible\_2.13/lib/python3.9/site-packages/ansible  
ansible collection location = /home/daniel/.ansible/collections:/usr/share/ansible/collections  
executable location = /home/daniel/py\_venvs/ansible\_2.13/bin/ansible  
python version = 3.9.13 (main, May 23 2022, 22:02:02) [GCC 7.5.0]  
jinja version = 3.1.2  
libyaml = True

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [November 7, 2022, 5:52pm UTC](https://forum.ansible.com/t/question-about-community-general-opentelemetry-callback/37277/6 "2022-11-07T17:52:30Z")

</div>

That seems right.  
I don’t know what it could be then.

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [November 7, 2022, 5:55pm UTC](https://forum.ansible.com/t/question-about-community-general-opentelemetry-callback/37277/7 "2022-11-07T17:55:46Z")

</div>

Maybe also take a look at `pip list -v` to see the paths of where those python libraries are installed. And make sure they are in /home/daniel/py\_venvs/ansible\_2.13/lib/python3.9/site-packages/

---

<div class="post-metadata">

**Author:** ![Daniel\_Barros](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@Daniel\_Barros](https://forum.ansible.com/u/Daniel_Barros)\
**Post date:** [November 7, 2022, 9:15pm UTC](https://forum.ansible.com/t/question-about-community-general-opentelemetry-callback/37277/8 "2022-11-07T21:15:36Z")

</div>

Yes, it’s strange.

They are installed in that path  
pip list -v | grep opent  
opentelemetry-api 1.13.0 /home/daniel/py\_venvs/ansible\_2.13/lib/python3.9/site-packages pip  
opentelemetry-exporter-otlp 1.13.0 /home/daniel/py\_venvs/ansible\_2.13/lib/python3.9/site-packages pip  
opentelemetry-exporter-otlp-proto-grpc 1.13.0 /home/daniel/py\_venvs/ansible\_2.13/lib/python3.9/site-packages pip  
opentelemetry-exporter-otlp-proto-http 1.13.0 /home/daniel/py\_venvs/ansible\_2.13/lib/python3.9/site-packages pip  
opentelemetry-instrumentation 0.34b0 /home/daniel/py\_venvs/ansible\_2.13/lib/python3.9/site-packages pip  
opentelemetry-proto 1.13.0 /home/daniel/py\_venvs/ansible\_2.13/lib/python3.9/site-packages pip  
opentelemetry-sdk 1.13.0 /home/daniel/py\_venvs/ansible\_2.13/lib/python3.9/site-packages pip  
opentelemetry-semantic-conventions 0.34b0 /home/daniel/py\_venvs/ansible\_2.13/lib/python3.9/site-packages pip

But I was able to make it work using a container on AWX. I’ll try to reinstall my venv and packages to work locally.

Thanks for your tips!!

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [November 7, 2022, 9:29pm UTC](https://forum.ansible.com/t/question-about-community-general-opentelemetry-callback/37277/9 "2022-11-07T21:29:02Z")

</div>

Hi,

unfortunately you did not mention which version of community.general  
you are using. For opentelemetry-api 1.13.0 you need community.general  
5.8.0, since that contains a bugfix which allows the opentelemetry  
callback to work with that version. (It removed some helper function  
that the plugin was using, see  
[https://github.com/ansible-collections/community.general/blob/stable-5/CHANGELOG.rst#bugfixes.](https://github.com/ansible-collections/community.general/blob/stable-5/CHANGELOG.rst#bugfixes.))

Cheers,  
Felix

---

<div class="post-metadata">

**Author:** ![Daniel\_Barros](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@Daniel\_Barros](https://forum.ansible.com/u/Daniel_Barros)\
**Post date:** [November 8, 2022, 7:03pm UTC](https://forum.ansible.com/t/question-about-community-general-opentelemetry-callback/37277/10 "2022-11-08T19:03:12Z")

</div>

Hi Felix.

You are completely right.  
I’ve tried with the community.general:5.7.0 and it didn’t work out.  
After changing to version 6.0.0 it started to work perfectly.

Thank you all for sharing your knowledge.

Br,
