feat: OTel agent 감지 시 -javaagent 자동 적용#194
Merged
Merged
Conversation
grafana-opentelemetry-java.jar와 otel.env가 배포 서버에 있으면 자동으로 감지해서 -javaagent 옵션을 붙여 실행. 없으면 기존과 동일하게 부팅.
📝 WalkthroughWalkthroughThe deployment script now conditionally loads OpenTelemetry configuration and attaches the Java agent when both required files are present, while preserving startup without instrumentation when either file is missing. ChangesOpenTelemetry startup instrumentation
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@scripts/deploy.sh`:
- Around line 32-34: Reorder the arguments in the java invocation so the
-Duser.timezone=Asia/Seoul JVM option appears before -jar, with $JAR_PATH
immediately following -jar. Preserve the existing nohup, $JAVA_AGENT_OPTS, and
continuation structure.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
작업 배경
변경 사항
scripts/deploy.sh/home/ec2-user/app/에grafana-opentelemetry-java.jar와otel.env가 존재하면 자동 감지해서-javaagent옵션과 env var를 적용, 없으면 기존과 동일하게 부팅영향 범위
dev-cd.yml등)는 변경 없음 — 배포 스크립트 로직만 조건부 분기 추가runnect-staging, t3.micro) 서버에 agent jar + otel.env 파일을 이미 수동 배치 완료 (git에는 포함되지 않는 민감/대용량 파일이라 서버에 직접 배치)Test Plan
bash -n scripts/deploy.sh문법 검증🤖 Generated with Claude Code
Summary by CodeRabbit