Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semconv codegen should produce different constant names if attribute is renamed _ -> `` #75

Closed
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
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -93,15 +93,15 @@ fun generateTask(taskName: String, incubating: Boolean) {
"-v", "$buildDir/semantic-conventions-${semanticConventionsVersion}/model:/source",
"-v", "$projectDir/buildscripts/templates:/templates",
"-v", "$projectDir/$outputDir:/output",
"otel/semconvgen:$generatorVersion",
"library/semconvgen1",
"--yaml-root", "/source",
"--continue-on-validation-errors", "compatibility",
"code",
"--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 aspnetcore signalr\"",
"-Dexcluded_namespaces=ios aspnetcore signalr",
"-Dfilter=${filter}",
"-DclassPrefix=${classPrefix}",
"-Dpkg=$packageNameArg",
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ public final class AndroidIncubatingAttributes {
* android operating system. More information can be found <a
* href="https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels">here</a>.
*/
public static final AttributeKey<String> ANDROID_OS_API_LEVEL = stringKey("android.os.api_level");
public static final AttributeKey<String> ANDROID_OS_APILEVEL = stringKey("android.os.api_level");

/**
* This attribute represents the state the application has transitioned into at the occurrence of
Original file line number Diff line number Diff line change
@@ -20,72 +20,72 @@
public final class AwsIncubatingAttributes {

/** The JSON-serialized value of each item in the {@code AttributeDefinitions} request field. */
public static final AttributeKey<List<String>> AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS =
public static final AttributeKey<List<String>> AWS_DYNAMODB_ATTRIBUTEDEFINITIONS =
stringArrayKey("aws.dynamodb.attribute_definitions");

/** The value of the {@code AttributesToGet} request parameter. */
public static final AttributeKey<List<String>> AWS_DYNAMODB_ATTRIBUTES_TO_GET =
public static final AttributeKey<List<String>> AWS_DYNAMODB_ATTRIBUTESTOGET =
stringArrayKey("aws.dynamodb.attributes_to_get");

/** The value of the {@code ConsistentRead} request parameter. */
public static final AttributeKey<Boolean> AWS_DYNAMODB_CONSISTENT_READ =
public static final AttributeKey<Boolean> AWS_DYNAMODB_CONSISTENTREAD =
booleanKey("aws.dynamodb.consistent_read");

/** The JSON-serialized value of each item in the {@code ConsumedCapacity} response field. */
public static final AttributeKey<List<String>> AWS_DYNAMODB_CONSUMED_CAPACITY =
public static final AttributeKey<List<String>> AWS_DYNAMODB_CONSUMEDCAPACITY =
stringArrayKey("aws.dynamodb.consumed_capacity");

/** The value of the {@code Count} response parameter. */
public static final AttributeKey<Long> AWS_DYNAMODB_COUNT = longKey("aws.dynamodb.count");

/** The value of the {@code ExclusiveStartTableName} request parameter. */
public static final AttributeKey<String> AWS_DYNAMODB_EXCLUSIVE_START_TABLE =
public static final AttributeKey<String> AWS_DYNAMODB_EXCLUSIVESTARTTABLE =
stringKey("aws.dynamodb.exclusive_start_table");

/**
* The JSON-serialized value of each item in the {@code GlobalSecondaryIndexUpdates} request
* field.
*/
public static final AttributeKey<List<String>> AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES =
public static final AttributeKey<List<String>> AWS_DYNAMODB_GLOBALSECONDARYINDEXUPDATES =
stringArrayKey("aws.dynamodb.global_secondary_index_updates");

/** The JSON-serialized value of each item of the {@code GlobalSecondaryIndexes} request field */
public static final AttributeKey<List<String>> AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES =
public static final AttributeKey<List<String>> AWS_DYNAMODB_GLOBALSECONDARYINDEXES =
stringArrayKey("aws.dynamodb.global_secondary_indexes");

/** The value of the {@code IndexName} request parameter. */
public static final AttributeKey<String> AWS_DYNAMODB_INDEX_NAME =
public static final AttributeKey<String> AWS_DYNAMODB_INDEXNAME =
stringKey("aws.dynamodb.index_name");

/** The JSON-serialized value of the {@code ItemCollectionMetrics} response field. */
public static final AttributeKey<String> AWS_DYNAMODB_ITEM_COLLECTION_METRICS =
public static final AttributeKey<String> AWS_DYNAMODB_ITEMCOLLECTIONMETRICS =
stringKey("aws.dynamodb.item_collection_metrics");

/** The value of the {@code Limit} request parameter. */
public static final AttributeKey<Long> AWS_DYNAMODB_LIMIT = longKey("aws.dynamodb.limit");

/** The JSON-serialized value of each item of the {@code LocalSecondaryIndexes} request field. */
public static final AttributeKey<List<String>> AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES =
public static final AttributeKey<List<String>> AWS_DYNAMODB_LOCALSECONDARYINDEXES =
stringArrayKey("aws.dynamodb.local_secondary_indexes");

/** The value of the {@code ProjectionExpression} request parameter. */
public static final AttributeKey<String> AWS_DYNAMODB_PROJECTION =
stringKey("aws.dynamodb.projection");

/** The value of the {@code ProvisionedThroughput.ReadCapacityUnits} request parameter. */
public static final AttributeKey<Double> AWS_DYNAMODB_PROVISIONED_READ_CAPACITY =
public static final AttributeKey<Double> AWS_DYNAMODB_PROVISIONEDREADCAPACITY =
doubleKey("aws.dynamodb.provisioned_read_capacity");

/** The value of the {@code ProvisionedThroughput.WriteCapacityUnits} request parameter. */
public static final AttributeKey<Double> AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY =
public static final AttributeKey<Double> AWS_DYNAMODB_PROVISIONEDWRITECAPACITY =
doubleKey("aws.dynamodb.provisioned_write_capacity");

/** The value of the {@code ScanIndexForward} request parameter. */
public static final AttributeKey<Boolean> AWS_DYNAMODB_SCAN_FORWARD =
public static final AttributeKey<Boolean> AWS_DYNAMODB_SCANFORWARD =
booleanKey("aws.dynamodb.scan_forward");

/** The value of the {@code ScannedCount} response parameter. */
public static final AttributeKey<Long> AWS_DYNAMODB_SCANNED_COUNT =
public static final AttributeKey<Long> AWS_DYNAMODB_SCANNEDCOUNT =
longKey("aws.dynamodb.scanned_count");

/** The value of the {@code Segment} request parameter. */
@@ -95,15 +95,15 @@ public final class AwsIncubatingAttributes {
public static final AttributeKey<String> AWS_DYNAMODB_SELECT = stringKey("aws.dynamodb.select");

/** The number of items in the {@code TableNames} response parameter. */
public static final AttributeKey<Long> AWS_DYNAMODB_TABLE_COUNT =
public static final AttributeKey<Long> AWS_DYNAMODB_TABLECOUNT =
longKey("aws.dynamodb.table_count");

/** The keys in the {@code RequestItems} object field. */
public static final AttributeKey<List<String>> AWS_DYNAMODB_TABLE_NAMES =
public static final AttributeKey<List<String>> AWS_DYNAMODB_TABLENAMES =
stringArrayKey("aws.dynamodb.table_names");

/** The value of the {@code TotalSegments} request parameter. */
public static final AttributeKey<Long> AWS_DYNAMODB_TOTAL_SEGMENTS =
public static final AttributeKey<Long> AWS_DYNAMODB_TOTALSEGMENTS =
longKey("aws.dynamodb.total_segments");

/**
@@ -163,7 +163,7 @@ public final class AwsIncubatingAttributes {
* <li>This may be different from {@code cloud.resource_id} if an alias is involved.
* </ul>
*/
public static final AttributeKey<String> AWS_LAMBDA_INVOKED_ARN =
public static final AttributeKey<String> AWS_LAMBDA_INVOKEDARN =
stringKey("aws.lambda.invoked_arn");

/**
@@ -216,7 +216,7 @@ public final class AwsIncubatingAttributes {
* The AWS request ID as returned in the response headers {@code x-amz-request-id} or {@code
* x-amz-requestid}.
*/
public static final AttributeKey<String> AWS_REQUEST_ID = stringKey("aws.request_id");
public static final AttributeKey<String> AWS_REQUESTID = stringKey("aws.request_id");

/**
* The S3 bucket name the request refers to. Corresponds to the {@code --bucket} parameter of the
@@ -249,7 +249,7 @@ public final class AwsIncubatingAttributes {
* href="https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html">upload-part-copy</a>
* </ul>
*/
public static final AttributeKey<String> AWS_S3_COPY_SOURCE = stringKey("aws.s3.copy_source");
public static final AttributeKey<String> AWS_S3_COPYSOURCE = stringKey("aws.s3.copy_source");

/**
* The delete request container that specifies the objects to be deleted.
@@ -324,7 +324,7 @@ public final class AwsIncubatingAttributes {
* operation within the S3 API</a>.
* </ul>
*/
public static final AttributeKey<Long> AWS_S3_PART_NUMBER = longKey("aws.s3.part_number");
public static final AttributeKey<Long> AWS_S3_PARTNUMBER = longKey("aws.s3.part_number");

/**
* Upload ID that identifies the multipart upload.
@@ -348,7 +348,7 @@ public final class AwsIncubatingAttributes {
* href="https://docs.aws.amazon.com/cli/latest/reference/s3api/upload-part-copy.html">upload-part-copy</a>
* </ul>
*/
public static final AttributeKey<String> AWS_S3_UPLOAD_ID = stringKey("aws.s3.upload_id");
public static final AttributeKey<String> AWS_S3_UPLOADID = stringKey("aws.s3.upload_id");

// Enum definitions
/** Values for {@link #AWS_ECS_LAUNCHTYPE}. */
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ public final class CloudIncubatingAttributes {
* <li>Availability zones are called &quot;zones&quot; on Alibaba Cloud and Google Cloud.
* </ul>
*/
public static final AttributeKey<String> CLOUD_AVAILABILITY_ZONE =
public static final AttributeKey<String> CLOUD_AVAILABILITYZONE =
stringKey("cloud.availability_zone");

/**
@@ -93,102 +93,102 @@ public final class CloudIncubatingAttributes {
* functions that would usually share a TracerProvider.
* </ul>
*/
public static final AttributeKey<String> CLOUD_RESOURCE_ID = stringKey("cloud.resource_id");
public static final AttributeKey<String> CLOUD_RESOURCEID = stringKey("cloud.resource_id");

// Enum definitions
/** Values for {@link #CLOUD_PLATFORM}. */
public static final class CloudPlatformValues {
/** Alibaba Cloud Elastic Compute Service. */
public static final String ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs";
public static final String ALIBABACLOUDECS = "alibaba_cloud_ecs";

/** Alibaba Cloud Function Compute. */
public static final String ALIBABA_CLOUD_FC = "alibaba_cloud_fc";
public static final String ALIBABACLOUDFC = "alibaba_cloud_fc";

/** Red Hat OpenShift on Alibaba Cloud. */
public static final String ALIBABA_CLOUD_OPENSHIFT = "alibaba_cloud_openshift";
public static final String ALIBABACLOUDOPENSHIFT = "alibaba_cloud_openshift";

/** AWS Elastic Compute Cloud. */
public static final String AWS_EC2 = "aws_ec2";
public static final String AWSEC2 = "aws_ec2";

/** AWS Elastic Container Service. */
public static final String AWS_ECS = "aws_ecs";
public static final String AWSECS = "aws_ecs";

/** AWS Elastic Kubernetes Service. */
public static final String AWS_EKS = "aws_eks";
public static final String AWSEKS = "aws_eks";

/** AWS Lambda. */
public static final String AWS_LAMBDA = "aws_lambda";
public static final String AWSLAMBDA = "aws_lambda";

/** AWS Elastic Beanstalk. */
public static final String AWS_ELASTIC_BEANSTALK = "aws_elastic_beanstalk";
public static final String AWSELASTICBEANSTALK = "aws_elastic_beanstalk";

/** AWS App Runner. */
public static final String AWS_APP_RUNNER = "aws_app_runner";
public static final String AWSAPPRUNNER = "aws_app_runner";

/** Red Hat OpenShift on AWS (ROSA). */
public static final String AWS_OPENSHIFT = "aws_openshift";
public static final String AWSOPENSHIFT = "aws_openshift";

/** Azure Virtual Machines. */
public static final String AZURE_VM = "azure_vm";
public static final String AZUREVM = "azure_vm";

/** Azure Container Apps. */
public static final String AZURE_CONTAINER_APPS = "azure_container_apps";
public static final String AZURECONTAINERAPPS = "azure_container_apps";

/** Azure Container Instances. */
public static final String AZURE_CONTAINER_INSTANCES = "azure_container_instances";
public static final String AZURECONTAINERINSTANCES = "azure_container_instances";

/** Azure Kubernetes Service. */
public static final String AZURE_AKS = "azure_aks";
public static final String AZUREAKS = "azure_aks";

/** Azure Functions. */
public static final String AZURE_FUNCTIONS = "azure_functions";
public static final String AZUREFUNCTIONS = "azure_functions";

/** Azure App Service. */
public static final String AZURE_APP_SERVICE = "azure_app_service";
public static final String AZUREAPPSERVICE = "azure_app_service";

/** Azure Red Hat OpenShift. */
public static final String AZURE_OPENSHIFT = "azure_openshift";
public static final String AZUREOPENSHIFT = "azure_openshift";

/** Google Bare Metal Solution (BMS). */
public static final String GCP_BARE_METAL_SOLUTION = "gcp_bare_metal_solution";
public static final String GCPBAREMETALSOLUTION = "gcp_bare_metal_solution";

/** Google Cloud Compute Engine (GCE). */
public static final String GCP_COMPUTE_ENGINE = "gcp_compute_engine";
public static final String GCPCOMPUTEENGINE = "gcp_compute_engine";

/** Google Cloud Run. */
public static final String GCP_CLOUD_RUN = "gcp_cloud_run";
public static final String GCPCLOUDRUN = "gcp_cloud_run";

/** Google Cloud Kubernetes Engine (GKE). */
public static final String GCP_KUBERNETES_ENGINE = "gcp_kubernetes_engine";
public static final String GCPKUBERNETESENGINE = "gcp_kubernetes_engine";

/** Google Cloud Functions (GCF). */
public static final String GCP_CLOUD_FUNCTIONS = "gcp_cloud_functions";
public static final String GCPCLOUDFUNCTIONS = "gcp_cloud_functions";

/** Google Cloud App Engine (GAE). */
public static final String GCP_APP_ENGINE = "gcp_app_engine";
public static final String GCPAPPENGINE = "gcp_app_engine";

/** Red Hat OpenShift on Google Cloud. */
public static final String GCP_OPENSHIFT = "gcp_openshift";
public static final String GCPOPENSHIFT = "gcp_openshift";

/** Red Hat OpenShift on IBM Cloud. */
public static final String IBM_CLOUD_OPENSHIFT = "ibm_cloud_openshift";
public static final String IBMCLOUDOPENSHIFT = "ibm_cloud_openshift";

/** Tencent Cloud Cloud Virtual Machine (CVM). */
public static final String TENCENT_CLOUD_CVM = "tencent_cloud_cvm";
public static final String TENCENTCLOUDCVM = "tencent_cloud_cvm";

/** Tencent Cloud Elastic Kubernetes Service (EKS). */
public static final String TENCENT_CLOUD_EKS = "tencent_cloud_eks";
public static final String TENCENTCLOUDEKS = "tencent_cloud_eks";

/** Tencent Cloud Serverless Cloud Function (SCF). */
public static final String TENCENT_CLOUD_SCF = "tencent_cloud_scf";
public static final String TENCENTCLOUDSCF = "tencent_cloud_scf";

private CloudPlatformValues() {}
}

/** Values for {@link #CLOUD_PROVIDER}. */
public static final class CloudProviderValues {
/** Alibaba Cloud. */
public static final String ALIBABA_CLOUD = "alibaba_cloud";
public static final String ALIBABACLOUD = "alibaba_cloud";

/** Amazon Web Services. */
public static final String AWS = "aws";
@@ -203,10 +203,10 @@ public static final class CloudProviderValues {
public static final String HEROKU = "heroku";

/** IBM Cloud. */
public static final String IBM_CLOUD = "ibm_cloud";
public static final String IBMCLOUD = "ibm_cloud";

/** Tencent Cloud. */
public static final String TENCENT_CLOUD = "tencent_cloud";
public static final String TENCENTCLOUD = "tencent_cloud";

private CloudProviderValues() {}
}
Original file line number Diff line number Diff line change
@@ -19,38 +19,38 @@ public final class CloudeventsIncubatingAttributes {
* href="https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#id">event_id</a>
* uniquely identifies the event.
*/
public static final AttributeKey<String> CLOUDEVENTS_EVENT_ID = stringKey("cloudevents.event_id");
public static final AttributeKey<String> CLOUDEVENTS_EVENTID = stringKey("cloudevents.event_id");

/**
* The <a
* href="https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#source-1">source</a>
* identifies the context in which an event happened.
*/
public static final AttributeKey<String> CLOUDEVENTS_EVENT_SOURCE =
public static final AttributeKey<String> CLOUDEVENTS_EVENTSOURCE =
stringKey("cloudevents.event_source");

/**
* The <a
* href="https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#specversion">version
* of the CloudEvents specification</a> which the event uses.
*/
public static final AttributeKey<String> CLOUDEVENTS_EVENT_SPEC_VERSION =
public static final AttributeKey<String> CLOUDEVENTS_EVENTSPECVERSION =
stringKey("cloudevents.event_spec_version");

/**
* The <a
* href="https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#subject">subject</a>
* of the event in the context of the event producer (identified by source).
*/
public static final AttributeKey<String> CLOUDEVENTS_EVENT_SUBJECT =
public static final AttributeKey<String> CLOUDEVENTS_EVENTSUBJECT =
stringKey("cloudevents.event_subject");

/**
* The <a
* href="https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md#type">event_type</a>
* contains a value describing the type of event related to the originating occurrence.
*/
public static final AttributeKey<String> CLOUDEVENTS_EVENT_TYPE =
public static final AttributeKey<String> CLOUDEVENTS_EVENTTYPE =
stringKey("cloudevents.event_type");

private CloudeventsIncubatingAttributes() {}
Original file line number Diff line number Diff line change
@@ -33,11 +33,11 @@ public final class ContainerIncubatingAttributes {
/**
* All the command arguments (including the command/executable itself) run by the container. [2]
*/
public static final AttributeKey<List<String>> CONTAINER_COMMAND_ARGS =
public static final AttributeKey<List<String>> CONTAINER_COMMANDARGS =
stringArrayKey("container.command_args");

/** The full command run by the container as a single string representing the full command. [2] */
public static final AttributeKey<String> CONTAINER_COMMAND_LINE =
public static final AttributeKey<String> CONTAINER_COMMANDLINE =
stringKey("container.command_line");

/** The CPU state for this data point. */
@@ -85,7 +85,7 @@ public final class ContainerIncubatingAttributes {
* report those under the {@code RepoDigests} field.
* </ul>
*/
public static final AttributeKey<List<String>> CONTAINER_IMAGE_REPO_DIGESTS =
public static final AttributeKey<List<String>> CONTAINER_IMAGE_REPODIGESTS =
stringArrayKey("container.image.repo_digests");

/**
Loading