Skip to content

fix: upgrade pino packages to allow pino ^8 #131

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

Closed
wants to merge 1 commit into from
Closed

fix: upgrade pino packages to allow pino ^8 #131

wants to merge 1 commit into from

Conversation

storyalex
Copy link

bumping to pino 8 works well in my use case.
the only breaking change in pino 8 compared to 7 is a deprecated option being removed.

See issue #115

@cla-checker-service
Copy link

❌ Author of the following commits did not sign a Contributor Agreement:
53a88c1

Please, read and sign the above mentioned agreement if you want to contribute to this project

@github-actions github-actions bot added agent-nodejs Make available for APM Agents project planning. community triage labels Nov 22, 2022
@apmmachine
Copy link
Contributor

❕ Build Aborted

The PR is not allowed to run in the CI yet

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Start Time: 2022-11-22T12:18:32.987+0000

  • Duration: 3 min 6 sec

Steps errors 2

Expand to view the steps failures

Load a resource file from a library
  • Took 0 min 0 sec . View more details here
  • Description: approval-list/elastic/ecs-logging-nodejs.yml
Error signal
  • Took 0 min 0 sec . View more details here
  • Description: githubApiCall: The REST API call https://api.github.com/orgs/elastic/members/storyalex return the message : java.lang.Exception: httpRequest: Failure connecting to the service https://api.github.com/orgs/elastic/members/storyalex : httpRequest: Failure connecting to the service https://api.github.com/orgs/elastic/members/storyalex : Code: 404Error: {"message":"User does not exist or is not a member of the organization","documentation_url":"https://docs.github.com/rest/reference/orgs#check-organization-membership-for-a-user"}

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@trentm
Copy link
Member

trentm commented Oct 25, 2023

Hi @storyalex. Thanks very much for the PR. My apologies for taking so long to respond.

These are dev dependencies,so shouldn't affect whether a user doing npm install @elastic/ecs-pino-format pino works with pino@8.

I just tested and it works for me:

% npm init -y
% npm install pino
% npm install @elastic/ecs-pino-format
% npm ls
asdf@1.0.0 /Users/trentm/tmp/asdf
├── @elastic/ecs-pino-format@1.4.0
└── pino@8.16.1

% cat basic.js
'use strict'
const ecsFormat = require('@elastic/ecs-pino-format')
const pino = require('pino')

const log = pino(ecsFormat())
log.info('Hello world')
const child = log.child({ module: 'foo' })
child.warn('From child')

% node basic.js
{"log.level":"info","@timestamp":"2023-10-25T21:11:25.490Z","process.pid":64534,"host.hostname":"pink.local","ecs.version":"1.6.0","message":"Hello world"}
{"log.level":"warn","@timestamp":"2023-10-25T21:11:25.491Z","process.pid":64534,"host.hostname":"pink.local","ecs.version":"1.6.0","module":"foo","message":"From child"}
[14:11:25 trentm@pink:~/tmp/asdf]

Another package I work on (elastic-apm-node) is using pino@8 and @elastic/ecs-pino-format: https://github.com/elastic/apm-agent-nodejs/blob/f617c33f8935a323673182d71953afcbba10d046/package.json#L89-L116


I'll look at adjusting the version of these deps that are installed. However, for the time being the devDependencies may stay at the older pino@6 for tests to work with Node.js v10, which this package still supports. pino@8 no longer supports Node.js v10.

I also have a PR coming that will periodically test @elastic/ecs-pino-format with pino@6, pino@7 and pino@8 to ensure compatibility hasn't broken.

@trentm trentm closed this Oct 25, 2023
@trentm trentm removed the triage label Oct 25, 2023
trentm added a commit that referenced this pull request Oct 25, 2023
We support pino@6, pino@7, pino@8, and winston@3.

Refs: #131
Refs: #115
@storyalex storyalex deleted the pino8 branch October 26, 2023 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning. community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants