Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -24,10 +24,10 @@ final class IncubatingAttributes {
AttributeKey.stringKey("cloud.resource_id");

public static final class CloudPlatformIncubatingValues {
public static final String AZURE_VM = "azure_vm";
public static final String AZURE_AKS = "azure_aks";
public static final String AZURE_FUNCTIONS = "azure_functions";
public static final String AZURE_APP_SERVICE = "azure_app_service";
public static final String AZURE_VM = "azure.vm";
public static final String AZURE_AKS = "azure.aks";
public static final String AZURE_FUNCTIONS = "azure.functions";
public static final String AZURE_APP_SERVICE = "azure.app_service";

private CloudPlatformIncubatingValues() {}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ void defaultValues() {
createResource(DEFAULT_ENV_VARS)
.containsEntry(SERVICE_NAME, TEST_WEBSITE_SITE_NAME)
.containsEntry(CLOUD_PROVIDER, "azure")
.containsEntry(CLOUD_PLATFORM, "azure_app_service")
.containsEntry(CLOUD_PLATFORM, "azure.app_service")
.containsEntry(
CLOUD_RESOURCE_ID,
"/subscriptions/TEST_WEBSITE_OWNER_NAME/resourceGroups/TEST_WEBSITE_RESOURCE_GROUP/providers/Microsoft.Web/sites/TEST_WEBSITE_SITE_NAME")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class AzureFunctionsResourceProviderTest {
void defaultValues() {
createResource(DEFAULT_ENV_VARS)
.containsEntry(CLOUD_PROVIDER, "azure")
.containsEntry(CLOUD_PLATFORM, "azure_functions")
.containsEntry(CLOUD_PLATFORM, "azure.functions")
.containsEntry(FAAS_NAME, TEST_WEBSITE_SITE_NAME)
.containsEntry(FAAS_VERSION, TEST_FUNCTION_VERSION)
.containsEntry(FAAS_INSTANCE, TEST_WEBSITE_INSTANCE_ID)
Expand Down
10 changes: 9 additions & 1 deletion buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ base.archivesName.set("opentelemetry-${project.name}")

// Version to use to compile code and run tests.
val DEFAULT_JAVA_VERSION = JavaVersion.VERSION_17
val semconvVersion = "1.37.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we could keep the version in dependencyManagement/build.gradle.kts to keep only having one place where versions are set and updated ? I'm not familiar with gradle resolution details but is there any particular reason we have to do this in otel.java-conventions ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems to be a bug in gradle dependency resolution - at least I didn't find a way to keep the version where it is now.

@laurit do you have an idea?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd replace enforcedPlatform with platform. I fail to see a reason why we should enforce this. cc @trask

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this also doesn't help

configurations.configureEach {
      val b = isCanBeResolved && !isCanBeConsumed
      println("Configuring $name: add=$b")
      if (b || name.startsWith("test")) {
        extendsFrom(dependencyManagement)
      }
    }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @laurit - that was the issue!


java {
toolchain {
Expand Down Expand Up @@ -77,7 +78,7 @@ tasks {
exceptionFormat = TestExceptionFormat.FULL
showStandardStreams = true
}

configure<JacocoTaskExtension> {
// only care about code coverage for code in this repository
// (in particular avoiding netty classes which sometimes end up
Expand Down Expand Up @@ -145,6 +146,13 @@ dependencies {
compileOnly("com.google.errorprone:error_prone_annotations")
}

configurations.all {
resolutionStrategy {
force("io.opentelemetry.semconv:opentelemetry-semconv:${semconvVersion}")
force("io.opentelemetry.semconv:opentelemetry-semconv-incubating:${semconvVersion}-alpha")
}
}

testing {
suites.withType(JvmTestSuite::class).configureEach {
dependencies {
Expand Down
4 changes: 0 additions & 4 deletions dependencyManagement/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ plugins {
}

val otelInstrumentationVersion = "2.19.0-alpha"
val semconvVersion = "1.37.0"

javaPlatform {
allowDependencies()
Expand All @@ -20,9 +19,6 @@ dependencies {
api(enforcedPlatform("com.squareup.okhttp3:okhttp-bom:5.1.0"))

constraints {
api("io.opentelemetry.semconv:opentelemetry-semconv:${semconvVersion}")
api("io.opentelemetry.semconv:opentelemetry-semconv-incubating:${semconvVersion}")

api("com.google.auto.service:auto-service:1.1.1")
api("com.google.auto.service:auto-service-annotations:1.1.1")
api("com.google.auto.value:auto-value:1.11.0")
Expand Down
Loading