Skip to content

Commit

Permalink
feat(instrumentation-pino): bump supported pino version to v7.x (open…
Browse files Browse the repository at this point in the history
…-telemetry#724)

Co-authored-by: Rauno Viskus <[email protected]>
Co-authored-by: Tine Jozelj <[email protected]>
Co-authored-by: Valentin Marchaud <[email protected]>
  • Loading branch information
4 people authored Nov 17, 2021
1 parent 28e2113 commit aff24b8
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 8 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jobs:
- container: "node:8"
lerna-extra-args: >-
--ignore @opentelemetry/instrumentation-aws-sdk
--ignore @opentelemetry/instrumentation-pino
- container: "node:10"
lerna-extra-args: >-
--ignore @opentelemetry/instrumentation-pino
runs-on: ubuntu-latest
container:
image: ${{ matrix.container }}
Expand Down
6 changes: 6 additions & 0 deletions plugins/node/opentelemetry-instrumentation-pino/.tav.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
pino:
versions: ">=5.14.0 < 8"
commands: npm run test

# Fix missing `contrib-test-utils` package
pretest: npm run --prefix ../../../ lerna:link
2 changes: 1 addition & 1 deletion plugins/node/opentelemetry-instrumentation-pino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ When no span context is active or the span context is invalid, injection is skip

### Supported versions

`>5.14.0` and `6.x`
`>=5.14.0 <8`

## Useful links

Expand Down
7 changes: 4 additions & 3 deletions plugins/node/opentelemetry-instrumentation-pino/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"repository": "open-telemetry/opentelemetry-js-contrib",
"scripts": {
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
"test-all-versions": "tav",
"tdd": "npm run test -- --watch-extensions ts --watch",
"clean": "rimraf build/*",
"lint": "eslint . --ext .ts",
Expand Down Expand Up @@ -59,15 +60,15 @@
"gts": "3.1.0",
"mocha": "7.2.0",
"nyc": "15.1.0",
"pino": "6.13.0",
"rimraf": "3.0.2",
"sinon": "11.1.2",
"test-all-versions": "5.0.1",
"ts-mocha": "8.0.0",
"typescript": "4.3.5"
},
"dependencies": {
"@opentelemetry/instrumentation": "^0.26.0",
"@types/pino": "6.3.11",
"pino": "7.2.0",
"semver": "^7.3.5"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ import {
} from '@opentelemetry/instrumentation';
import { Pino, PinoInstrumentationConfig } from './types';
import { VERSION } from './version';
import type * as pino from 'pino';
import type { pino } from 'pino';

const pinoVersions = ['>=5.14.0 <7'];
const pinoVersions = ['>=5.14.0 <8'];

export class PinoInstrumentation extends InstrumentationBase {
constructor(config: PinoInstrumentationConfig = {}) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import { Span } from '@opentelemetry/api';
import { InstrumentationConfig } from '@opentelemetry/instrumentation';
import type * as pino from 'pino';
import type { pino } from 'pino';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type LogHookFunction = (span: Span, record: Record<string, any>) => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { AsyncHooksContextManager } from '@opentelemetry/context-async-hooks';
import { Writable } from 'stream';
import * as assert from 'assert';
import * as sinon from 'sinon';
import type * as Pino from 'pino';
import type { pino as Pino } from 'pino';

import { PinoInstrumentation } from '../src';

Expand Down

0 comments on commit aff24b8

Please sign in to comment.