Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node Agent System Metrics #1

Open
wants to merge 37 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c87eb51
add webstorm stuff
leonardoventurini Aug 3, 2023
5de1855
add poc diagram
leonardoventurini Aug 4, 2023
a3e56e0
setup npm project
leonardoventurini Aug 4, 2023
ab060c6
add webstorm settings file
leonardoventurini Aug 4, 2023
82d6c0d
adjust description
leonardoventurini Aug 4, 2023
d426f12
add plan
leonardoventurini Aug 4, 2023
dbe31f2
add event loop monitor
leonardoventurini Aug 15, 2023
93f85c8
add ide configs
leonardoventurini Aug 15, 2023
a692a60
add gc
leonardoventurini Aug 15, 2023
e1d2ec3
add version supported note
leonardoventurini Aug 15, 2023
d629fc5
add packages
leonardoventurini Aug 15, 2023
81815cd
add retry
leonardoventurini Aug 16, 2023
d7a3187
add environment constants
leonardoventurini Aug 16, 2023
251bdff
add ntp
leonardoventurini Aug 16, 2023
45d3dea
add doc sz cache and tests
leonardoventurini Aug 17, 2023
4fa5701
add process types
leonardoventurini Aug 17, 2023
84d817f
add tests for ntp
leonardoventurini Aug 17, 2023
83853da
make ntp a singleton
leonardoventurini Aug 17, 2023
03fe903
add packages
leonardoventurini Aug 18, 2023
d6a7973
adjust types
leonardoventurini Aug 18, 2023
a968b03
adjust import
leonardoventurini Aug 18, 2023
2bd0e10
commit webstorm config
leonardoventurini Aug 18, 2023
2640ca3
add base system class
leonardoventurini Aug 18, 2023
d1e2d2c
add config package
leonardoventurini Aug 28, 2023
3e18c8c
plug system model
leonardoventurini Aug 28, 2023
7daa79b
add eslint and prettier
leonardoventurini Aug 28, 2023
88ce15b
add base demo app
leonardoventurini Aug 29, 2023
11d75c1
use cosmiconfig and environment variables
leonardoventurini Aug 30, 2023
2d798d5
schedule send payload
leonardoventurini Aug 30, 2023
2f62389
remove non existent function call
leonardoventurini Aug 30, 2023
2383120
add event loop monitor tests
leonardoventurini Aug 31, 2023
0619175
add config tests
leonardoventurini Aug 31, 2023
ce325c7
add tests for gc
leonardoventurini Aug 31, 2023
7ac6d62
add tests for retry
leonardoventurini Aug 31, 2023
4449d15
remove unused code and add tests
leonardoventurini Aug 31, 2023
333de06
send node version
leonardoventurini Sep 1, 2023
3032bed
adjust readme
leonardoventurini Sep 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[*]
indent_size = 2
ij_any_spaces_within_braces = true
ij_javascript_spaces_within_imports = true
ij_typescript_spaces_within_imports = true
ij_javascript_import_sort_members = true
ij_typescript_import_sort_members = true
max_line_length = 80
ij_javascript_force_semicolon_style = true
ij_typescript_force_semicolon_style = true
32 changes: 32 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = {
plugins: ['prettier'],
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
parser: '@typescript-eslint/parser',
root: true,
rules: {
'no-console': 0,
'no-inner-declarations': 0,
'arrow-parens': ['error', 'always'],
semi: ['error', 'always'],
},
env: {
node: true,
},
overrides: [
{
files: ['*.ts'],
extends: ['plugin:@typescript-eslint/recommended'],
rules: {
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-empty-interface': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/no-unused-vars': 0,
'@typescript-eslint/no-this-alias': 0,
'@typescript-eslint/ban-ts-comment': 0,
'@typescript-eslint/no-namespace': 0,
'@typescript-eslint/no-empty-function': 0,
},
},
],
};
59 changes: 59 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
pids
*.pid
*.seed
*.pid.lock
lib-cov
coverage
*.lcov
.nyc_output
.grunt
bower_components
.lock-wscript
build/Release
node_modules/
jspm_packages/
web_modules/
*.tsbuildinfo
.npm
.eslintcache
.stylelintcache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
.node_repl_history
*.tgz
.yarn-integrity
.env
.env.development.local
.env.test.local
.env.production.local
.env.local
.cache
.parcel-cache
.next
out
.nuxt
dist
.cache/
.vuepress/dist
.temp
.docusaurus
.serverless/
.fusebox/
.dynamodb/
.tern-port
.vscode-test
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
5 changes: 5 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/git_toolbox_prj.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/jsLibraryMappings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/jsLinters/eslint.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/node-agent.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
semi: true,
trailingComma: "all",
singleQuote: true,
printWidth: 80,
tabWidth: 2,
bracketSpacing: true,
arrowParens: "always",
};
25 changes: 25 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "https://json.schemastore.org/swcrc",
"jsc": {
"parser": {
"syntax": "typescript",
"decorators": true,
"dynamicImport": true
},
"baseUrl": "./",
"paths": {
"@/*": [
"src/*"
]
}
},
"env": {
"targets": {
"node": "12"
},
},
"module": {
"type": "commonjs"
},
"sourceMaps": true
}
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
# Node.js Agent

What we track:

- Node.js version
- Node.js agent version
- Hosts
- CPU
- Memory
- Event Loop Latency
- Garbage Collection Duration

# Supported Versions

Node.js 12 and above.
3 changes: 3 additions & 0 deletions demo/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MONTI_APP_ID=
MONTI_APP_SECRET=
MONTI_ENDPOINT=http://localhost:11011
2 changes: 2 additions & 0 deletions demo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
node_modules
1 change: 1 addition & 0 deletions demo/.montirc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hostname: 'localhost'
10 changes: 10 additions & 0 deletions demo/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import '@monti-apm/agent';

let count = 0;

console.log(process.env.MONTI_APP_ID);

setInterval(() => {
count += 1;
console.log(count);
}, 1000);
13 changes: 13 additions & 0 deletions demo/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions demo/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "demo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"type": "module",
"scripts": {
"start": "node -r dotenv/config index.js"
},
"keywords": [],
"author": "Monti APM",
"license": "MIT",
"dependencies": {
"dotenv": "^16.3.1"
}
}
9 changes: 9 additions & 0 deletions diagrams/BOOTSTRAP.mmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Bootstrap
---
graph
A[Kadira._startInstrumenting] -- attempt to connect with env first --> B[Kadira._connectWithEnv]
A -- with settings afterwards --> C[Kadira._connectWithSettings]

B --> D[Kadira.connect]
C -- after each the `connect` method is overridden so it throws whenever it is called again --> D
Loading