From ede8688943b88d40205131d20ca9d1a8f365e4a8 Mon Sep 17 00:00:00 2001 From: jack-berg <34418638+jack-berg@users.noreply.github.com> Date: Tue, 26 Mar 2024 09:50:13 -0500 Subject: [PATCH] Exclude namespaces that aren't useful in jvm environments (#54) * Exclude namespaces that aren't useful in jvm environments * Fix test --- build.gradle.kts | 2 + .../templates/SemanticAttributes.java.j2 | 3 +- .../incubating/IosIncubatingAttributes.java | 65 ------------------- .../IncubatingAvailabilityTest.java | 1 - 4 files changed, 4 insertions(+), 67 deletions(-) delete mode 100644 semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/IosIncubatingAttributes.java diff --git a/build.gradle.kts b/build.gradle.kts index c0e2e7e..d5b04c3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -98,6 +98,8 @@ fun generateTask(taskName: String, incubating: Boolean) { "--template", "/templates/SemanticAttributes.java.j2", "--output", "/output/{{pascal_prefix}}${classPrefix}Attributes.java", "--file-per-group", "root_namespace", + // Space delimited list of root namespaces to excluded (i.e. "foo bar") + "-Dexcluded_namespaces=\"ios\"", "-Dfilter=${filter}", "-DclassPrefix=${classPrefix}", "-Dpkg=$packageNameArg", diff --git a/buildscripts/templates/SemanticAttributes.java.j2 b/buildscripts/templates/SemanticAttributes.java.j2 index f1f38b8..af1e515 100644 --- a/buildscripts/templates/SemanticAttributes.java.j2 +++ b/buildscripts/templates/SemanticAttributes.java.j2 @@ -37,7 +37,8 @@ {%- set filtered_attributes = attributes_and_templates | list %} {%- endif %} {%- set filtered_enums = filtered_attributes | selectattr('is_enum', 'equalto', true) | list %} -{%- if filtered_attributes | count > 0 %} +{%- set excluded_namespaces_list = excluded_namespaces.replace("\"", "").split(' ') %} +{%- if root_namespace not in excluded_namespaces_list and filtered_attributes | count > 0 %} /* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 diff --git a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/IosIncubatingAttributes.java b/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/IosIncubatingAttributes.java deleted file mode 100644 index f89b801..0000000 --- a/semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/IosIncubatingAttributes.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * SPDX-License-Identifier: Apache-2.0 - */ - -package io.opentelemetry.semconv.incubating; - -import static io.opentelemetry.api.common.AttributeKey.stringKey; - -import io.opentelemetry.api.common.AttributeKey; - -// DO NOT EDIT, this is an Auto-generated file from -// buildscripts/templates/SemanticAttributes.java.j2 -@SuppressWarnings("unused") -public final class IosIncubatingAttributes { - - /** - * This attribute represents the state the application has transitioned into at the occurrence of - * the event. - * - *
Notes: - * - *