Installations
npm install dogapi
Score
93.9
Supply Chain
99.2
Quality
75.6
Maintenance
100
Vulnerability
99.3
License
Releases
Unable to fetch releases
Developer
Developer Guide
Module System
CommonJS
Min. Node Version
Typescript Support
No
Node Version
14.15.4
NPM Version
7.5.2
Statistics
105 Stars
260 Commits
45 Forks
2 Watching
7 Branches
19 Contributors
Updated on 19 Sept 2024
Bundle Size
121.79 kB
Minified
41.02 kB
Minified + Gzipped
Languages
JavaScript (64.5%)
HTML (35.5%)
Total Downloads
Cumulative downloads
Total Downloads
162,260,399
Last day
-18.5%
262,069
Compared to previous day
Last week
3.8%
1,610,237
Compared to previous week
Last month
12.1%
6,613,248
Compared to previous month
Last year
32.3%
55,302,422
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
dogapi
Datadog API Node.JS Client.
Official Datadog API Documentation: http://docs.datadoghq.com/api/
dogapi API Docs: http://brettlangdon.github.io/node-dogapi/
StatsD
dogapi
does not provide any functionality to talk to a local dogstatsd
server.
This library is purely an interface to the HTTP api.
If you are looking for a good Datadog StatsD library, I recommend checking out node-dogstatsd.
Installation
From NPM:
1[sudo] npm install dogapi
From source:
1git clone git://github.com/brettlangdon/node-dogapi.git 2cd ./node-dogapi 3npm install
Configuration
You will need your Datadog api key as well as an application key to use dogapi
.
Keys can be found at: https://app.datadoghq.com/account/settings#api
1var dogapi = require("dogapi"); 2 3var options = { 4 api_key: "YOUR_KEY_HERE", 5 app_key: "YOUR_KEY_HERE", 6 // if you are on the Datadog EU site, you need to overwrite the default value of api_host key: 7 // api_host: "app.datadoghq.eu" 8}; 9 10dogapi.initialize(options);
HTTPS Proxy
If you are behind a proxy you need to a proxy agent. You can use the https proxy agent from http://blog.vanamco.com/proxy-requests-in-node-js/ if you like. To configure dogapi with the agent just add it to the options.
1var dogapi = require("dogapi"); 2 3//Code from http://blog.vanamco.com/proxy-requests-in-node-js/ 4var HttpsProxyAgent = require("./httpsproxyagent"); 5 6var agent = new HttpsProxyAgent({ 7 proxyHost: "MY_PROXY_HOST", 8 proxyPort: 3128 9}); 10 11var options = { 12 api_key: "YOUR_KEY_HERE", 13 app_key: "YOUR_KEY_HERE", 14 proxy_agent: agent 15}; 16 17dogapi.initialize(options);
CLI Usage
dogapi
now ships with a command line interface dogapi
. To use it you
will need a .dogapirc
file which meets the standards of
https://github.com/dominictarr/rc
The config file must contain both api_key
and app_key
keys (you can find
your datadog api and app keys here
https://app.datadoghq.com/account/settings#api)
Example:
1{ 2 "api_key": "<API_KEY>", 3 "app_key": "<APP_KEY>" 4}
Usage
Please run dogapi --help
to see current usage documentation for the tool.
Every api method available in dogapi
is exposed via the cli tool.
Major changes from 1.x.x to 2.x.x
We have updated major versions for this library due to a backwards incompatible change to the argument format for dogapi.metric.send
and dogapi.metric.send_all
.
dogapi.metric.send
Previously in 1.x.x
:
1var now = parseInt(new Date().getTime() / 1000); 2dogapi.metric.send("metric.name", 50); 3dogapi.metric.send("metric.name", [now, 50]);
Now in 2.x.x
:
1var now = parseInt(new Date().getTime() / 1000); 2dogapi.metric.send("metric.name", 50); 3dogapi.metric.send("metric.name", [50, 100]); 4dogapi.metric.send("metric.name", [[now, 50]]);
dogapi.metric.send_all
Previously in 1.x.x
:
1var now = parseInt(new Date().getTime() / 1000); 2var metrics = [ 3 { 4 metric: "metric.name", 5 points: [now, 50] 6 }, 7 { 8 metric: "metric.name", 9 points: 50 10 } 11]; 12dogapi.metric.send_all(metrics);
Now in 2.x.x
:
1var now = parseInt(new Date().getTime() / 1000); 2var metrics = [ 3 { 4 metric: "metric.name", 5 points: [[now, 50]] 6 }, 7 { 8 metric: "metric.name", 9 points: [50, 100] 10 }, 11 { 12 metric: "metric.name", 13 points: 50 14 } 15]; 16dogapi.metric.send_all(metrics);
License
The MIT License (MIT) Copyright (c) 2013 Brett Langdon me@brett.is
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
5 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-xf5p-87ch-gxw2
- Warn: Project is vulnerable to: GHSA-5v2h-r2cx-5xgj
- Warn: Project is vulnerable to: GHSA-rrrm-qjm4-v8hf
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m / GHSA-xvch-5gv4-984h
Reason
Found 6/23 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 13 are checked with a SAST tool
Score
2.2
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More