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

Instrument PG #24

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
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: 12 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ jobs:
release:
name: Build
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: password
steps:
- uses: actions/setup-node@v2
with:
Expand All @@ -20,9 +26,15 @@ jobs:
- name: Test MySQL Connection
run: mysql -h localhost -u root -e 'SELECT version()'

- name: Test Postgres Connection
run: psql -h localhost -p 7432 -U root -c 'SELECT version()'

- name: Create test DB
run: mysql -h localhost -u root -e 'CREATE DATABASE test_db'

- name: Create test DB
run: psql -h localhost -p 7432 -U root -c 'CREATE DATABASE testdb'

- name: 🛎 Checkout
uses: actions/checkout@v3

Expand Down
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ process.on('SIGTERM', gracefullyShutdown);
2. [MySQL](#mysql)
3. [NestJS](#nestjs)
4. [Next.js](#nextjs)
5. [Postgres](#postgres)

### Express

Expand All @@ -69,7 +70,7 @@ openapm.instrument('express');

### MySQL

This currently supports instrumentation for all Node.js ORMs, which are [mysql2](https://www.npmjs.com/package/mysql2) compatible.
This currently supports instrumentation for all Node.js ORMs, that uses [mysql2](https://www.npmjs.com/package/mysql2).

Ensure to add this line of code before you initialize db `connection/pool/poolCluster`.

Expand All @@ -85,6 +86,14 @@ OpenAPM currently supports RED Metrics for NestJS v4 and above.
openapm.instrument('nestjs');
```

### Postgres

This currently supports instrumentation for all Node.js ORMs, that uses [pg](https://www.npmjs.com/package/pg).

```js
openapm.instrument('postgres');
```

### Next.js

OpenAPM supports RED metrics for both pages and app router in a Next.js application.
Expand Down
Loading
Loading