# Wetech Btwallet Datasource ID

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "wetech-btwallet-datasource-id-2026-08-13",
  "problems": [
    {
      "problemId": "wetech-btwallet-restricted-datasource-resolution",
      "summary": "Btwallet Grafana exposes dashboard panels and Prometheus proxy queries but denies datasource listing and individual datasource lookup APIs.",
      "status": "optimized_verified",
      "issueKeys": ["APID-29226"],
      "sourceRefs": ["https://tidb.atlassian.net/browse/APID-29226#problem:diagnostic_gap:restricted-datasource-resolution-regression"],
      "signalTextIncludesAny": ["selected datasource name could not be resolved", "Permission denied", "datasource proxy ID"],
      "observedThrough": "2026-08-13",
      "effectiveAt": "2026-08-13T16:52:00+08:00",
      "verifiedAt": "2026-08-13T17:10:00+08:00",
      "attemptedAction": "Use the live-verified origin-local datasource proxy ID 2 for the single configured btwallet Grafana origin and bypass denied datasource discovery APIs.",
      "evidenceUrl": "https://github.com/tidbcloud/aisupport/pull/877"
    }
  ]
}
-->

- Owner: auto-oncall-services Wetech provider inventory
- Source: live user-authorized `btwallet` Grafana query on 2026-08-13
- Bounded problem: the Grafana account can query proxy ID `2`, but cannot list
  or resolve datasource metadata by name.
- Implementation status: merged in `tidbcloud/aisupport#877` and deployed to
  staging as image `b57324bb4cc5671bf32b22b47fd9993ec3d182a6`.
- Effective status: optimized and verified.

## Verification evidence

- The copied browser request to `/api/datasources/proxy/2/api/v1/query_range`
  returned HTTP 200, one series, and 121 points.
- `/api/datasources` returned HTTP 403 while the same dashboard remained
  readable, proving the failure was discovery permission rather than metric
  availability.
- The bundled helper in the deployed merged image queried `btwallet` using
  configured datasource ID `2`, returned HTTP 200 with one series and 11
  points, and did not require datasource-list access.

## Unresolved gaps

- Datasource ID `2` is verified only for the configured primary Grafana
  origin. No unverified standby origin is configured for this selector.

## Next validation action

Re-verify the numeric datasource ID before adding or changing a btwallet
Grafana origin.
