Add language detection to auto-monitor to inject only the relevant SDK - #380
Add language detection to auto-monitor to inject only the relevant SDK#380Miqueasher wants to merge 2 commits into
Conversation
mxiamxia
left a comment
There was a problem hiding this comment.
The new revision looks good to me. Pls resolve the conflicts and I'll approve CR from my side.
|
Hi @Miqueasher — this PR has conflicts with The three source files in #409 are byte-identical to this PR at Could you take a look at #409 and confirm the rebase didn't drop anything you intended to keep? Happy to close this one out once you've verified. |
Summary
When
monitorAllServices: true, auto-monitor currently injects all 4 language SDK init containers (Java, Python, Node.js, .NET) into every pod regardless of runtime, causing liveness/readiness probe failures, restart loops, and deployment instability.This PR adds a registry-based language detector that inspects container image config (ENV, CMD, ENTRYPOINT) via google/go-containerregistry without pulling layers (~100-500ms, 5s timeout)
Falls back gracefully through image name patterns → pod-spec env vars → pod-spec commands → all languages (current behavior), ensuring zero regression
Detection Layers
Dependencies added
Package | Version | Purpose
github.com/google/go-containerregistry | v0.20.0 | Fetch image config from registry without pulling layers
github.com/aws/aws-sdk-go (existing) | v1.45.25 | ECR auth via custom keychain
Test Plan
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.