diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2b960efd52..0ecbc24737 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -20,6 +20,8 @@ Increment the:
* [BUILD] Build OpenTelemetry SDK and exporters into DLL
[#1932](https://github.com/open-telemetry/opentelemetry-cpp/pull/1932)
* [CI] Enforce copyright check in CI [#1965](https://github.com/open-telemetry/opentelemetry-cpp/pull/1965)
+* [SEMANTIC CONVENTIONS] Upgrade to version 1.18.0
+ [#1974](https://github.com/open-telemetry/opentelemetry-cpp/pull/1974)
## [1.8.2] 2023-01-31
diff --git a/api/CMakeLists.txt b/api/CMakeLists.txt
index 7ef31757f3..8a7b35806e 100644
--- a/api/CMakeLists.txt
+++ b/api/CMakeLists.txt
@@ -81,7 +81,7 @@ if(WITH_LOGS_PREVIEW)
target_compile_definitions(opentelemetry_api INTERFACE ENABLE_LOGS_PREVIEW)
endif()
-if(WITH_NO_GENENV)
+if(WITH_NO_GETENV)
target_compile_definitions(opentelemetry_api INTERFACE NO_GETENV)
endif()
diff --git a/api/include/opentelemetry/trace/semantic_conventions.h b/api/include/opentelemetry/trace/semantic_conventions.h
index d2d7bf76bb..d0485704ef 100644
--- a/api/include/opentelemetry/trace/semantic_conventions.h
+++ b/api/include/opentelemetry/trace/semantic_conventions.h
@@ -21,7 +21,7 @@ namespace SemanticConventions
/**
* The URL of the OpenTelemetry schema for these keys and values.
*/
-static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.17.0";
+static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.18.0";
/**
* The type of the exception (its fully-qualified class name, if applicable). The dynamic type of
@@ -595,12 +595,12 @@ static constexpr const char *kHttpTarget = "http.target";
/**
* The matched route (path template in the format used by the respective server framework). See note
- below
+below
*
*
Notes:
-
- 'http.route' MUST NOT be populated when this is not supported by the HTTP server
- framework as the route attribute should have low-cardinality and the URI path can NOT substitute
- it.
+ - MUST NOT be populated when this is not supported by the HTTP server framework as the
+route attribute should have low-cardinality and the URI path can NOT substitute it. SHOULD include
+the application root if there is one.
*/
static constexpr const char *kHttpRoute = "http.route";
@@ -1079,6 +1079,8 @@ namespace DbSystemValues
static constexpr const char *kOtherSql = "other_sql";
/** Microsoft SQL Server. */
static constexpr const char *kMssql = "mssql";
+/** Microsoft SQL Server Compact. */
+static constexpr const char *kMssqlcompact = "mssqlcompact";
/** MySQL. */
static constexpr const char *kMysql = "mysql";
/** Oracle Database. */
@@ -1173,6 +1175,8 @@ static constexpr const char *kCockroachdb = "cockroachdb";
static constexpr const char *kOpensearch = "opensearch";
/** ClickHouse. */
static constexpr const char *kClickhouse = "clickhouse";
+/** Cloud Spanner. */
+static constexpr const char *kSpanner = "spanner";
} // namespace DbSystemValues
namespace DbCassandraConsistencyLevelValues
diff --git a/buildscripts/semantic-convention/generate.sh b/buildscripts/semantic-convention/generate.sh
index d0d0272ca8..ee9d3ae1a4 100755
--- a/buildscripts/semantic-convention/generate.sh
+++ b/buildscripts/semantic-convention/generate.sh
@@ -13,10 +13,15 @@ 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.17.0
+
+# repository: https://github.com/open-telemetry/opentelemetry-specification
+SEMCONV_VERSION=1.18.0
+
+# repository: https://github.com/open-telemetry/build-tools
+GENERATOR_VERSION=0.15.1
+
SPEC_VERSION=v$SEMCONV_VERSION
SCHEMA_URL=https://opentelemetry.io/schemas/$SEMCONV_VERSION
-GENERATOR_VERSION=0.14.0
cd ${SCRIPT_DIR}
@@ -30,6 +35,12 @@ git fetch origin "$SPEC_VERSION"
git reset --hard FETCH_HEAD
cd ${SCRIPT_DIR}
+# echo "Help ..."
+
+# docker run --rm otel/semconvgen:$GENERATOR_VERSION -h
+
+echo "Generating semantic conventions for traces ..."
+
docker run --rm \
-v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions:/source \
-v ${SCRIPT_DIR}/templates:/templates \
@@ -45,6 +56,8 @@ docker run --rm \
-Dnamespace_open="namespace trace {" \
-Dnamespace_close="}"
+echo "Generating semantic conventions for resources ..."
+
docker run --rm \
-v ${SCRIPT_DIR}/opentelemetry-specification/semantic_conventions:/source \
-v ${SCRIPT_DIR}/templates:/templates \
diff --git a/sdk/include/opentelemetry/sdk/common/env_variables.h b/sdk/include/opentelemetry/sdk/common/env_variables.h
index be955ee86a..b1e81e7fd8 100644
--- a/sdk/include/opentelemetry/sdk/common/env_variables.h
+++ b/sdk/include/opentelemetry/sdk/common/env_variables.h
@@ -33,10 +33,10 @@ inline const std::string GetEnvironmentVariable(const char *env_var_name)
// avoid calling std::getenv which is deprecated in MSVC.
size_t required_size = 0;
getenv_s(&required_size, nullptr, 0, env_var_name);
- std::unique_ptr endpoint_buffer;
+ std::unique_ptr endpoint_buffer;
if (required_size > 0)
{
- endpoint_buffer = std::unique_ptr{new char[required_size]};
+ endpoint_buffer = std::unique_ptr{new char[required_size]};
getenv_s(&required_size, endpoint_buffer.get(), required_size, env_var_name);
endpoint_from_env = endpoint_buffer.get();
}
diff --git a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h
index e6e982e1b2..27aff268cc 100644
--- a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h
+++ b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h
@@ -23,7 +23,7 @@ namespace SemanticConventions
/**
* The URL of the OpenTelemetry schema for these keys and values.
*/
-static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.17.0";
+static constexpr const char *kSchemaUrl = "https://opentelemetry.io/schemas/1.18.0";
/**
* Array of brand name and version separated by a space
@@ -754,7 +754,7 @@ static constexpr const char *kGcpCloudFunctions = "gcp_cloud_functions";
/** Google Cloud App Engine (GAE). */
static constexpr const char *kGcpAppEngine = "gcp_app_engine";
/** Red Hat OpenShift on Google Cloud. */
-static constexpr const char *kGoogleCloudOpenshift = "google_cloud_openshift";
+static constexpr const char *kGcpOpenshift = "gcp_openshift";
/** Red Hat OpenShift on IBM Cloud. */
static constexpr const char *kIbmCloudOpenshift = "ibm_cloud_openshift";
/** Tencent Cloud Cloud Virtual Machine (CVM). */