{"id":25963472,"url":"https://github.com/beincom/bic-node-profiling","last_synced_at":"2025-07-15T15:44:46.134Z","repository":{"id":238944637,"uuid":"798055346","full_name":"beincom/bic-node-profiling","owner":"beincom","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-16T11:08:37.000Z","size":509,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-04T20:41:22.055Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/beincom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-09T02:18:49.000Z","updated_at":"2024-05-16T11:08:40.000Z","dependencies_parsed_at":"2024-05-09T03:29:38.322Z","dependency_job_id":"aaf00a40-4361-414a-9449-e806d360d159","html_url":"https://github.com/beincom/bic-node-profiling","commit_stats":null,"previous_names":["beincom/bic-node-profiling"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/beincom/bic-node-profiling","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beincom%2Fbic-node-profiling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beincom%2Fbic-node-profiling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beincom%2Fbic-node-profiling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beincom%2Fbic-node-profiling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beincom","download_url":"https://codeload.github.com/beincom/bic-node-profiling/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beincom%2Fbic-node-profiling/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265443588,"owners_count":23766417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-04T20:38:53.350Z","updated_at":"2025-07-15T15:44:46.108Z","avatar_url":"https://github.com/beincom.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Getting started\n\n  ```\n  npm install @beincom/node-profile\n  # yarn add @beincom/node-profile\n  ```\n\n### Usage\n\n  ```\n    # app.module.ts\n    @Module({\n      imports: [\n        ProfileModule.forRootAsync({\n          useFactory: (configService: ConfigService) =\u003e {\n            const labels: Record\u003cstring, string | number\u003e = {\n              pod: process.env.pod,\n              version: process.env.version,\n            };\n\n            const tags: Record\u003cstring, string\u003e = {};\n\n            const profileConfig: ProfileConfig = {\n              serverAddress: pyroscope.serverAddress,\n              applicationName: process.env.APP_NAME,\n              tags: tags,\n              heap: {\n                samplingIntervalBytes: Number(process.env.HEAP_INTERVAL_BYTES), // 512 * 1024\n                stackDepth: Number(process.env.HEAD_STACK_DEPTH), // Maximum is 64\n              },\n              wall: {\n                samplingDurationMs: Number(process.env.WALL_DURATION), // 10 * 1000\n                samplingIntervalMicros: Number(process.env.WALL_INTERVAL), // 10 * 1000 * 1000\n              },\n            };\n\n            const profileService = new ProfileService(profileConfig);\n            profileService.setWallLabels(labels);\n            profileService.start();\n            return profileService;\n          },\n          inject: [ConfigService],\n        }),\n      ],\n      providers: [],\n      exports: [],\n    })\n    export class AppModule {}\n  ```\n\n### Test\n\n  ```\n  # pyroscope-config.yaml\n  log-level: debug\n  storage:\n    type: filesystem\n    path: /var/lib/pyroscope\n  scrape-configs:\n    - job-name: testing            # any name\n      enabled-profiles: [cpu, mem] # cpu and mem for cpu and heap\n      static-configs:\n        - application: rideshare\n          spy-name: nodespy        # make pyroscope know it's node profiles\n          targets:\n            - localhost:3001       # address of your scrape target\n          labels:\n            env: dev               # labels\n  ```\n\n  ```\n  # docker-compose.yaml\n  version: '3'\n\n  services:\n    pyroscope:\n      image: grafana/pyroscope:latest\n      ports:\n        - \"4040:4040\"\n      environment:\n        - PYROSCOPE_SERVER_TYPE=pyroscope\n        - PYROSCOPE_STORAGE_TYPE=filesystem\n        - PYROSCOPE_LOG_LEVEL=debug\n        - PYROSCOPE_LISTEN_ADDR=0.0.0.0:4040\n        - PYROSCOPE_STORAGE_PATH=/var/lib/pyroscope\n        - PYROSCOPE_MODE=pull\n      volumes:\n        - pyroscope-data:/var/lib/pyroscope\n        - ./pyroscope-config.yaml:/etc/pyroscope/pyroscope-config.yaml\n\n  volumes:\n    pyroscope-data:\n      driver: local\n      driver_opts:\n        type: 'none'\n        o: 'bind'\n        device: './pyroscope-data'\n  ```\n\n  ```\n  # Run this command:\n  docker-compose up -d --force-recreate\n  docker ps\n  ```\n\n  ![Container](./containers.png \"Container\")\n\n  ```\n  docker logs -f 6ba\n  ```\n\n  ![Logs](./logs.png \"Logs\")","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeincom%2Fbic-node-profiling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeincom%2Fbic-node-profiling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeincom%2Fbic-node-profiling/lists"}