Skip to content

Commit

Permalink
HEAT-230 adding env var for app insights (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrlee authored May 2, 2024
1 parent a95a5bd commit fe309b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion helm_deploy/hmpps-component-dependencies/templates/_envs.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ env:
secretKeyRef:
name: {{ template "app.name" . }}
key: APPINSIGHTS_INSTRUMENTATIONKEY


- name: APPINSIGHTS_INSTRUMENTATIONKEY
value: "InstrumentationKey=$(APPINSIGHTS_INSTRUMENTATIONKEY);IngestionEndpoint=https://northeurope-0.in.applicationinsights.azure.com/;LiveEndpoint=https://northeurope.livediagnostics.monitor.azure.com/"

{{range .Values.appinsightEnvs }}
- name: {{ . }}_APPINSIGHTS_ID
valueFrom:
Expand Down
2 changes: 1 addition & 1 deletion src/utils/appInsights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function initialiseAppInsights({ applicationName, buildNumber }:
}

export async function flush(): Promise<void> {
if (process.env.APPINSIGHTS_INSTRUMENTATIONKEY) {
if (process.env.APPLICATIONINSIGHTS_CONNECTION_STRING) {
await defaultClient.flush()
}
}

0 comments on commit fe309b2

Please sign in to comment.