Skip to content

Commit

Permalink
Update to otel 0.17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed Feb 20, 2021
1 parent 5a75d6d commit 23bfde8
Show file tree
Hide file tree
Showing 53 changed files with 732 additions and 915 deletions.
6 changes: 3 additions & 3 deletions agent/agent-bootstrap/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ task generateVersionProperties(type: PropsFileGen) {
processResources.dependsOn generateVersionProperties

dependencies {
compile (group: 'io.opentelemetry.javaagent', name: 'opentelemetry-javaagent-bootstrap', version: '0.16.0+ai.patch.1') {
compile (group: 'io.opentelemetry.javaagent', name: 'opentelemetry-javaagent-bootstrap', version: '0.17.0+ai.patch.1-alpha') {
exclude group: 'org.slf4j', module: 'slf4j-simple'
}
compile group: 'io.opentelemetry.instrumentation', name: 'opentelemetry-instrumentation-api', version: '0.16.0+ai.patch.1'
compile group: 'io.opentelemetry.javaagent', name: 'opentelemetry-javaagent-api', version: '0.16.0+ai.patch.1'
compile group: 'io.opentelemetry.instrumentation', name: 'opentelemetry-instrumentation-api', version: '0.17.0+ai.patch.1-alpha'
compile group: 'io.opentelemetry.javaagent', name: 'opentelemetry-javaagent-api', version: '0.17.0+ai.patch.1-alpha'
compile 'ch.qos.logback:logback-classic:1.2.3'
compile 'ch.qos.logback.contrib:logback-json-classic:0.1.5'

Expand Down
45 changes: 3 additions & 42 deletions agent/agent-bootstrap/spotbugs.exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,53 +11,14 @@
</Match>
<Match>
<Bug pattern="PATH_TRAVERSAL_IN" />
<Or>
<And>
<!-- False Positive. Path is not from an external source. -->
<Class name="com.microsoft.applicationinsights.agent.bootstrap.diagnostics.status.StatusFile$2" />
<Method name="run" />
</And>
<And>
<!-- False Positive. Path is not from an external source. -->
<Class name="com.microsoft.applicationinsights.agent.bootstrap.MainEntryPoint" />
<Method name="start"/>
</And>
<And>
<!-- False Positive. Path is not from an external source. -->
<Class name="com.microsoft.applicationinsights.agent.bootstrap.MainEntryPoint" />
<Method name="logErrorMessage"/>
</And>
</Or>
</Match>
<Match>
<Bug pattern="UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD" />
<!-- used from agent-tooling -->
<Class name="~com\.microsoft\.applicationinsights\.agent\.bootstrap\.configuration\..*" />
</Match>
<Match>
<Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD" />
<!-- used from agent-tooling -->
<Class name="~com\.microsoft\.applicationinsights\.agent\.bootstrap\.configuration\..*" />
</Match>
<Match>
<Bug pattern="UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD" />
<!-- used from agent-tooling -->
<Class name="~com\.microsoft\.applicationinsights\.agent\.bootstrap\.configuration\..*" />
<!-- False Positive. Path is not from an external source. -->
<Class name="com.microsoft.applicationinsights.agent.bootstrap.diagnostics.status.StatusFile$2" />
<Method name="run" />
</Match>
<Match>
<!-- The exception in question comes from Class.forName. It may throw with different versions of java. -->
<Bug pattern="REC_CATCH_EXCEPTION" />
<Class name="com.microsoft.applicationinsights.agent.bootstrap.diagnostics.PidFinder" />
<Method name="getPidUsingProcessHandle" />
</Match>
<Match>
<Bug pattern="CRLF_INJECTION_LOGS" />
<Class name="com.microsoft.applicationinsights.agent.bootstrap.MainEntryPoint" />
<Method name="logErrorMessage" />
</Match>
<Match>
<Bug pattern="CRLF_INJECTION_LOGS" />
<Class name="com.microsoft.applicationinsights.agent.bootstrap.MainEntryPoint" />
<Method name="start" />
</Match>
</FindBugsFilter>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
package com.microsoft.applicationinsights.agent.bootstrap.diagnostics;

import java.util.Arrays;
import java.util.Iterator;

public class ApplicationMetadataFactory implements Iterable<DiagnosticsValueFinder> {

private final DiagnosticsValueFinder[] finders = new DiagnosticsValueFinder[] {
new AgentExtensionVersionFinder(), // 0
new InstrumentationKeyFinder(), // 1
new MachineNameFinder(), // 2
new PidFinder(), // 3
new SiteNameFinder(), // 4
new SubscriptionIdFinder(), // 5
new SdkVersionFinder(), // 6
};


ApplicationMetadataFactory() {}

public DiagnosticsValueFinder getExtensionVersion() {
return finders[0];
}

public DiagnosticsValueFinder getInstrumentationKey() {
return finders[1];
}

public DiagnosticsValueFinder getMachineName() {
return finders[2];
}

public DiagnosticsValueFinder getPid() {
return finders[3];
}

public DiagnosticsValueFinder getSiteName() {
return finders[4];
}

public DiagnosticsValueFinder getSubscriptionId() {
return finders[5];
}

public DiagnosticsValueFinder getSdkVersion() {
return finders[6];
}

@Override
public Iterator<DiagnosticsValueFinder> iterator() {
return Arrays.asList(finders).iterator();
}

package com.microsoft.applicationinsights.agent.bootstrap.diagnostics;

import java.util.Arrays;
import java.util.Iterator;

public class ApplicationMetadataFactory implements Iterable<DiagnosticsValueFinder> {

private final DiagnosticsValueFinder[] finders = new DiagnosticsValueFinder[] {
new AgentExtensionVersionFinder(), // 0
new InstrumentationKeyFinder(), // 1
new MachineNameFinder(), // 2
new PidFinder(), // 3
new SiteNameFinder(), // 4
new SubscriptionIdFinder(), // 5
new SdkVersionFinder(), // 6
};


ApplicationMetadataFactory() {}

public DiagnosticsValueFinder getExtensionVersion() {
return finders[0];
}

public DiagnosticsValueFinder getInstrumentationKey() {
return finders[1];
}

public DiagnosticsValueFinder getMachineName() {
return finders[2];
}

public DiagnosticsValueFinder getPid() {
return finders[3];
}

public DiagnosticsValueFinder getSiteName() {
return finders[4];
}

public DiagnosticsValueFinder getSubscriptionId() {
return finders[5];
}

public DiagnosticsValueFinder getSdkVersion() {
return finders[6];
}

@Override
public Iterator<DiagnosticsValueFinder> iterator() {
return Arrays.asList(finders).iterator();
}

}
Loading

0 comments on commit 23bfde8

Please sign in to comment.