![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@madgex/datadog-monitoring
Advanced tools
All your Hapi + Datadog needs, in one handy package.
When used as a module, this library exports hapi-pino and a function to set up dd-trace. You can use one or both of these in the setup file for your server like so:
const { pino, trace } = require('@madgex/datadog-monitoring');
async function createServer() {
await trace({
hostname: DD_AGENT_HOSTNAME || '',
service: 'my-service-name',
hapiOptions: {
blacklist: ['/healthcheck']
},
});
const Hapi = require('hapi');
const server = new Hapi.Server({
//etc
})
await server.register([
{
plugin: pino,
options: {
prettyPrint: IS_DEV,
level: LOG_LEVEL,
redact: ['req.headers.authorization'],
ignorePaths: ['/healthcheck'],
},
},
]);
return server;
}
Note that the tracer must be initialised before requiring Hapi, in order to correctly initialise the APM.
All available options for the dd-trace Hapi plugin can be passed as hapiOptions
. hostname
, if not set, will default to the discoverable Datadog agent host on AWS. The trace
function returns the tracer instance so further plugin configuration can be added if you wish, eg:
async function createServer() {
const tracer = await trace({
hostname: DD_AGENT_HOSTNAME || '',
service: 'my-service-name',
debug: true // enables debugging the tracer, do not enable in production
hapiOptions: {
blacklist: ['/healthcheck']
},
});
tracer.use('redis', { analytics: true });
// etc
}
The hapi-pino plugin should be set up as described in its documentation.
This library also includes a custom transport to pipe Pino logs from a server's stdout to a Datadog agent over UDP, transforming the JSON format for processing and display. Optionally it can also echo the transformed messages to stdout- however this flag should not be used in production. It should be used in your npm scripts like so:
"start": "dd-monitor /path/to/server.js --hostname [hostname] --port [port] --echo --debug"
Hostname and port relate to the Datadog agent to which the transport should transmit logs, and are optional. If not set, hostname will default first to a DD_AGENT_HOSTNAME environment variable, and then to looking up the discoverable host on AWS. Port will default to a Logging__DataDogLoggingPort environment variable, but the CLI tool will throw an error and exit if no port number can be found. Passing the debug flag will additionally log when a packet is transmitted to the UDP socket; this should also not be enabled in production.
FAQs
All your Hapi + Datadog needs, in one handy package.
The npm package @madgex/datadog-monitoring receives a total of 0 weekly downloads. As such, @madgex/datadog-monitoring popularity was classified as not popular.
We found that @madgex/datadog-monitoring demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.