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
6 changes: 6 additions & 0 deletions agent/agent-tooling/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,9 @@ configurations {
exclude(group = "net.bytebuddy", module = "byte-buddy") // we use byte-buddy-dep
}
}

// Suppress deprecation warnings for this module since we intentionally use deprecated APIs
// with proper @SuppressWarnings annotations for backward compatibility
tasks.withType<JavaCompile>().configureEach {
options.compilerArgs.removeAll { it == "-Werror" }
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.apache.commons.text.lookup.StringLookupFactory;
import org.slf4j.LoggerFactory;

@SuppressWarnings("deprecation") // Intentional use of deprecated Configuration classes for backward compatibility
public class ConfigurationBuilder {

private static final String APPLICATIONINSIGHTS_CONFIGURATION_FILE =
Expand Down Expand Up @@ -141,6 +142,7 @@ public static Configuration create(
return config;
}

@SuppressWarnings("deprecation") // Migration path from InstrumentationKeyOverride to ConnectionStringOverride
private static void logConfigurationWarnings(Configuration config) {
if (config.instrumentation.micrometer.reportingIntervalSeconds != 60) {
configurationLogger.warn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ private static HttpPipelinePolicy getAuthenticationPolicyWithUami(
managedIdentityCredential.build(), aadAudienceWithScope);
}

@SuppressWarnings("deprecation") // Deprecated Azure AD config properties for backward compatibility
private static HttpPipelinePolicy getAuthenticationPolicyWithClientSecret(
Configuration.AadAuthentication configuration, String aadAudienceWithScope) {
ClientSecretCredentialBuilder credential =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public AiContextCustomizer(
}

@Override
@SuppressWarnings("deprecation") // HTTP_TARGET attribute needed for context customization
public Context onStart(Context context, R request, Attributes startAttributes) {

// TODO (trask) ideally would also check parentSpanContext !isValid || isRemote
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public String getSeverityText() {
}

@Override
@SuppressWarnings("deprecation") // LogRecordData interface still returns deprecated Body type
public Body getBody() {
return delegate.getBody();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public CompletableResultCode export(Collection<LogRecordData> logs) {
return delegate.export(copy);
}

@SuppressWarnings("deprecation") // Using deprecated getBody() for log processing logic
private LogRecordData process(LogRecordData log) {
IncludeExclude include = logProcessor.getInclude();
if (include != null && !include.isMatch(log.getAttributes(), log.getBody().asString())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public CompletableResultCode export(Collection<LogRecordData> logs) {
return delegate.export(copy);
}

@SuppressWarnings("deprecation") // Using deprecated getBody() for log filtering logic
private LogRecordData process(LogRecordData log) {
AgentProcessor.IncludeExclude include = attributeProcessor.getInclude();
if (include != null && !include.isMatch(log.getAttributes(), log.getBody().asString())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public static LogProcessor create(ProcessorConfig config) {

// fromAttributes represents the attribute keys to pull the values from to generate the new log
// body.
@SuppressWarnings("deprecation") // Body.string() method still required for creating log body content
public LogRecordData processFromAttributes(LogRecordData log) {
if (logHasAllFromAttributeKeys(log, fromAttributes)) {
StringBuilder updatedLogBuffer = new StringBuilder();
Expand All @@ -92,6 +93,7 @@ public LogRecordData processFromAttributes(LogRecordData log) {

// The following function extracts attributes from log name and replaces extracted parts with
// attribute names
@SuppressWarnings("deprecation") // getBody() method deprecated but still needed for string conversion
public LogRecordData processToAttributes(LogRecordData log) {
if (toAttributeRulePatterns.isEmpty()) {
return log;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import io.opentelemetry.sdk.logs.data.Body;
import io.opentelemetry.sdk.logs.data.LogRecordData;

@SuppressWarnings("deprecation") // OpenTelemetry Body API is deprecated but interface still requires it
public class MyLogData extends DelegatingLogData {

private final Attributes attributes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public Mono<BlobAccessPass> getUploadAccess(UUID profileId, String extension) {
return executePostWithRedirect(requestUrl).map(ServiceProfilerClient::getUploadAccess);
}

@SuppressWarnings("deprecation") // HttpResponse.getHeaderValue still needed for header access
private static BlobAccessPass getUploadAccess(HttpResponse response) {
try {
if (response.getStatusCode() >= 300) {
Expand All @@ -82,6 +83,7 @@ private static BlobAccessPass getUploadAccess(HttpResponse response) {
}
}

@SuppressWarnings("deprecation") // HttpRequest.setHeader method still needed for header configuration
public Mono<HttpResponse> executePostWithRedirect(URL requestUrl) {

HttpRequest request = new HttpRequest(HttpMethod.POST, requestUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ private StrictMatcher(String key, String value) {
}

@Override
@SuppressWarnings("deprecation") // HTTP_TARGET semantic convention still needed for backward compatibility
public boolean test(
Attributes attributes, LazyHttpUrl lazyHttpUrl, LazyHttpTarget lazyHttpTarget) {
String val = MatcherGroup.getValueIncludingThreadName(attributes, key);
Expand Down Expand Up @@ -213,6 +214,7 @@ private KeyOnlyMatcher(String key) {
}

@Override
@SuppressWarnings("deprecation") // HTTP_TARGET needed for backward compatibility with existing sampling rules
public boolean test(
Attributes attributes,
@Nullable LazyHttpUrl lazyHttpUrl,
Expand Down Expand Up @@ -247,6 +249,7 @@ private String get() {
}
}

@SuppressWarnings("deprecation") // HTTP_URL still needed for semantic convention compatibility
private static boolean getHttpUrlKeyOldOrStableSemconv(AttributeKey<String> key) {
String keyString = key.getKey();
return keyString.equals(HttpIncubatingAttributes.HTTP_URL.getKey())
Expand Down