Prerequisites
GitHub
Connect GitHub to search repositories, read files, and query PR history.
GitLab
Connect GitLab to search repositories, read files, and query MR history.
Code investigation queries don’t require the
@ targeting syntax. The copilot searches across all connected repositories automatically. Mention a specific repository name in your query to narrow the search.File Search and Reading
Find and read files across your connected repositories.Code Search
Search for specific functions, configurations, patterns, and definitions across repositories.Change History
Query recent PRs, commits, blame information, and diffs to understand what changed and why.Infrastructure-as-Code Lookup
Find and read Terraform, Helm, CloudFormation, and Pulumi definitions that manage your running infrastructure.Cross-Repository Search
Search across multiple repositories to trace configurations and dependencies.Example Conversation
You:
The payments-api is failing with connection refused errors when trying to reach the orders database. Can you find how the database host is configured?
Kestrel:
I searched across your connected repositories and found the database configuration in two places:You:The ConfigMap
- Application code —
acme/payments-service/src/config/database.tsreads theORDERS_DB_HOSTenvironment variable, falling back tolocalhost:5432if unset.- Kubernetes manifest —
acme/infrastructure/k8s/payments/deployment.yamlsetsORDERS_DB_HOSTtoorders-db.payments.svc.cluster.local:5432via a ConfigMap reference (payments-db-config).payments-db-configis defined inacme/infrastructure/k8s/payments/configmap.yaml. The current value on themainbranch isorders-db.payments.svc.cluster.local:5432.
Was this ConfigMap changed recently?Kestrel:
Yes. PR #312 inYou:acme/infrastructurewas merged 3 hours ago by @alex.kim. The PR changed theORDERS_DB_HOSTvalue fromorders-db.payments.svc.cluster.local:5432toorders-db-v2.payments.svc.cluster.local:5432as part of a database migration. The PR description mentions: “Point payments-api to the new PostgreSQL 16 instance.” However, I don’t see a corresponding Kubernetes Service namedorders-db-v2in thepaymentsnamespace — the service may not have been created yet, which would explain theconnection refusederrors.
Show me the Terraform code for the new database instance. Is it fully provisioned?Kestrel:
The new RDS instance is defined inacme/infrastructure/terraform/modules/rds/orders-db-v2.tf. It was added in PR #308, merged last week. The Terraform config provisions adb.r6g.largePostgreSQL 16.2 instance inus-east-1awith Multi-AZ enabled. The Terraform outputorders_db_v2_endpointis referenced in the Kubernetes Service definition inacme/infrastructure/k8s/payments/service-orders-db-v2.yaml— but this file was added in PR #313, which is still open and hasn’t been merged yet. That’s why the Service doesn’t exist in the cluster.
Next Steps
- Kubernetes Investigation — query pods, deployments, events, and metrics
- Cloud Investigation — inspect AWS and OCI resources and security configurations
- Cost Analysis — analyze AWS spend patterns and anomalies
- Configuration Changes — generate and apply YAML and Terraform changes