| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Community Apps Dependencies | Show |
| Lines of code | 285 |
| Technical Name |
dkn_otel |
| License | OPL-1 |
| Website | https://dakon.io |
| Versions | 14.0 15.0 16.0 17.0 18.0 |
OpenTelemetry Exporter
Version: 17.0.1.0
Author: Dakon
Compatibility: Odoo 14+
Overview
An OpenTelemetry exporter for Odoo is a module or integration component that collects telemetry data (primarily traces, and optionally metrics and logs) from Odoo’s execution environment and exports it to a backend observability system such as Google Cloud Trace, Jaeger, Zipkin, or OTLP-compatible services.
The exporter enables developers and DevOps teams to:
- Monitor and visualize the performance of Odoo requests (e.g., HTTP RPC calls, background jobs).
- Trace execution flow across distributed services using a standard observability format.
- Diagnose performance bottlenecks or errors by examining spans.
Installation
Instructions on how to install the module:
1. Copy the module into your Odoo addons folder. 2. Update the configuration files or use the environment variable. 3. Install the Python dependency detailed in the requirements.txt using the command bellow pip install -r requirements.txt 4. Restart the Odoo server. 5. Install module dkn_otel from menu Apps.
Configuration
There are two ways to configure this module: the first is by using the odoo.conf configuration file, and the second is to set it up using environment variables.
1. Using odoo.conf
[options] .. dkn_otel_enable = true dkn_otel_protocol = grpc dkn_otel_endpoint = localhost:4318 dkn_otel_service_name = odoo ..
2. Using environment variable
|-----------------------|-----------------------------------|-------------------------| | VARIABLE | DESCRIPTION | DEFAULT | |-----------------------|-----------------------------------|-------------------------| | DKN_OTEL_ENABLE | Enable OpenTelemetry (true/false) | false | | DKN_OTEL_PROTOCOL | Otel protocol (grpc/http) | grpc | | DKN_OTEL_ENDPOINT | OLTP endpoint | | | DKN_OTEL_TIMEOUT | OLTP connect timeout | 10 | | DKN_OTEL_SKIP_PATH | Excludes path (comma separated) | /longpolling,/websocket | | DKN_OTEL_SERVICE_NAME | Custom service name | odoo | | DKN_OTEL_CLASS | Custom otel singleton class | | |-------------------------------------------------------------------------------------|
Development Mode
1. Setup Development Environment
There are several ways to run this module locally for development, as it requires integrating
multiple dependencies. We propose using the docker-compose tools to streamline the installation of
the entire stack. This is just an example of docker-compose.yaml, you can improve if
needed.
services:
db:
image: postgres
container_name: db
ports:
- "5432:5432"
environment:
- POSTGRES_DB=postgres
- POSTGRES_PASSWORD=odoo
- POSTGRES_USER=odoo
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- db-data:/var/lib/postgresql/data/pgdata
jaeger:
image: jaegertracing/all-in-one:latest
container_name: jaeger
ports:
- "16686:16686" # Jaeger UI (http://localhost:16686)
- "4317:4317" # Jaeger gRPC
- "4318:4318" # Jaeger HTTP
odoo:
image: dakonio/odoo:17.0
container_name: odoo
ports:
- "80:8080" # Odoo UI (http://localhost)
environment:
- OPTIONS__DB_HOST=db
- OPTIONS__DB_PORT=5432
- OPTIONS__DB_USER=odoo
- OPTIONS__DB_NAME=odoo
- OPTIONS__DB_PASSWORD=odoo
- OPTIONS__LOG_HANDLER=:INFO
- OPTIONS__LOG_LEVEL=info
- OPTIONS__DKN_OTEL_ENABLE=true
- OPTIONS__DKN_OTEL_PROTOCOL=grpc
- OPTIONS__DKN_OTEL_SERVICE_NAME=odoo
- OPTIONS__DKN_OTEL_ENDPOINT=jaeger:4318
volumes:
- ./addons/dkn_otel:/mnt/addons/dkn_otel:ro
tty: true
depends_on:
- db
- jaeger
platform: linux/amd64
volumes:
db-data:
driver: local
2. Create a first event
Events represent something that happened at a specific time during the span's lifetime. They are
useful for logging key moments or actions, such as retries, errors, or state changes.
Creating your own event and sending the data to OpenTelemetry is easy; you need to use the Otel
class and call the add_event function provided by this module.
Here is the example:
# -*- coding: utf-8 -*-
from odoo import api, models
from odoo.addons.dkn_otel.patch.tools.otel import Otel
class Partner(models.Model):
_inherit = 'res.partner'
def write(self, vals):
res = super(Partner, self).write(vals)
Otel.add_event('update_partner', vals)
return res
The code above catches the update event on the res.partner model, and all changes will be saved to
the OpenTelemetry database.
Here the example screenshot from Jaeger (Jaeger is a tracing backend for OpenTelemetry that collects, stores, and visualizes trace data to help monitor and debug distributed systems.)
Support
For support, please contact:
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module