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

Pass host to DD, not hostname #89

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

simonauner
Copy link

Hi!

It seems that passing hostname to Datadog doesn't get translated into host on their end.

See this screenshot where hostname is passed in the data object of the log, but not shown in the log entry - it says simons-mbp-2.lan.

image

For the other log I have applied my change in this PR, and we can see that host in the log entry corresponds to what I sent as host in the data object:

image

In order to not break the API, we can still have hostname parameter untouched, but also allow it to be host to align with Datadog's naming.

This is the test output. Please advise if you want it in any other format.

# simonauner at simons-mbp-2.lan in ~/code/pino-datadog on git:rename-hostname-to-host ✖︎ [12:21:35]
→ npm test

> pino-datadog@2.0.2 test /Users/simonauner/code/pino-datadog
> standard && tap test/*.test.js --coverage --100

 PASS  test/streams.test.js 15 OK 36.545ms
 PASS  test/index.test.js 2 OK 20.579ms
test/datadog.test.js 2> The previous log have not been saved
test/datadog.test.js 2> Error
test/datadog.test.js 2> Error: Error
test/datadog.test.js 2>     at Object.rejects (/Users/simonauner/code/pino-datadog/node_modules/sinon/lib/sinon/default-behaviors.js:193:22)
test/datadog.test.js 2>     at Object.proto.<computed> [as rejects] (/Users/simonauner/code/pino-datadog/node_modules/sinon/lib/sinon/behavior.js:238:12)
test/datadog.test.js 2>     at Function.<anonymous> (/Users/simonauner/code/pino-datadog/node_modules/sinon/lib/sinon/behavior.js:231:46)
test/datadog.test.js 2>     at Test.<anonymous> (/Users/simonauner/code/pino-datadog/test/datadog.test.js:19:46)
test/datadog.test.js 2>     at TapWrap.runInAsyncScope (async_hooks.js:197:9)
test/datadog.test.js 2>     at Test.cb (/Users/simonauner/code/pino-datadog/node_modules/tap/lib/test.js:147:40)
test/datadog.test.js 2>     at /Users/simonauner/code/pino-datadog/node_modules/tap/lib/test.js:385:21
test/datadog.test.js 2>     at Test.main (/Users/simonauner/code/pino-datadog/node_modules/tap/lib/test.js:392:7)
test/datadog.test.js 2>     at TapWrap.runInAsyncScope (async_hooks.js:197:9)
test/datadog.test.js 2>     at Test.runMain (/Users/simonauner/code/pino-datadog/node_modules/tap/lib/base.js:193:15)
 PASS  test/datadog.test.js 17 OK 56.717ms

                         
  🌈 SUMMARY RESULTS 🌈  
                         

Suites:   3 passed, 3 of 3 completed
Asserts:  34 passed, of 34
Time:     1s
------------|----------|----------|----------|----------|-------------------|
File        |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
------------|----------|----------|----------|----------|-------------------|
All files   |      100 |      100 |      100 |      100 |                   |
 datadog.js |      100 |      100 |      100 |      100 |                   |
 index.js   |      100 |      100 |      100 |      100 |                   |
 streams.js |      100 |      100 |      100 |      100 |                   |
------------|----------|----------|----------|----------|-------------------|

> pino-datadog@2.0.2 posttest /Users/simonauner/code/pino-datadog
> tap --coverage --coverage-report=lcovonly

Checklist

  • run npm run test
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message and code follows Code Of Conduct

@simonauner simonauner marked this pull request as ready for review August 23, 2022 10:27
@stale
Copy link

stale bot commented Nov 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant