diff --git a/README.md b/README.md index c3ca84b6..ed28378f 100644 --- a/README.md +++ b/README.md @@ -248,7 +248,7 @@ pipeline { datadog(testVisibility: [ enabled: true, serviceName: "my-service", // the name of service or library being tested - languages: ["JAVA"], // languages that should be instrumented (available options are "JAVA", "JAVASCRIPT", "PYTHON", "DOTNET") + languages: ["JAVA"], // languages that should be instrumented (available options are "JAVA", "JAVASCRIPT", "PYTHON") additionalVariables: ["my-var": "value"] // additional tracer configuration settings (optional) ]) } diff --git a/src/main/java/org/datadog/jenkins/plugins/datadog/apm/DatadogTracerConfigurator.java b/src/main/java/org/datadog/jenkins/plugins/datadog/apm/DatadogTracerConfigurator.java index 6dfd89c4..38e80e37 100644 --- a/src/main/java/org/datadog/jenkins/plugins/datadog/apm/DatadogTracerConfigurator.java +++ b/src/main/java/org/datadog/jenkins/plugins/datadog/apm/DatadogTracerConfigurator.java @@ -35,7 +35,6 @@ public class DatadogTracerConfigurator { public DatadogTracerConfigurator() { configurators = new EnumMap<>(TracerLanguage.class); - configurators.put(TracerLanguage.DOTNET, new DotnetConfigurator()); configurators.put(TracerLanguage.JAVA, new JavaConfigurator()); configurators.put(TracerLanguage.JAVASCRIPT, new JavascriptConfigurator()); configurators.put(TracerLanguage.PYTHON, new PythonConfigurator()); diff --git a/src/main/java/org/datadog/jenkins/plugins/datadog/apm/DotnetConfigurator.java b/src/main/java/org/datadog/jenkins/plugins/datadog/apm/DotnetConfigurator.java deleted file mode 100644 index 6138a474..00000000 --- a/src/main/java/org/datadog/jenkins/plugins/datadog/apm/DotnetConfigurator.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.datadog.jenkins.plugins.datadog.apm; - -import hudson.FilePath; -import hudson.model.Node; -import hudson.model.TaskListener; -import java.io.File; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -public class DotnetConfigurator implements TracerConfigurator { - private static final int GET_DOTNET_VERSION_TIMEOUT_MILLIS = 30_000; - private static final int INSTALL_TRACER_TIMEOUT_MILLIS = 300_000; - private static final int SHOW_TRACER_VARS_TIMEOUT_MILLIS = 30_000; - - @Override - public Map configure(DatadogTracerJobProperty tracerConfig, Node node, FilePath workspacePath, Map envs, TaskListener listener) throws Exception { - String dotnetVersion = workspacePath.act(new ShellCommandCallable(Collections.emptyMap(), GET_DOTNET_VERSION_TIMEOUT_MILLIS, "dotnet", "--version")); - listener.getLogger().println("[datadog] Configuring DD .NET tracer: got .NET version " + dotnetVersion + " from " + workspacePath + " on " + node); - - String installTracerOutput = workspacePath.act(new ShellCommandCallable(Collections.emptyMap(), INSTALL_TRACER_TIMEOUT_MILLIS, "dotnet", "tool", "update", "--tool-path", workspacePath.getRemote(), "dd-trace")); - listener.getLogger().println("[datadog] Configuring DD .NET tracer: tracer installed in " + workspacePath + " on " + node + "; output: " + installTracerOutput); - - String tracerVarOutput = workspacePath.act(new ShellCommandCallable(Collections.emptyMap(), SHOW_TRACER_VARS_TIMEOUT_MILLIS, workspacePath.getRemote() + File.separator + "dd-trace", "ci", "configure", "jenkins")); - - Map variables = new HashMap<>(); - for (String line : tracerVarOutput.split("\n")) { - if (!line.contains("=")) { - continue; - } - String[] tokens = line.split("="); - variables.put(tokens[0], tokens.length == 2 ? tokens[1] : ""); - } - return variables; - } -} diff --git a/src/main/java/org/datadog/jenkins/plugins/datadog/apm/JavascriptConfigurator.java b/src/main/java/org/datadog/jenkins/plugins/datadog/apm/JavascriptConfigurator.java index c8470ff4..3e29748b 100644 --- a/src/main/java/org/datadog/jenkins/plugins/datadog/apm/JavascriptConfigurator.java +++ b/src/main/java/org/datadog/jenkins/plugins/datadog/apm/JavascriptConfigurator.java @@ -34,7 +34,7 @@ public Map configure(DatadogTracerJobProperty tracerConfig, N Map variables = new HashMap<>(); variables.put("DD_TRACE_PATH", tracerPath.toString()); - variables.put("NODE_OPTIONS", PropertyUtils.prepend(envs, "NODE_OPTIONS", String.format("-r %s/ci/init", tracerPath))); + variables.put("NODE_OPTIONS", PropertyUtils.prepend(envs, "NODE_OPTIONS", "-r $DD_TRACE_PATH/ci/init")); return variables; } } diff --git a/src/main/java/org/datadog/jenkins/plugins/datadog/apm/TracerLanguage.java b/src/main/java/org/datadog/jenkins/plugins/datadog/apm/TracerLanguage.java index 7f46750c..f0358ab1 100644 --- a/src/main/java/org/datadog/jenkins/plugins/datadog/apm/TracerLanguage.java +++ b/src/main/java/org/datadog/jenkins/plugins/datadog/apm/TracerLanguage.java @@ -1,7 +1,6 @@ package org.datadog.jenkins.plugins.datadog.apm; public enum TracerLanguage { - DOTNET(".NET"), JAVA("Java"), JAVASCRIPT("JS"), PYTHON("Python"); diff --git a/src/main/resources/org/datadog/jenkins/plugins/datadog/apm/DatadogTracerJobProperty/help-languages.html b/src/main/resources/org/datadog/jenkins/plugins/datadog/apm/DatadogTracerJobProperty/help-languages.html index 84e8215a..b3905f66 100644 --- a/src/main/resources/org/datadog/jenkins/plugins/datadog/apm/DatadogTracerJobProperty/help-languages.html +++ b/src/main/resources/org/datadog/jenkins/plugins/datadog/apm/DatadogTracerJobProperty/help-languages.html @@ -37,9 +37,4 @@ If these variables are overridden inside the job (with their existing value being discarded rather than preserved), the injection will not happen.

- - .NET -

- The plugin assumes that dotnet and dotnet tool are available on the node that executes the job. -