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.
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:
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
[x] run npm run test
[x] tests and/or benchmarks are included
[x] documentation is changed or added
[x] commit message and code follows Code Of Conduct
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.
Hi!
It seems that passing
hostname
to Datadog doesn't get translated intohost
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 sayssimons-mbp-2.lan
.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 ashost
in the data object:In order to not break the API, we can still have
hostname
parameter untouched, but also allow it to behost
to align with Datadog's naming.This is the test output. Please advise if you want it in any other format.
Checklist
npm run test