Skip to content

Conversation

@TaprootFreak
Copy link
Collaborator

Summary

  • Add support for querying logs from all container apps via the debug endpoint
  • Currently only DFX API logs are accessible; this extends access to JuiceDollar, dEuro, Ponder apps etc.
  • Useful for investigating high log volumes and reducing Azure costs

Changes

  • Add ContainerApp enum with all container apps
  • Extend config with app-specific Application Insights IDs
  • Add optional app parameter to LogQueryDto
  • Update AppInsightsQueryService to use dynamic app ID
  • Extend log-debug.sh script with -a/--app parameter

Usage

# DFX API (default)
./scripts/log-debug.sh exceptions

# JuiceDollar API
./scripts/log-debug.sh exceptions -a juicedollarApi

# dEuro API
./scripts/log-debug.sh traces "error" -a deuroApi -h 24

# dEuro Monitoring
./scripts/log-debug.sh exceptions -a deuroMonitoring

Configuration Required

Add the Application Insights App IDs to the environment:

APPINSIGHTS_JUICEDOLLAR_API_APP_ID=<App ID from Azure Portal>
APPINSIGHTS_DEURO_API_APP_ID=<App ID from Azure Portal>
APPINSIGHTS_DEURO_MONITORING_APP_ID=<App ID from Azure Portal>
APPINSIGHTS_JUICESWAP_PONDER_APP_ID=<App ID from Azure Portal>
APPINSIGHTS_DEURO_PONDER_APP_ID=<App ID from Azure Portal>
APPINSIGHTS_REALUNIT_PONDER_APP_ID=<App ID from Azure Portal>

Test plan

  • Deploy to DEV and configure App IDs
  • Test ./scripts/log-debug.sh exceptions -a juicedollarApi
  • Verify logs from different container apps are accessible

- Add ContainerApp enum with all container apps (JuiceDollar, dEuro, etc.)
- Extend config with app-specific Application Insights IDs
- Add optional 'app' parameter to LogQueryDto
- Update AppInsightsQueryService to use dynamic app ID
- Extend log-debug.sh script with -a/--app parameter
- Document new env variables in .env.example

Allows querying logs from any container app via the debug endpoint:
  ./scripts/log-debug.sh exceptions -a juicedollarApi
  ./scripts/log-debug.sh traces "error" -a deuroApi -h 24
@github-actions
Copy link

github-actions bot commented Jan 13, 2026

⚠️ Security: 0 critical, 61 high vulnerabilities

Move ContainerApp enum from gs/dto to integration/infrastructure/enums
to respect layer architecture (integration should not import from domain).

The DTO re-exports the enum for backward compatibility.
Remove redundant fallback - apps.dfxApi and appId are identical.
@davidleomay
Copy link
Member

The other container apps (JuiceDollar, dEuro, Ponder) don't use Application Insights - they just log to the Log Analytics
workspace. This means they don't have App IDs, so the current approach won't work.

To query logs from these services, we'd need to:

  1. Query the Log Analytics API instead of the Application Insights API
  2. Filter by container app name in the KQL query, e.g.:
    ContainerAppConsoleLogs
    | where ContainerAppName == "juicedollar-api"
    | where Log contains "error"

This would require a different service/endpoint that uses the Log Analytics workspace ID and API key, not the Application Insights
credentials.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants