@@ -17,5 +17,7 @@ This page lists runbooks used by the Secret Detection team for monitoring, mitig
*[Monitoring](secret-detection-svc-monitoring)
* _Troubleshooting (TBA, once we complete [#494910](https://gitlab.com/gitlab-org/gitlab/-/issues/494910) and [#499249](https://gitlab.com/gitlab-org/gitlab/-/issues/499249))_
- Action: Check if systemic (all partners) or partner-specific. For more information, see the [troubleshooting](secret-detection-validity-check-troubleshooting.md#partner-api-high-latency) section.
- Action: For more information, see the [troubleshooting](secret-detection-validity-check-troubleshooting.md#rate-limits-hit-frequently) section.
### `SecretDetectionPartnerAPINetworkErrors`
- Severity: S3
- Threshold: > 0.5 errors/sec, 5+ min
- Check: **Network Errors by Partner** chart
- Action: Identify error type (`Timeout`, `ConnectionRefused`, `HTTPError`). For more information, see the [troubleshooting](secret-detection-validity-check-troubleshooting.md#network-errors-to-partner-apis) section.
Real-time error rate (%) across all partners. Combines success and failure counts. Alert fires if the rate exceeds 10%.
### API Response Time (P95)
95th percentile latency for each partner API call. Spikes indicate partner slowdowns. Alert fires if the latency exceeds 5 seconds for 5 or more minutes.
### Rate Limit Hits
Current rate at which partner limits are being hit (req/sec). Zero is healthy. Alert fires if the rate exceeds 0.1 req/sec.
### Requests per Second by Partner
API call volume to each partner. Use to see usage patterns.
### Success Rate by Partner
Percentage of successful verifications per partner. Should stay above 95%.
- If partner has known incident (< 1 hour): Wait for recovery
- If network error (multiple partners): Coordinate with SRE in#production
- If response error: Likely API contract change - file issue in`#g_ast-secret-detection`
- If persistent (> 6 hours): [Disable partner](#disable-partners)
## Partner API high latency
### Symptom
P95 latency exceeds 5 seconds on the [dashboard](https://dashboards.gitlab.net/d/secret-detection-sd-partner-token-verify/93b6ec2)(alert: `SecretDetectionPartnerAPIHighLatency`).
### Investigation
1. Check if systemic (all partners) or partner-specific.
1. Review partner status pages for degraded performance.
1. Test partner API from teleport Rails console:
```ruby
uri = URI('https://sts.amazonaws.com/')
start = Time.now
Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
http.request(Net::HTTP::Get.new(uri.path))
end
puts "Latency: #{Time.now - start}s"
```
### Resolution
- P95 less than 10 seconds and improving: Monitor—issue resolves itself
Exceeds 0.1 req/sec sustained for 5 or more minutes on the [dashboard](https://dashboards.gitlab.net/d/secret-detection-sd-partner-token-verify/93b6ec2) (alert: `SecretDetectionPartnerAPIRateLimitHit`).
### Investigation
1. Identify partner(s) hitting limits.
1. Check current limits in `ee/lib/gitlab/application_rate_limiter.rb`:
1. Persistent throttling (more than 24h): Update rate limits or disable partner
## Network errors to partner APIs
### Symptom
Exceeds 0.5 errors/sec for 5 or more minutes on the [dashboard](https://dashboards.gitlab.net/d/secret-detection-sd-partner-token-verify/93b6ec2) (alert: `SecretDetectionPartnerAPINetworkErrors`).
### Investigation
1. Check which partner(s) affected.
1. Verify connectivity from Rails console using teleport:
```ruby
# Test AWS
uri = URI('https://sts.amazonaws.com/')
begin
Net::HTTP.get_response(uri)
puts "✓ AWS reachable"
rescue => e
puts "✗ AWS unreachable: #{e.message}"
end
# Test GCP
uri = URI('https://www.googleapis.com/oauth2/v1/tokeninfo')
begin
Net::HTTP.get_response(uri)
puts "✓ GCP reachable"
rescue => e
puts "✗ GCP unreachable: #{e.message}"
end
```
1. Check DNS:
```shell
dig sts.amazonaws.com
```
1. Check for firewall changes in `#infrastructure`.
1. Check logs for SSL errors using data view `pubsub-sidekiq-inf-gprd*`:
```plaintext
json.class:PartnerTokenVerificationWorker AND "SSL"
```
### Resolution
- Single partner affected: Likely partner-side disabled partner, monitor status page.