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

Update the semantic conventions to 1.6.0 #3524

Merged
merged 1 commit into from
Aug 23, 2021
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
2 changes: 1 addition & 1 deletion buildscripts/semantic-convention/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR="${SCRIPT_DIR}/../../"

# freeze the spec & generator tools versions to make SemanticAttributes generation reproducible
SEMCONV_VERSION=1.5.0
SEMCONV_VERSION=1.6.0
SPEC_VERSION=v$SEMCONV_VERSION
SCHEMA_URL=https://opentelemetry.io/schemas/$SEMCONV_VERSION
GENERATOR_VERSION=0.4.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public final class {{class}} {
public static final class {{class_name}} {
{%- for member in attribute.attr_type.members %}
/** {% filter escape %}{{member.brief | to_doc_brief}}.{% endfilter %} */
public static final {{ type }} {{ member.member_id | to_const_name }} = {{ print_value(type, member.value) }};
public static final {{ type }} {{ member.member_id | to_const_name | regex_replace(" ", "_") | regex_replace("^([0-9])","_$1") }} = {{ print_value(type, member.value) }};
Copy link
Contributor

@anuraaga anuraaga Aug 23, 2021

Choose a reason for hiding this comment

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

Let's just file an issue to revert this in 1.7.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

1.7.0 is going to break a bunch of stuff that went in in 1.6.0, due to this stuff. That's why I was wondering if we should skip 1.6.0. I'm fine either way.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I read the linked issue and get it better now - so the NetHostConnectionSubtypeValues would change from what I understand. Hrm - I guess we can still go for it, it's what we have the schema URLs for for better or worse

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wonder if they'll create a schema for 1.7.0 that maps between the changes. And, how that will interact with the fact that we're having to actually change the keys here, since they aren't java compliant constant values.

Copy link
Member

Choose a reason for hiding this comment

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

I think a schema can only handle the values.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess that makes sense, yes. 👍🏽

{%- endfor %}
private {{ class_name }}() {}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// buildscripts/semantic-convention/templates/SemanticAttributes.java.j2
public final class ResourceAttributes {
/** The URL of the OpenTelemetry schema for these keys and values. */
public static final String SCHEMA_URL = "https://opentelemetry.io/schemas/1.5.0";
public static final String SCHEMA_URL = "https://opentelemetry.io/schemas/1.6.0";

/** Name of the cloud provider. */
public static final AttributeKey<String> CLOUD_PROVIDER = stringKey("cloud.provider");
Expand All @@ -27,6 +27,7 @@ public final class ResourceAttributes {
/**
* The geographical region the resource is running. Refer to your provider's docs to see the
* available regions, for example <a
* href="https://www.alibabacloud.com/help/doc-detail/40654.htm">Alibaba Cloud regions</a>, <a
* href="https://aws.amazon.com/about-aws/global-infrastructure/regions_az/">AWS regions</a>, <a
* href="https://azure.microsoft.com/en-us/global-infrastructure/geographies/">Azure regions</a>,
* or <a href="https://cloud.google.com/about/locations">Google Cloud regions</a>.
Expand All @@ -40,7 +41,7 @@ public final class ResourceAttributes {
* <p>Notes:
*
* <ul>
* <li>Availability zones are called &quot;zones&quot; on Google Cloud.
* <li>Availability zones are called &quot;zones&quot; on Alibaba Cloud and Google Cloud.
* </ul>
*/
public static final AttributeKey<String> CLOUD_AVAILABILITY_ZONE =
Expand Down Expand Up @@ -548,6 +549,8 @@ public final class ResourceAttributes {

// Enum definitions
public static final class CloudProviderValues {
/** Alibaba Cloud. */
public static final String ALIBABA_CLOUD = "alibaba_cloud";
/** Amazon Web Services. */
public static final String AWS = "aws";
/** Microsoft Azure. */
Expand All @@ -559,6 +562,10 @@ private CloudProviderValues() {}
}

public static final class CloudPlatformValues {
/** Alibaba Cloud Elastic Compute Service. */
public static final String ALIBABA_CLOUD_ECS = "alibaba_cloud_ecs";
/** Alibaba Cloud Function Compute. */
public static final String ALIBABA_CLOUD_FC = "alibaba_cloud_fc";
/** AWS Elastic Compute Cloud. */
public static final String AWS_EC2 = "aws_ec2";
/** AWS Elastic Container Service. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// buildscripts/semantic-convention/templates/SemanticAttributes.java.j2
public final class SemanticAttributes {
/** The URL of the OpenTelemetry schema for these keys and values. */
public static final String SCHEMA_URL = "https://opentelemetry.io/schemas/1.5.0";
public static final String SCHEMA_URL = "https://opentelemetry.io/schemas/1.6.0";

/**
* The full invoked ARN as provided on the {@code Context} passed to the function ({@code
Expand Down Expand Up @@ -344,6 +344,30 @@ public final class SemanticAttributes {
/** Local hostname or similar, see note below. */
public static final AttributeKey<String> NET_HOST_NAME = stringKey("net.host.name");

/** The internet connection type currently being used by the host. */
public static final AttributeKey<String> NET_HOST_CONNECTION_TYPE =
stringKey("net.host.connection.type");

/**
* This describes more details regarding the connection.type. It may be the type of cell
* technology connection, but it could be used for describing details about a wifi connection.
*/
public static final AttributeKey<String> NET_HOST_CONNECTION_SUBTYPE =
stringKey("net.host.connection.subtype");

/** The name of the mobile carrier. */
public static final AttributeKey<String> NET_HOST_CARRIER_NAME =
stringKey("net.host.carrier.name");

/** The mobile carrier country code. */
public static final AttributeKey<String> NET_HOST_CARRIER_MCC = stringKey("net.host.carrier.mcc");

/** The mobile carrier network code. */
public static final AttributeKey<String> NET_HOST_CARRIER_MNC = stringKey("net.host.carrier.mnc");

/** The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. */
public static final AttributeKey<String> NET_HOST_CARRIER_ICC = stringKey("net.host.carrier.icc");

/**
* The <a href="../../resource/semantic_conventions/README.md#service">{@code service.name}</a> of
* the remote service. SHOULD be equal to the actual {@code service.name} resource attribute of
Expand Down Expand Up @@ -917,6 +941,8 @@ private FaasDocumentOperationValues() {}
}

public static final class FaasInvokedProviderValues {
/** Alibaba Cloud. */
public static final String ALIBABA_CLOUD = "alibaba_cloud";
/** Amazon Web Services. */
public static final String AWS = "aws";
/** Microsoft Azure. */
Expand Down Expand Up @@ -946,6 +972,68 @@ public static final class NetTransportValues {
private NetTransportValues() {}
}

public static final class NetHostConnectionTypeValues {
/** wifi. */
public static final String WIFI = "wifi";
/** wired. */
public static final String WIRED = "wired";
/** cell. */
public static final String CELL = "cell";
/** unavailable. */
public static final String UNAVAILABLE = "unavailable";
/** unknown. */
public static final String UNKNOWN = "unknown";

private NetHostConnectionTypeValues() {}
}

public static final class NetHostConnectionSubtypeValues {
/** GPRS. */
public static final String GPRS = "GPRS";
/** EDGE. */
public static final String EDGE = "EDGE";
/** UMTS. */
public static final String UMTS = "UMTS";
/** CDMA. */
public static final String CDMA = "CDMA";
/** EVDO_0. */
public static final String EVDO_0 = "EVDO_0";
/** EVDO_A. */
public static final String EVDO_A = "EVDO_A";
/** 1xRTT. */
public static final String _1XRTT = "1xRTT";
/** HSDPA. */
public static final String HSDPA = "HSDPA";
/** HSUPA. */
public static final String HSUPA = "HSUPA";
/** HSPA. */
public static final String HSPA = "HSPA";
/** IDEN. */
public static final String IDEN = "IDEN";
/** EVDO_B. */
public static final String EVDO_B = "EVDO_B";
/** LTE. */
public static final String LTE = "LTE";
/** EHRPD. */
public static final String EHRPD = "EHRPD";
/** HSPAP. */
public static final String HSPAP = "HSPAP";
/** GSM. */
public static final String GSM = "GSM";
/** TD_SCDMA. */
public static final String TD_SCDMA = "TD_SCDMA";
/** IWLAN. */
public static final String IWLAN = "IWLAN";
/** NR. */
public static final String NR = "NR";
/** NRNSA. */
public static final String NRNSA = "NRNSA";
/** LTE_CA. */
public static final String LTE_CA = "LTE_CA";

private NetHostConnectionSubtypeValues() {}
}

public static final class HttpFlavorValues {
/** HTTP 1.0. */
public static final String HTTP_1_0 = "1.0";
Expand Down