diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..69d47f6 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @gymshark/platform @gymshark/customer diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..70c786c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +version: 2 +updates: + - package-ecosystem: "npm" + directory: / + rebase-strategy: "disabled" + schedule: + interval: weekly + groups: + all: + patterns: + - "*" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..1ad0a19 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,11 @@ +## JIRA ticket link/s + +- [EXAMPLE-123](https://gymshark-web.atlassian.net/browse/EXAMPLE-123) + +## Summary of changes + +1. [ Provide some key summary of changes to give context as to why these changes have been made ] + +## Additional Info + +_[Any additional info such as screenshots or postman collections,etc that will help the reviewer review your changes]_ diff --git a/.gitignore b/.gitignore index c6bba59..390c5a9 100644 --- a/.gitignore +++ b/.gitignore @@ -10,41 +10,10 @@ lerna-debug.log* # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov - -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - # Dependency directories node_modules/ jspm_packages/ -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - # TypeScript cache *.tsbuildinfo @@ -57,15 +26,6 @@ web_modules/ # Optional stylelint cache .stylelintcache -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - # Output of 'npm pack' *.tgz @@ -79,46 +39,6 @@ web_modules/ .env.production.local .env.local -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# vuepress v2.x temp and cache directory -.temp -.cache - -# Docusaurus cache and generated files -.docusaurus - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - # Stores VSCode versions used for testing VSCode extensions .vscode-test @@ -128,3 +48,7 @@ dist .yarn/build-state.yml .yarn/install-state.gz .pnp.* + +#IDEs +.idea/ +.vscode/ \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..962fa04 --- /dev/null +++ b/README.md @@ -0,0 +1,44 @@ +# DataDog Client JS + +This is an opinionated client for integrating with DataDog directly for logging and metrics. +This package is designed to be a wrapper for simplifying the instantiation of existing package implementations. + +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/51830d3cc410417c94543df82dc09a6f)](https://app.codacy.com/gh/gymshark/datadog-client-js/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) + +## Requirements + +* Node 18.x or higher +* Datadog API and App Key + +## Installation + +```bash +npm install @gymshark/datadog-client +``` +or +```bash +yarn add @gymshark/datadog-client +``` + +## Usage + +### Logger Client +The logging client returns [winston](https://www.npmjs.com/package/winston) logging client that includes a HTTP transport for sending logs to DataDog. +Some of the winston logger options are preset to ensure that logs are sent to DataDog in a JSON format, but any of the winston configuration can be overridden. + + +```javascript + +``` + + +#### Logger Options + +### Metric Client +The metric client instantiation either returns [datadog-metrics](https://www.npmjs.com/package/datadog-metrics) metric client or if sampling is enabled, it will return a no-op client that will not send metrics to DataDog. + +```javascript + +``` + +#### Metric Options \ No newline at end of file