ovhemert / pino-datadog Goto Github PK
View Code? Open in Web Editor NEWπ²A transport for pino that sends messages to DataDog
License: MIT License
π²A transport for pino that sends messages to DataDog
License: MIT License
13.1.2
to 13.1.3
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
tap is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 4 commits.
6f014d0
13.1.3
72dc4fe
Support empty rejected promise in t.rejects
afde705
fixed directory
6ab6c49
update travis to include node 12 instead of 11
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
14.7.0
to 14.7.1
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
tap is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 7 commits.
876ab9c
14.7.1
5f23990
Always hook source map support into the right places
328487e
temporarily depend on tapjs git fork of source-map-support
fd7fe27
update async-hook-domain to fix stack overflows
bfb0610
docs: update fixtures doc links
355b20c
docs: update changelog
b59ef75
update cli doc
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
1.246.0
to 1.247.0
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
snyk is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
The new version differs by 4 commits.
e69ef82
Merge pull request #861 from snyk/feat/introduce-jar-files
e699598
feat: add *.war support
0189a39
chore: split up test and monitor tests
e845d19
feat: detect *.jar files as maven
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Please add TypeScript types to this project. It is written in JavaScript and does not bundle type definitions. If that's not possible, please consider adding types to @types/pino-datadog
.
I'm working on a project in TypeScript and would like to use this library to stream logs to Datadog.
While I could not find other pino loggers for Datadog, there are a few examples available for Winston that might serve as a starting point:
datadog-winston
: https://www.npmjs.com/package/datadog-winstonBefore you submit an issue we recommend you first check if an existing issue does not already exist.
Please read this entire template before posting any issue. If you ignore these instructions
and post an issue here that does not follow the instructions, your issue might be closed.
Using log.debug({ object }, "Debug message");
does not send into Datadog
Steps to reproduce the behavior:
Paste your code here:
import pino from "pino";
import datadog from "pino-datadog";
const streams = [
{ stream: process.stdout },
{
stream: datadog.createWriteStreamSync({
apiKey: process.env.DD_API_KEY,
ddtags: `env:${process.env.NODE_ENV}`,
eu: true,
});
}
];
const logger = pino( { level: "debug" }, pino.multistream(streams) );
logger.debug({ foo: "bar" }, "debug message");
A clear and concise description of what you expected to happen.
Paste the results here:
A message in Datadog with:
{"level":20,"time":1670932284621,"pid":214789,"hostname":"service.host","foo": "bar","msg":"debug message"}
1.230.8
to 1.231.0
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
snyk is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
The new version differs by 3 commits.
2791798
Merge pull request #792 from snyk/feat/multi-licenses-formatting
c802bc7
test: Update test to expect array
3a7e995
feat: Multi licenses formatting
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
14.10.0
to 14.10.1
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
tap is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
The new version differs by 4 commits ahead by 4, behind by 2.
1f18979
14.10.1
ca7d022
more consistent diffs for strings and objects
5bab844
update cli doc
eef0877
14.10.0
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
It would be great if the library logged an error to the console when encountering non-JSON lines.
When we first implemented pino-datadog, we had an existing configuration that looked at process.env.NODE_ENV
and used pinoβs prettyPrint when not in production
. Separately, we set the stream to either be process.stdout
or pino-datadog's writeStream, depending on the existence of process.env.DD_API_KEY
. This led to some confusion + debugging time, as it was failing silently locally (we've since changed our code to base both the log format and stream on process.env.DD_API_KEY).
Considering the library logs errors if the Axios request fails (also useful for debugging), I think it'd also be nice to log when JSON-parsing fails.
Hey,
Just wondering why this function is async?
Line 7 in 4875979
It makes it so that I can't use this in the top level of my file.
Thanks,
Manthan M
Hello , is multi-stream a requirement in order to setup pino-datadog ?
The CLI documentation states that you have to globally install the package for it to be used in this mode.
If you make the CLI executable (chmod +x src/cli.js
) however, the global install requirement is removed and you can install pino-datadog
as a normal dependency.
This is similar to how pino-pretty
works.
We use pino-datadog in all our projects and receive this advisory alert on every npm i
asaxios
is a dependency of pino-datadog
.
Please could you release a new version with the new axios version that has already been committed to master by snyk-bot
. I'm happy to do it if you share details on how you want it done?
Steps to reproduce the behaviour:
Paste your code here:
npm install pino-datadog
npm audit
Should not have any high severity vulnerabilities (or higher) that have already been resolved by dependency maintainers.
Hi,
You mention that the createWriteStreamAsync()
is "async for compatibility reasons". Does this mean it does not use a worker thread?
Thanks!
When including the -e
(or --eu
) CLI flag I get a status 403:
> node --unhandled-rejections=strict --optimize_for_size --max_old_space_size=115 --gc_interval=100 . | pino-datadog
{"level":30,"time":1574122975941,"pid":91734,"hostname":"[redacted]","msg":"App is running under env 'development', listening on port 8080, and has an available heap size of 113303784 bytes (~0.11GB)","v":1}
The previous log have not been saved
Request failed with status code 403
Error: Request failed with status code 403
at createError (/Users/devillexio/Developer/devillexio/pino-datadog/node_modules/axios/lib/core/createError.js:16:15)
at settle (/Users/devillexio/Developer/devillexio/pino-datadog/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/Users/devillexio/Developer/devillexio/pino-datadog/node_modules/axios/lib/adapters/http.js:237:11)
at IncomingMessage.emit (events.js:215:7)
at endReadableNT (_stream_readable.js:1183:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
The same config works when I exclude the flag.
Send log batches after timeout even if the batch is not complete.
Services may have non-uniform traffic patterns and as such, it may be the case that some logs take a long time before being submitted.
We could add a new option timeout
that default maybe to 30s? This option would mean that every timeout
seconds the stream will be flushed even if less than size
entries are present.
Currently, having the package included in a project as well as the datadog agent running with log collection enabled in the cluster means that logs are duplicated in the datadog interface, and the duplicated logs are neither tagged nor formatted correctly.
I've created a PR adding a commandline option for this here
1.239.5
to 1.240.0
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
snyk is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
The new version differs by 3 commits.
2248b5c
Merge pull request #807 from snyk/feat/replace-spinner
bf6c40e
feat: user external spinner in npm and monitor
05738b1
feat: introduce spinner lib to replace custom one
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Stream with option "size": 10 seems to behave really weird thus it won't send my Logs to the DataDog API but when I remove the options everything works fine.
Is there something broken with the implementation?
Because taken from the docs:
size
Type: String (optional)
The number of log messages to send as a single batch (defaults to 1).
What I would have expected was that if I want to send a single Log to the DataDog API that there shouldnt be a problem.
But as long as I kept that option no Log got through.
Hi,
I am trying to send my pino logs to datadog. I currently use pino like below.. would it be difficult to add pino-datadog on top ?
const config = require('../config')
var getNamespace = require('cls-hooked').getNamespace;
const pino = (config.nodeEnv == 'local') ? require('pino')({
transport: {
target: 'pino-pretty',
options: {
colorize: true
},
messageFormat: "[Request: {requestId}] {msg}",
ignore: "pid,hostname"
}
}) : require('pino')(require('pino').destination({ sync: false }));
//decorates with request id, user id and business id
const format = (obj_or_message) => {
let clsNamespace = getNamespace('app');
const request_id = clsNamespace.get("request_id")
const user_id = clsNamespace.get("user_id")
const business_id = clsNamespace.get("business_id")
if (typeof obj_or_message == 'object') {
return Object.assign(obj_or_message, { request_id: request_id, user_id: user_id, business_id: business_id })
} else {
return { request_id: request_id, user_id: user_id, business_id: business_id, message: obj_or_message }
}
}
const wrappedPino = {
debug: (obj) => {
pino.debug(format(obj))
},
warn: (obj) => {
pino.warn(format(obj))
},
info: (obj) => {
pino.info(format(obj))
},
error: (obj) => {
pino.error(format(obj))
},
}
module.exports = wrappedPino;
where do I specify my datadog key?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.