Skip to content

Commit e8e3cbd

Browse files
feat(oracledb): Add support for Oracle DB instrumentation (#2612)
Co-authored-by: Marylia Gutierrez <[email protected]>
1 parent 10da4db commit e8e3cbd

27 files changed

+3086
-0
lines changed

.github/component-label-map.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,11 @@ pkg:instrumentation-net:
188188
- changed-files:
189189
- any-glob-to-any-file:
190190
- plugins/node/opentelemetry-instrumentation-net/**
191+
pkg:instrumentation-oracledb:
192+
- changed-files:
193+
- any-glob-to-any-file:
194+
- plugins/node/opentelemetry-instrumentation-oracledb/**
195+
- packages/opentelemetry-test-utils/**
191196
pkg:instrumentation-pg:
192197
- changed-files:
193198
- any-glob-to-any-file:

.github/component_owners.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ components:
123123
# Unmaintained
124124
plugins/node/opentelemetry-instrumentation-net:
125125
- seemk
126+
plugins/node/opentelemetry-instrumentation-oracledb:
127+
- sudarshan12s
128+
- sharadraju
126129
plugins/node/instrumentation-runtime-node:
127130
- d4nyll
128131
plugins/node/opentelemetry-instrumentation-pg:

.github/workflows/test-all-versions.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,19 @@ jobs:
8080
--health-interval 10s
8181
--health-timeout 5s
8282
--health-retries 5
83+
oracledb:
84+
image: gvenzl/oracle-free:slim
85+
env:
86+
APP_USER: otel
87+
APP_USER_PASSWORD: secret
88+
ORACLE_PASSWORD: oracle
89+
ports:
90+
- 1521:1521
91+
options: >-
92+
--health-cmd "sqlplus system/oracle@//localhost/FREEPDB1"
93+
--health-interval 10s
94+
--health-timeout 5s
95+
--health-retries 5
8396
postgres:
8497
image: postgres:16-alpine
8598
env:
@@ -122,6 +135,12 @@ jobs:
122135
MYSQL_USER: otel
123136
OPENTELEMETRY_REDIS_HOST: localhost
124137
OPENTELEMETRY_REDIS_PORT: 6379
138+
ORACLE_HOSTNAME: localhost
139+
ORACLE_PORT: 1521
140+
ORACLE_CONNECTSTRING: localhost:1521/freepdb1
141+
ORACLE_USER: otel
142+
ORACLE_PASSWORD: secret
143+
ORACLE_SERVICENAME: FREEPDB1
125144
POSTGRES_DB: otel_pg_database
126145
POSTGRES_HOST: localhost
127146
POSTGRES_PORT: 5432
@@ -130,6 +149,7 @@ jobs:
130149
RUN_MONGODB_TESTS: 1
131150
RUN_MSSQL_TESTS: 1
132151
RUN_MYSQL_TESTS: 1
152+
RUN_ORACLEDB_TESTS: 1
133153
RUN_POSTGRES_TESTS: 1
134154
RUN_REDIS_TESTS: 1
135155
NPM_CONFIG_UNSAFE_PERM: true

.github/workflows/unit-test.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,19 @@ jobs:
8383
--health-interval 10s
8484
--health-timeout 5s
8585
--health-retries 5
86+
oracledb:
87+
image: gvenzl/oracle-free:slim
88+
env:
89+
APP_USER: otel
90+
APP_USER_PASSWORD: secret
91+
ORACLE_PASSWORD: oracle
92+
ports:
93+
- 1521:1521
94+
options: >-
95+
--health-cmd "sqlplus system/oracle@//localhost/FREEPDB1"
96+
--health-interval 10s
97+
--health-timeout 5s
98+
--health-retries 5
8699
postgres:
87100
image: postgres:16-alpine
88101
env:
@@ -122,6 +135,7 @@ jobs:
122135
RUN_MONGODB_TESTS: 1
123136
RUN_MYSQL_TESTS: 1
124137
RUN_MSSQL_TESTS: 1
138+
RUN_ORACLEDB_TESTS: 1
125139
RUN_POSTGRES_TESTS: 1
126140
RUN_REDIS_TESTS: 1
127141
RUN_RABBIT_TESTS: 1
@@ -140,6 +154,12 @@ jobs:
140154
OPENTELEMETRY_MEMCACHED_PORT: 11211
141155
OPENTELEMETRY_REDIS_HOST: localhost
142156
OPENTELEMETRY_REDIS_PORT: 6379
157+
ORACLE_HOSTNAME: localhost
158+
ORACLE_PORT: 1521
159+
ORACLE_CONNECTSTRING: localhost:1521/freepdb1
160+
ORACLE_USER: otel
161+
ORACLE_PASSWORD: secret
162+
ORACLE_SERVICENAME: FREEPDB1
143163
POSTGRES_DB: otel_pg_database
144164
POSTGRES_HOST: localhost
145165
POSTGRES_PORT: 5432

.release-please-manifest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"plugins/node/opentelemetry-instrumentation-mysql2": "0.46.0",
5151
"plugins/node/opentelemetry-instrumentation-nestjs-core": "0.46.0",
5252
"plugins/node/opentelemetry-instrumentation-net": "0.44.0",
53+
"plugins/node/opentelemetry-instrumentation-oracledb": "0.26.0",
5354
"plugins/node/opentelemetry-instrumentation-pg": "0.52.0",
5455
"plugins/node/opentelemetry-instrumentation-pino": "0.47.0",
5556
"plugins/node/opentelemetry-instrumentation-redis": "0.47.0",

metapackages/auto-instrumentations-node/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ registerInstrumentations({
193193
- [@opentelemetry/instrumentation-mysql2](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-mysql2)
194194
- [@opentelemetry/instrumentation-nestjs-core](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-nestjs-core)
195195
- [@opentelemetry/instrumentation-net](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-net)
196+
- [@opentelemetry/instrumentation-oracledb](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-oracledb)
196197
- [@opentelemetry/instrumentation-pg](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-pg)
197198
- [@opentelemetry/instrumentation-pino](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-pino)
198199
- [@opentelemetry/instrumentation-redis](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-redis)

metapackages/auto-instrumentations-node/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"@opentelemetry/instrumentation-mysql2": "^0.46.0",
7979
"@opentelemetry/instrumentation-nestjs-core": "^0.46.0",
8080
"@opentelemetry/instrumentation-net": "^0.44.0",
81+
"@opentelemetry/instrumentation-oracledb": "^0.26.0",
8182
"@opentelemetry/instrumentation-pg": "^0.52.0",
8283
"@opentelemetry/instrumentation-pino": "^0.47.0",
8384
"@opentelemetry/instrumentation-redis": "^0.47.0",

metapackages/auto-instrumentations-node/src/utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import { MySQL2Instrumentation } from '@opentelemetry/instrumentation-mysql2';
4646
import { MySQLInstrumentation } from '@opentelemetry/instrumentation-mysql';
4747
import { NestInstrumentation } from '@opentelemetry/instrumentation-nestjs-core';
4848
import { NetInstrumentation } from '@opentelemetry/instrumentation-net';
49+
import { OracleInstrumentation } from '@opentelemetry/instrumentation-oracledb';
4950
import { PgInstrumentation } from '@opentelemetry/instrumentation-pg';
5051
import { PinoInstrumentation } from '@opentelemetry/instrumentation-pino';
5152
import { RedisInstrumentation as RedisInstrumentationV2 } from '@opentelemetry/instrumentation-redis';
@@ -124,6 +125,7 @@ const InstrumentationMap = {
124125
'@opentelemetry/instrumentation-mysql': MySQLInstrumentation,
125126
'@opentelemetry/instrumentation-nestjs-core': NestInstrumentation,
126127
'@opentelemetry/instrumentation-net': NetInstrumentation,
128+
'@opentelemetry/instrumentation-oracledb': OracleInstrumentation,
127129
'@opentelemetry/instrumentation-pg': PgInstrumentation,
128130
'@opentelemetry/instrumentation-pino': PinoInstrumentation,
129131
'@opentelemetry/instrumentation-redis': RedisInstrumentationV2,

package-lock.json

Lines changed: 138 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/opentelemetry-test-utils/src/test-utils.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ const dockerRunCmds = {
4242
'docker run --rm -d --name otel-mssql -p 1433:1433 -e MSSQL_SA_PASSWORD=mssql_passw0rd -e ACCEPT_EULA=Y mcr.microsoft.com/mssql/server:2022-latest',
4343
mysql:
4444
'docker run --rm -d --name otel-mysql -p 33306:3306 -e MYSQL_ROOT_PASSWORD=rootpw -e MYSQL_DATABASE=test_db -e MYSQL_USER=otel -e MYSQL_PASSWORD=secret mysql:5.7 --log_output=TABLE --general_log=ON',
45+
oracledb:
46+
'docker run --rm -d --name otel-oracledb -p 1521:1521 -e ORACLE_PASSWORD=oracle -e APP_USER=otel -e APP_USER_PASSWORD=secret gvenzl/oracle-free:slim',
4547
postgres:
4648
'docker run --rm -d --name otel-postgres -p 54320:5432 -e POSTGRES_PASSWORD=postgres postgres:16-alpine',
4749
redis: 'docker run --rm -d --name otel-redis -p 63790:6379 redis:alpine',

0 commit comments

Comments
 (0)