Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add mongodb plugin #205

Merged
merged 7 commits into from
Nov 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,24 @@ version: 2

test_env: &test_env
RUN_POSTGRES_TESTS: 1
RUN_MONGODB_TESTS: 1
POSTGRES_USER: postgres
POSTGRES_DB: circle_database
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
MONGODB_HOST: localhost
MONGODB_PORT: 27017
MONGODB_DB: opentelemetry-tests

postgres_service: &postgres_service
image: circleci/postgres:9.6-alpine
environment: # env to pass to CircleCI, specified values must match test_env
POSTGRES_USER: postgres
POSTGRES_DB: circle_database

mongo_service: &mongo_service
image: mongo

cache_1: &cache_1
key: npm-cache-01-{{ .Environment.CIRCLE_JOB }}-{{ checksum "/tmp/checksums.txt" }}-1
paths:
Expand All @@ -39,7 +46,7 @@ cache_2: &cache_2
- packages/opentelemetry-plugin-grpc/node_modules
- packages/opentelemetry-plugin-http/node_modules
- packages/opentelemetry-plugin-http2/node_modules
- packages/opentelemetry-plugin-mongodb/node_modules
- packages/opentelemetry-plugin-mongodb-core/node_modules
- packages/opentelemetry-plugin-redis/node_modules
- packages/opentelemetry-plugin-postgres/opentelemetry-plugin-pg/node_modules
- packages/opentelemetry-plugin-document-load/node_modules
Expand Down Expand Up @@ -145,18 +152,21 @@ jobs:
- image: node:8
environment: *test_env
- *postgres_service
- *mongo_service
<<: *node_unit_tests
node10:
docker:
- image: node:10
environment: *test_env
- *postgres_service
- *mongo_service
<<: *node_unit_tests
node12:
docker:
- image: node:12
environment: *test_env
- *postgres_service
- *mongo_service
<<: *node_unit_tests
node12-browsers:
docker:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# OpenTelemetry mongodb Instrumentation for Node.js
# OpenTelemetry mongodb-core Instrumentation for Node.js
[![Gitter chat][gitter-image]][gitter-url]
[![dependencies][dependencies-image]][dependencies-url]
[![devDependencies][devDependencies-image]][devDependencies-url]
[![Apache License][license-image]][license-image]

This module provides automatic instrumentation for [`mongodb`](https://github.com/mongodb/node-mongodb-native).
This module provides automatic instrumentation for [`mongodb-core`](https://github.com/mongodb-js/mongodb-core).

For automatic instrumentation see the
[@opentelemetry/node](https://github.com/open-telemetry/opentelemetry-js/tree/master/packages/opentelemetry-node) package.

## Installation

```bash
npm install --save @opentelemetry/plugin-mongodb
npm install --save @opentelemetry/plugin-mongodb-core
```

## Usage

```js
const opentelemetry = require('@opentelemetry/plugin-mongodb');
const opentelemetry = require('@opentelemetry/plugin-mongodb-core');

// TODO: DEMONSTRATE API
```
Expand All @@ -36,7 +36,7 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[gitter-url]: https://gitter.im/open-telemetry/opentelemetry-node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/master/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js/status.svg?path=packages/opentelemetry-plugin-mongodb
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-plugin-mongodb
[devDependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js/dev-status.svg?path=packages/opentelemetry-plugin-mongodb
[devDependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-plugin-mongodb&type=dev
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js/status.svg?path=packages/opentelemetry-plugin-mongodb-core
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-plugin-mongodb-core
[devDependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js/dev-status.svg?path=packages/opentelemetry-plugin-mongodb-core
[devDependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-plugin-mongodb-core&type=dev
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@opentelemetry/plugin-mongodb",
"name": "@opentelemetry/plugin-mongodb-core",
"version": "0.2.0",
"description": "OpenTelemetry mongodb automatic instrumentation package.",
"description": "OpenTelemetry mongodb-core automatic instrumentation package.",
"private": true,
"main": "build/src/index.js",
"types": "build/src/index.d.ts",
Expand All @@ -18,7 +18,7 @@
},
"keywords": [
"opentelemetry",
"mongodb",
"mongodb-core",
"nodejs",
"tracing",
"profiling",
Expand All @@ -40,22 +40,27 @@
"access": "public"
},
"devDependencies": {
"@opentelemetry/node": "^0.1.1",
"@opentelemetry/tracing": "^0.1.1",
"@types/mocha": "^5.2.7",
"@types/node": "^12.6.9",
"@types/mongodb": "^3.2.3",
"@types/node": "^12.7.2",
"@types/shimmer": "^1.0.1",
"codecov": "^3.6.1",
"gts": "^1.1.0",
"mocha": "^6.2.0",
"mongodb": "^3.3.0",
"nyc": "^14.1.1",
"rimraf": "^3.0.0",
"ts-mocha": "^6.0.0",
"ts-node": "^8.3.0",
"tslint-consistent-codestyle": "^1.15.1",
"tslint-consistent-codestyle": "^1.16.0",
"tslint-microsoft-contrib": "^6.2.0",
"typescript": "3.7.2"
},
"dependencies": {
"@opentelemetry/core": "^0.2.0",
"@opentelemetry/node": "^0.2.0",
"@opentelemetry/types": "^0.2.0"
"@opentelemetry/types": "^0.2.0",
"shimmer": "^1.2.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export * from './mongodb';
Loading