Skip to content

Commit

Permalink
chore(bff): add native nodejs metrics for application insights (#1012)
Browse files Browse the repository at this point in the history
<!--- Fortell kort hva PR-en din inneholder i to-tre setninger maks. -->

## Hva er endret?
<!--- Gi en mer detaljert beskrivelse av hva endringene dine innebærer ved behov, med eventuelle marknader -->

Adds the native nodejs metrics scraper to application insights. Installing is enough, application insights package will pick it up and start collecting metrics. 

It will give us:
- Garbage collection: The amount of CPU time spent on each type of garbage collection, and how many occurrences of each type.
- Event loop: How many ticks occurred and how much CPU time was spent in total.
- Heap vs. non-heap: How much of your app's memory usage is in the heap or non-heap.

which is very nice to have when issues arise in the nodejs service

https://learn.microsoft.com/en-us/azure/azure-monitor/app/nodejs#extended-metrics

Related to Altinn/dialogporten#1027 and Altinn/dialogporten#1042

### Dokumentasjon / Storybook / testdekning
<!--- Oppgi om du har lagt til eller oppdatert dokumentasjonen som er relevant for endringene. Enten i Readme eller i Docosauros på `./packages/docs/docs` -->

- [ ] Dokumentasjon er oppdatert eller ikke relevant / nødvendig.
- [ ] Ny komponent har en eller flere `stories` i `Storybook`, eller så er ikke dette relevant.
- [ ] Det er blitt lagt til nye tester / eksiterende tester er blitt utvidet, eller tester er ikke relevant.

### Skjermbilder eller GIFs (valgfritt)
<!--- Det er alltid nyttig å inkludere skjermbilder eller GIFs for å vise frem endringene visuelt, spesielt for UI-relaterte endringer. -->
  • Loading branch information
arealmaas authored Aug 27, 2024
1 parent 33c6379 commit 2d3f6f0
Show file tree
Hide file tree
Showing 2 changed files with 854 additions and 131 deletions.
3 changes: 2 additions & 1 deletion packages/bff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"@graphql-tools/stitch": "^9.2.7",
"@graphql-tools/utils": "^10.2.0",
"@graphql-tools/wrap": "^10.0.5",
"applicationinsights": "^2.9.0",
"applicationinsights": "3.2.2",
"applicationinsights-native-metrics": "0.0.11",
"axios": "^1.6.2",
"azure-app-configuration": "^0.0.1-security.3",
"connect-redis": "^7.1.1",
Expand Down
Loading

0 comments on commit 2d3f6f0

Please sign in to comment.