Skip to content

Commit

Permalink
Merge main into aad (#1729)
Browse files Browse the repository at this point in the history
* Support agentmain (#1687)

* Use ProfilerEndpoint from connection string (#1694)

* Add test to make sure no non-daemon threads (#1695)

* Better EventHubs support (#1698)

* Reduce spammy error (#1701)

* Emit Profiler start/stop events (#1706)

* 2.x SDK explicit operation id / operation parent id should take precedence (#1708)

* Support explicit operation id/parentId from 2.x

* Test

* Release 3.1.1-BETA.2 (#1709)

* Prepare for a new beta release

* Fix a typo

* Reword

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>

* Hide super advanced feature.

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>

* Better Azure Service Bus support (#1710)

* Use main as the default branch from now on (#1715)

* Retry webflux tests 3 times when it's failing (#1712)

* Retry webflux 3 times when it's failing

* print stack trace when the final retry fails

* Reword

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>

* Update to latest OTel (#1719)

* Update OTel

* Suppress 2.x request name handler

* Remove retry

* Suppress CDS Profile endpoint warning in smoke tests

* Bump timeout to avoid sporadic failures

* Prepare 3.1.1-BETA.3 release (#1723)

* Fix App Map display of unknown dependencies (#1716)

* Fix App Map display of unknown dependencies

* Add net peer mapping to target also

* Add clarifying comment

* Fix agent jar size (#1724)

* Fix agent jar size

* Bump version

* Add roleName to profile metadata (#1725)

* add a unique id for GC events so that events from a single JVM can be grouped (#1721)

* Fix 2.x interop of timestamps (#1726)

* Fix 2.x interop of timestamps

* Add smoke test

* Bump version

* add logprocessor to agent (#1713)

* add logprocessor to agent

* comments addressed, added smoketest for log processor, fixed bug in telemetryprocessorOpenTelemetryConfigurer

* StringBuffer -> StringBuilder

* addressing comments

* removed lognames, fixed smoke test

* replace name with body in log processor, address comments

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>

Co-authored-by: John Oliver <1615532+johnoliver@users.noreply.github.com>
Co-authored-by: Helen Y <56097766+heyams@users.noreply.github.com>
Co-authored-by: kryalama <66494519+kryalama@users.noreply.github.com>
  • Loading branch information
4 people committed Jun 8, 2021
1 parent 5837b5a commit 4b730d0
Show file tree
Hide file tree
Showing 90 changed files with 2,430 additions and 648 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
push:
branches:
- master
- main

jobs:
build:
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
# CHANGELOG
# Version 3.1.1-BETA.4
* Reduce agent jar file size back to normal [#1716](https://github.com/microsoft/ApplicationInsights-Java/pull/1716).

# Version 3.1.1-BETA.3
* Fix memory leak caused by not removing Netty listeners [upstream #2705](https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/2705)
* Improve Azure Service Bus support [#1710](https://github.com/microsoft/ApplicationInsights-Java/pull/1710).
* Updated to support OpenTelemetry API 1.2.0

# Version 3.1.1-BETA.2
* Support explicit operation id and parent id from 2.x SDK [#1708](https://github.com/microsoft/ApplicationInsights-Java/pull/1708).
* Fix exceptions with deep stack trace exceeding 64 KB rejected by Application Insights backend [#1702](https://github.com/microsoft/ApplicationInsights-Java/pull/1702).
* Use shorter telemetry names for all telemetry types to reduce payload [#1700](https://github.com/microsoft/ApplicationInsights-Java/pull/1700).
* Improve Azure SDK support [#1698](https://github.com/microsoft/ApplicationInsights-Java/pull/1698).

# Version 3.1.1-BETA
* Fix NullPointerExceptions for App Services [#1681](https://github.com/microsoft/ApplicationInsights-Java/pull/1681#issuecomment-840169103).
* Add Application Insights stats.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ ch.qos.logback:logback-classic:1.2.3
ch.qos.logback:logback-core:1.2.3
com.squareup.moshi:moshi:1.9.3
com.squareup.okio:okio:1.16.0
io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-caching:1.0.0+ai.patch.1-alpha
io.opentelemetry.instrumentation:opentelemetry-instrumentation-api:1.0.0+ai.patch.1-alpha
io.opentelemetry.javaagent:opentelemetry-javaagent-api:1.0.0+ai.patch.1-alpha
io.opentelemetry.javaagent:opentelemetry-javaagent-bootstrap:1.0.0+ai.patch.1-alpha
io.opentelemetry:opentelemetry-api-metrics:1.0.1-alpha
io.opentelemetry:opentelemetry-api:1.0.1
io.opentelemetry:opentelemetry-context:1.0.1
io.opentelemetry:opentelemetry-semconv:1.0.1-alpha
io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-caching:1.2.0+ai.patch.1-alpha
io.opentelemetry.instrumentation:opentelemetry-instrumentation-api:1.2.0+ai.patch.1-alpha
io.opentelemetry.javaagent:opentelemetry-javaagent-api:1.2.0+ai.patch.1-alpha
io.opentelemetry.javaagent:opentelemetry-javaagent-bootstrap:1.2.0+ai.patch.1-alpha
io.opentelemetry:opentelemetry-api-metrics:1.2.0-alpha
io.opentelemetry:opentelemetry-api:1.2.0
io.opentelemetry:opentelemetry-context:1.2.0
io.opentelemetry:opentelemetry-semconv:1.2.0-alpha
org.slf4j:slf4j-api:1.7.25
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ ch.qos.logback:logback-classic:1.2.3
ch.qos.logback:logback-core:1.2.3
com.squareup.moshi:moshi:1.9.3
com.squareup.okio:okio:1.16.0
io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-caching:1.0.0+ai.patch.1-alpha
io.opentelemetry.instrumentation:opentelemetry-instrumentation-api:1.0.0+ai.patch.1-alpha
io.opentelemetry.javaagent:opentelemetry-javaagent-api:1.0.0+ai.patch.1-alpha
io.opentelemetry.javaagent:opentelemetry-javaagent-bootstrap:1.0.0+ai.patch.1-alpha
io.opentelemetry:opentelemetry-api-metrics:1.0.1-alpha
io.opentelemetry:opentelemetry-api:1.0.1
io.opentelemetry:opentelemetry-context:1.0.1
io.opentelemetry:opentelemetry-semconv:1.0.1-alpha
io.opentelemetry.instrumentation:opentelemetry-instrumentation-api-caching:1.2.0+ai.patch.1-alpha
io.opentelemetry.instrumentation:opentelemetry-instrumentation-api:1.2.0+ai.patch.1-alpha
io.opentelemetry.javaagent:opentelemetry-javaagent-api:1.2.0+ai.patch.1-alpha
io.opentelemetry.javaagent:opentelemetry-javaagent-bootstrap:1.2.0+ai.patch.1-alpha
io.opentelemetry:opentelemetry-api-metrics:1.2.0-alpha
io.opentelemetry:opentelemetry-api:1.2.0
io.opentelemetry:opentelemetry-context:1.2.0
io.opentelemetry:opentelemetry-semconv:1.2.0-alpha
org.slf4j:slf4j-api:1.7.30
Original file line number Diff line number Diff line change
Expand Up @@ -42,46 +42,46 @@ public static void setDelegate(final BytecodeUtilDelegate delegate) {
MicrometerUtil.setDelegate(new MicrometerUtilDelegate() {
@Override
public void trackMetric(String name, double value, Integer count, Double min, Double max, Map<String, String> properties) {
delegate.trackMetric(name, value, count, min, max, null, properties, Collections.emptyMap(), null);
delegate.trackMetric(null, name, value, count, min, max, null, properties, Collections.emptyMap(), null);
}
});
}
}

public static void trackEvent(String name, Map<String, String> properties, Map<String, String> tags,
public static void trackEvent(Date timestamp, String name, Map<String, String> properties, Map<String, String> tags,
Map<String, Double> metrics, String instrumentationKey) {
if (delegate != null) {
delegate.trackEvent(name, properties, tags, metrics, instrumentationKey);
delegate.trackEvent(timestamp, name, properties, tags, metrics, instrumentationKey);
}
}

public static void trackMetric(String name, double value, Integer count, Double min, Double max, Double stdDev,
public static void trackMetric(Date timestamp, String name, double value, Integer count, Double min, Double max, Double stdDev,
Map<String, String> properties, Map<String, String> tags, String instrumentationKey) {
if (delegate != null) {
delegate.trackMetric(name, value, count, min, max, stdDev, properties, tags, instrumentationKey);
delegate.trackMetric(timestamp, name, value, count, min, max, stdDev, properties, tags, instrumentationKey);
}
}

public static void trackDependency(String name, String id, String resultCode, Long totalMillis, boolean success,
public static void trackDependency(Date timestamp, String name, String id, String resultCode, Long totalMillis, boolean success,
String commandName, String type, String target, Map<String, String> properties,
Map<String, String> tags, Map<String, Double> metrics, String instrumentationKey) {
if (delegate != null) {
delegate.trackDependency(name, id, resultCode, totalMillis, success, commandName, type, target, properties,
delegate.trackDependency(timestamp, name, id, resultCode, totalMillis, success, commandName, type, target, properties,
tags, metrics, instrumentationKey);
}
}

public static void trackPageView(String name, URI uri, long totalMillis, Map<String, String> properties, Map<String, String> tags,
public static void trackPageView(Date timestamp, String name, URI uri, long totalMillis, Map<String, String> properties, Map<String, String> tags,
Map<String, Double> metrics, String instrumentationKey) {
if (delegate != null) {
delegate.trackPageView(name, uri, totalMillis, properties, tags, metrics, instrumentationKey);
delegate.trackPageView(timestamp, name, uri, totalMillis, properties, tags, metrics, instrumentationKey);
}
}

public static void trackTrace(String message, int severityLevel, Map<String, String> properties, Map<String, String> tags,
public static void trackTrace(Date timestamp, String message, int severityLevel, Map<String, String> properties, Map<String, String> tags,
String instrumentationKey) {
if (delegate != null) {
delegate.trackTrace(message, severityLevel, properties, tags, instrumentationKey);
delegate.trackTrace(timestamp, message, severityLevel, properties, tags, instrumentationKey);
}
}

Expand All @@ -94,10 +94,10 @@ public static void trackRequest(String id, String name, URL url, Date timestamp,
}
}

public static void trackException(Exception exception, Map<String, String> properties, Map<String, String> tags,
public static void trackException(Date timestamp, Exception exception, Map<String, String> properties, Map<String, String> tags,
Map<String, Double> metrics, String instrumentationKey) {
if (delegate != null) {
delegate.trackException(exception, properties, tags, metrics, instrumentationKey);
delegate.trackException(timestamp, exception, properties, tags, metrics, instrumentationKey);
}
}

Expand Down Expand Up @@ -167,30 +167,30 @@ public static void onExit() {

public interface BytecodeUtilDelegate {

void trackEvent(String name, Map<String, String> properties, Map<String, String> tags, Map<String, Double> metrics,
void trackEvent(Date timestamp, String name, Map<String, String> properties, Map<String, String> tags, Map<String, Double> metrics,
String instrumentationKey);

void trackMetric(String name, double value, Integer count, Double min, Double max,
void trackMetric(Date timestamp, String name, double value, Integer count, Double min, Double max,
Double stdDev, Map<String, String> properties, Map<String, String> tags,
String instrumentationKey);

void trackDependency(String name, String id, String resultCode, Long totalMillis,
void trackDependency(Date timestamp, String name, String id, String resultCode, Long totalMillis,
boolean success, String commandName, String type, String target,
Map<String, String> properties, Map<String, String> tags, Map<String, Double> metrics,
String instrumentationKey);

void trackPageView(String name, URI uri, long totalMillis, Map<String, String> properties, Map<String, String> tags,
void trackPageView(Date timestamp, String name, URI uri, long totalMillis, Map<String, String> properties, Map<String, String> tags,
Map<String, Double> metrics, String instrumentationKey);

void trackTrace(String message, int severityLevel, Map<String, String> properties, Map<String, String> tags,
void trackTrace(Date timestamp, String message, int severityLevel, Map<String, String> properties, Map<String, String> tags,
String instrumentationKey);

void trackRequest(String id, String name, URL url, Date timestamp, Long duration, String responseCode, boolean success,
String source, Map<String, String> properties, Map<String, String> tags, Map<String, Double> metrics,
String instrumentationKey);

// TODO also handle cases where ExceptionTelemetry parsedStack is used directly instead of indirectly through Exception
void trackException(Exception exception, Map<String, String> properties, Map<String, String> tags,
void trackException(Date timestamp, Exception exception, Map<String, String> properties, Map<String, String> tags,
Map<String, Double> metrics, String instrumentationKey);

void flush();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Future<ProfilerService> initialize(
String instrumentationKey,
CloseableHttpClient httpClient,
ScheduledExecutorService serviceProfilerExecutorService,
String userAgent
String userAgent,
String roleName
);
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.net.URI;

/**
* Configuration of the service profiler subsystem
*/
Expand All @@ -43,7 +45,7 @@ public class ServiceProfilerServiceConfig {
// default interval of periodic profiles
private final int periodicRecordingInterval;

private final String serviceProfilerFrontEndPoint;
private final URI serviceProfilerFrontEndPoint;

// Enable entire service profiler subsystem
private final boolean enabled;
Expand All @@ -58,7 +60,7 @@ public ServiceProfilerServiceConfig(
int configPollPeriod,
int periodicRecordingDuration,
int periodicRecordingInterval,
String serviceProfilerFrontEndPoint,
URI serviceProfilerFrontEndPoint,
boolean enabled,
String memoryTriggeredSettings,
String cpuTriggeredSettings
Expand All @@ -84,8 +86,8 @@ public long getPeriodicRecordingInterval() {
return periodicRecordingInterval != -1 ? periodicRecordingInterval : DEFAULT_PERIODIC_RECORDING_INTERVAL_IN_S;
}

public String getServiceProfilerFrontEndPoint() {
return serviceProfilerFrontEndPoint != null ? serviceProfilerFrontEndPoint : FrontendEndpoints.PRODUCT_GLOBAL;
public URI getServiceProfilerFrontEndPoint() {
return serviceProfilerFrontEndPoint;
}

public boolean enabled() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,17 @@ public synchronized Future<ProfilerService> initialize(
String instrumentationKey,
CloseableHttpClient httpClient,
ScheduledExecutorService serviceProfilerExecutorService,
String userAgent) {
String userAgent,
String roleName) {
if (INSTANCE == null) {
ServiceProfilerClientV2 serviceProfilerClient = new ProfilerFrontendClientV2(config.getServiceProfilerFrontEndPoint(), instrumentationKey, httpClient, userAgent);

ServiceProfilerUploader uploader = new ServiceProfilerUploader(
serviceProfilerClient,
machineName,
processId,
appIdSupplier);
appIdSupplier,
roleName);

INSTANCE = new JfrProfilerService(
appIdSupplier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,22 @@ public class ProfilerFrontendClientV2 implements ServiceProfilerClientV2 {
public static final String FEATURE_VERSION = "1.0.0";
public static final String API_FEATURE_VERSION = "2020-10-14-preview";

private final String hostUrl;
private final URI hostUrl;
private final String instrumentationKey;
private final CloseableHttpClient httpClient;
private final String userAgent;

private boolean closed;

public ProfilerFrontendClientV2(String hostUrl, String instrumentationKey, CloseableHttpClient httpClient, String userAgent) {
public ProfilerFrontendClientV2(URI hostUrl, String instrumentationKey, CloseableHttpClient httpClient, String userAgent) {
this.hostUrl = hostUrl;
this.instrumentationKey = instrumentationKey;
this.httpClient = httpClient;
this.userAgent = userAgent;
closed = false;
}

public ProfilerFrontendClientV2(String hostUrl, String instrumentationKey, CloseableHttpClient httpClient) {
public ProfilerFrontendClientV2(URI hostUrl, String instrumentationKey, CloseableHttpClient httpClient) {
this(hostUrl, instrumentationKey, httpClient, null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ public class BlobMetadataConstants {
public static final String PROGRAMMING_LANGUAGE_META_NAME = "spProgrammingLanguage";
public static final String OS_PLATFORM_META_NAME = "spOSPlatform";
public static final String TRACE_FILE_FORMAT_META_NAME = "spTraceFileFormat";
public static final String ROLE_NAME_META_NAME = "RoleName";
}
Loading

0 comments on commit 4b730d0

Please sign in to comment.