-
Notifications
You must be signed in to change notification settings - Fork 11
Error Logging
How-to guide. Read errors from an EPIC product, or connect a new one to Application Insights.
Every product reports to one Application Insights component per environment:
-
eagle-insights-test— resource groupc4b0a8-test-rg, subscriptionc4b0a8-test -
eagle-insights-prod— resource grouprg-eagle-public-prod, subscriptionc4b0a8-prod
Both are backed by a Log Analytics workspace, region canadacentral, 30-day retention, daily
ingestion cap 0.15 GB (test) / 0.25 GB (prod). The workspace is eagle-logs-test in test and
eagle-logs-prod in prod, both defined in the eagle-edge repo, azure/modules/observability.bicep.
eagle-public, eagle-admin, eagle-demi-frontend and eagle-demi-admin all report here, on both
environments. eagle-api reports here too, on test and prod, via OpenTelemetry (secret
eagle-api-appinsights); it is not connected on dev. Products are told apart by the AppRoleName
column.
eagle-demi (the API) and eagle-notify report to their own components, demi-insights-<env> and
notify-insights-<env>, not this one.
- Open the environment's Log Analytics workspace (
eagle-logs-testoreagle-logs-prod, see above) in the Azure portal, or run queries with:az monitor log-analytics query -w <workspace customer id> --analytics-query "<kql>"
- Filter every query by
AppRoleNameto isolate one product (eagle-public,eagle-admin,eagle-demi-frontend,eagle-demi-admin).
AppExceptions
| where TimeGenerated > ago(24h)
| summarize count() by AppRoleName, ProblemId
| order by count_ descunion AppRequests, AppDependencies, AppExceptions, AppTraces
| where OperationId == "<id>"
| order by TimeGenerated ascAppDependencies
| where Success == false
| summarize count() by AppRoleName, Target, ResultCode
| order by count_ descUsage
| where TimeGenerated > ago(7d) and IsBillable
| summarize GB=sum(Quantity)/1024 by DataType
| order by GB descAppExceptions
| where TimeGenerated > ago(7d)
| summarize count() by AppRoleName, ExceptionType
| order by count_ desceagle-public, eagle-admin, eagle-demi-frontend and eagle-demi-admin send: uncaught
exceptions, unhandled promise rejections, failed fetch/XHR requests (URL and status code), and
render crashes. Query strings are stripped before send. Successful requests and route page views
are not sent.
- Read the connection string (it is not a secret):
az monitor app-insights component show -g <rg> -a eagle-insights-<env> --query connectionString -o tsv
- Set two app settings on the service:
APPLICATIONINSIGHTS_CONNECTION_STRINGandOTEL_SERVICE_NAME=<product>. - In the Node code, call
@azure/monitor-opentelemetry'suseAzureMonitorbefore any otherrequire. Seeeagle-demi'sapi/index.jsfor the pattern.
The connection string lives in eagle-api's Config document, not in an app setting, and eagle-api
reads it at startup.
- Read the connection string as above.
- Shell into the environment's MongoDB pod:
oc -n 6cdc9e-<env> rsh deploy/eagle-api-mongodb
- Connect with
mongosh, using theMONGODB_USER/MONGODB_PASSWORDvalues from secreteagle-api-mongodb:mongosh -u <MONGODB_USER> -p <MONGODB_PASSWORD> --authenticationDatabase admin epic
- Set the value on the
Configdocument:db.epic.updateOne( { _schemaName: 'Config' }, { $set: { APPINSIGHTS_CONNECTION_STRING: '<value>' } } )
- Restart eagle-api to pick up the change:
oc -n 6cdc9e-<env> rollout restart deploy/eagle-api
- Verify the frontends can read it:
curl -s https://<env host>/api/config | jq .APPINSIGHTS_CONNECTION_STRING
An empty string turns browser telemetry off. See Configuration Management
for how /api/config serves this key.
Set APPINSIGHTS_CONNECTION_STRING in the app's env.js.
Ingestion costs 3.83 CAD/GB in canadacentral (measured 2026-09-02). The workspace daily cap
stops ingestion for the rest of the UTC day once reached.
Eagle Documentation
Operations
- Deployment Pipeline
- Helm Charts
- Reverse Proxy
- Rollback Procedures
- Eagle Public Release Lines
- Eagle Search Archive
- Azure Migration Strategy
- Azure Hosting
- Front Door Per-App Split
- Error Logging
- Secrets Management
Architecture
- Architecture Overview
- API Architecture
- Analytics Architecture
- Angular Patterns
- Eagle Public Page Layout
- Eagle Public Adding A Page
- ENGAGE–EAGLE Integration
- BCGW Project Export
- Eagle Search
- Document Content Search
- Eagle DEMI
- Project Data Models
- Async Jobs API
- Bulk Document Download
Configuration
Help
Repositories
Environments