{"id":23819819,"url":"https://github.com/kth/kth-node-appinsights","last_synced_at":"2025-09-15T07:15:09.892Z","repository":{"id":165901582,"uuid":"641309227","full_name":"KTH/kth-node-appinsights","owner":"KTH","description":"Module for applicationinsights with common default settings","archived":false,"fork":false,"pushed_at":"2025-09-01T10:48:05.000Z","size":1168,"stargazers_count":0,"open_issues_count":9,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-06T14:58:53.615Z","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/KTH.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2023-05-16T07:56:11.000Z","updated_at":"2025-07-31T08:25:01.000Z","dependencies_parsed_at":"2025-02-12T14:27:57.794Z","dependency_job_id":"b7160081-b08f-4ac4-a964-acbbf5ae3a2a","html_url":"https://github.com/KTH/kth-node-appinsights","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/KTH/kth-node-appinsights","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fkth-node-appinsights","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fkth-node-appinsights/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fkth-node-appinsights/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fkth-node-appinsights/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KTH","download_url":"https://codeload.github.com/KTH/kth-node-appinsights/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KTH%2Fkth-node-appinsights/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273978830,"owners_count":25201409,"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","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-01-02T07:15:50.863Z","updated_at":"2025-09-15T07:15:09.841Z","avatar_url":"https://github.com/KTH.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @kth/appinsights\n\nA wrapper for the [applicationinsights](https://www.npmjs.com/package/applicationinsights) package.\n\nThis is intended for a standard use-case only. If your app needs more options, please use the core package instead.\n\n## Usage\n\nApplicationinsights works by injecting code that captures telemetry from the application.\nTo get full tracking, this package should be initialized as soon as possible in the code.\n\n```typescript\nimport { KthAppinsights } from '@kth/appinsights'\n\nKthAppinsights.init({ name: 'app-name' })\n```\n\nOptions\n\n```typescript\ntype appinsightOptions = {\n  name?: string // Optional. Name of the application\n  samplingPercentage?: number // Optional. Reduce the amount of telemetry collected\n}\n```\n\n## Features\n\n### Name and Instance name.\n\nThe if `name` is passed in the options, it will be used to set \"Cloud role name\" and \"Cloud role instance\".\n\n### User agent on requests\n\nIf a request has the `user-agent` header set, it will be saved in the custom property `user_agent`.\n\n### Unpack Bunyan messages\n\nBynyan messages (used by @kth/log) will be desctructured, and only the \"msg\" field kept, as all other information is duplicated on native data fields.\n\nExample:  \n`{ name: \"my-app\", level: 30, msg: \"the important part\" }` will be reduced to just `\"the important part\"`.\n\n### Telemetry Sampling\n\nUsed to reduce the amount of telemetry collected, primary used to reduce cost.\nEnable with option `samplingPercentage`. Default is 100% = everything is collected.\n\n### Track operations for Agenda jobs\n\n**This is not intended to be used on all agenda jobs. Only use ut when there is an actuall need.**  \nA helper that groups all events in a agenda-jobb in a tracable operation.\n\nExample:\n\n```typescript\nconst { AppinsightsUtils } = require('@kth/appinsights')\n\nagenda.define('operation_name', AppinsightsUtils.agendaRequestWrapper('operation_name', jobFunction))\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkth%2Fkth-node-appinsights","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkth%2Fkth-node-appinsights","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkth%2Fkth-node-appinsights/lists"}