Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ public static class PreviewConfiguration {
// this is just here to detect if using this old setting in order to give a helpful message
@Deprecated public boolean openTelemetryApiSupport;
public PreviewInstrumentation instrumentation = new PreviewInstrumentation();
// this is just here to detect if using this old setting in order to give a helpful message
// these are just here to detect if using this old setting in order to give a helpful message
@Deprecated public int metricIntervalSeconds = 60;
@Deprecated public Boolean ignoreRemoteParentNotSampled;
public boolean captureControllerSpans;
// this is just here to detect if using this old setting in order to give a helpful message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ public class ConfigurationBuilder {
private static final String APPLICATIONINSIGHTS_PREVIEW_PROFILER_ENABLEDIAGNOSTICS =
"APPLICATIONINSIGHTS_PREVIEW_PROFILER_ENABLEDIAGNOSTICS";

@Deprecated
private static final String APPLICATIONINSIGHTS_PREVIEW_METRIC_INTERVAL_SECONDS =
"APPLICATIONINSIGHTS_PREVIEW_METRIC_INTERVAL_SECONDS";

private static final String APPLICATIONINSIGHTS_METRIC_INTERVAL_SECONDS =
"APPLICATIONINSIGHTS_METRIC_INTERVAL_SECONDS";

Expand Down Expand Up @@ -149,6 +153,13 @@ private static void logConfigurationWarnings(Configuration config) {
"\"openTelemetryApiSupport\" is no longer in preview and it is now the"
+ " (one and only) default behavior");
}
if (config.preview.metricIntervalSeconds != 60) {
configurationLogger.warn(
"\"metricIntervalSeconds\" is no longer in preview and it has been GA since 3.4.9");
if (config.metricIntervalSeconds == 60) {
config.metricIntervalSeconds = config.preview.metricIntervalSeconds;
}
}
if (config.preview.instrumentation.azureSdk.enabled) {
configurationLogger.warn(
"\"azureSdk\" instrumentation is no longer in preview"
Expand Down Expand Up @@ -557,9 +568,21 @@ static void overlayFromEnv(Configuration config, Path baseDir) throws IOExceptio
overlayWithEnvVar(
APPLICATIONINSIGHTS_SELF_DIAGNOSTICS_FILE_PATH, config.selfDiagnostics.file.path);

config.metricIntervalSeconds =
overlayWithEnvVar(
APPLICATIONINSIGHTS_METRIC_INTERVAL_SECONDS, config.metricIntervalSeconds);
String deprecatedMetricIntervalSeconds =
getEnvVar(APPLICATIONINSIGHTS_PREVIEW_METRIC_INTERVAL_SECONDS);
String metricIntervalSeconds = getEnvVar(APPLICATIONINSIGHTS_METRIC_INTERVAL_SECONDS);
if (metricIntervalSeconds != null) {
config.metricIntervalSeconds =
overlayWithEnvVar(
APPLICATIONINSIGHTS_METRIC_INTERVAL_SECONDS, config.metricIntervalSeconds);
} else if (deprecatedMetricIntervalSeconds != null) {
configurationLogger.warn(
"\"APPLICATIONINSIGHTS_PREVIEW_METRIC_INTERVAL_SECONDS\" has been renamed to \"APPLICATIONINSIGHTS_METRIC_INTERVAL_SECONDS\""
+ " in 3.4.9 (GA)");
config.metricIntervalSeconds =
overlayWithEnvVar(
APPLICATIONINSIGHTS_PREVIEW_METRIC_INTERVAL_SECONDS, config.metricIntervalSeconds);
}

config.preview.instrumentation.springIntegration.enabled =
overlayWithEnvVar(
Expand Down