|
76 | 76 | echo "Using: $(java -version 2>&1 | head -1)" |
77 | 77 |
|
78 | 78 | # --- ddprof jar -------------------------------------------------------------- |
| 79 | +# Prefer a local build artifact. If absent and CURRENT_VERSION is set (CI |
| 80 | +# passes it in from the get-versions job), fall back to the Maven snapshot. |
79 | 81 | DDPROF_JAR=$(ls "${ROOT}/ddprof-lib/build/libs/ddprof-"*.jar 2>/dev/null | head -1) |
80 | 82 | if [ -z "${DDPROF_JAR}" ] || [ ! -f "${DDPROF_JAR}" ]; then |
81 | | - echo "FAIL:no local ddprof jar found — build one first: ./gradlew :ddprof-lib:jar" >&2 |
82 | | - exit 1 |
| 83 | + if [ -z "${CURRENT_VERSION:-}" ]; then |
| 84 | + echo "FAIL:no local ddprof jar found and CURRENT_VERSION is empty — build one first: ./gradlew :ddprof-lib:jar" >&2 |
| 85 | + exit 1 |
| 86 | + fi |
| 87 | + echo "Local ddprof jar not found — downloading ${CURRENT_VERSION} from Maven snapshots" |
| 88 | + ( cd /tmp && mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get \ |
| 89 | + -DrepoUrl=https://central.sonatype.com/repository/maven-snapshots/ \ |
| 90 | + -Dartifact=com.datadoghq:ddprof:"${CURRENT_VERSION}" ) |
| 91 | + DDPROF_JAR="/root/.m2/repository/com/datadoghq/ddprof/${CURRENT_VERSION}/ddprof-${CURRENT_VERSION}.jar" |
| 92 | + if [ ! -f "${DDPROF_JAR}" ]; then |
| 93 | + echo "FAIL:ddprof jar unavailable (Maven snapshot download failed)" >&2 |
| 94 | + exit 1 |
| 95 | + fi |
83 | 96 | fi |
84 | | -echo "Using local ddprof jar: ${DDPROF_JAR}" |
| 97 | +echo "Using ddprof jar: ${DDPROF_JAR}" |
85 | 98 |
|
86 | 99 | # --- dd-java-agent ------------------------------------------------------------ |
87 | 100 | DD_AGENT_JAR="${WORK_DIR}/dd-java-agent.jar" |
|
117 | 130 | case $CONFIG in |
118 | 131 | profiler) |
119 | 132 | ENABLEMENT="-Ddd.profiling.enabled=true -Ddd.trace.enabled=false" |
120 | | - # @Trace is a no-op without the tracer, so trace-context is excluded here. |
121 | | - DEFAULT_ANTAGONISTS="thread-churn,alloc-storm,vthread-churn,classloader-churn,vthread-context-cascade,bounded-pool,context-hop,consumer-group,hidden-class-churn,direct-memory,weakref-wave,dump-storm" |
| 133 | + # @Trace is a no-op without the tracer, so trace-context and |
| 134 | + # vthread-context-cascade (which is driven entirely by @Trace-annotated |
| 135 | + # methods) are excluded here. |
| 136 | + DEFAULT_ANTAGONISTS="thread-churn,alloc-storm,vthread-churn,classloader-churn,bounded-pool,context-hop,consumer-group,hidden-class-churn,direct-memory,weakref-wave,dump-storm" |
122 | 137 | ;; |
123 | 138 | profiler+tracer) |
124 | 139 | ENABLEMENT="-Ddd.profiling.enabled=true -Ddd.trace.enabled=true" |
|
0 commit comments