Skip to content

Commit

Permalink
Merge branch 'main' into Build_DLL
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomsonTan authored Feb 10, 2023
2 parents 0b858a6 + 9d8efaf commit 5ecbf16
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
14 changes: 9 additions & 5 deletions api/include/opentelemetry/trace/semantic_conventions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
*
* <p>Notes:
<ul> <li>'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.</li> </ul>
<ul> <li>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 <a href="#http-server-definitions">application root</a> if there is one.</li> </ul>
*/
static constexpr const char *kHttpRoute = "http.route";

Expand Down Expand Up @@ -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. */
Expand Down Expand Up @@ -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
Expand Down
17 changes: 15 additions & 2 deletions buildscripts/semantic-convention/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand All @@ -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 \
Expand All @@ -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 \
Expand Down
4 changes: 2 additions & 2 deletions sdk/include/opentelemetry/sdk/common/env_variables.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<char> endpoint_buffer;
std::unique_ptr<char[]> endpoint_buffer;
if (required_size > 0)
{
endpoint_buffer = std::unique_ptr<char>{new char[required_size]};
endpoint_buffer = std::unique_ptr<char[]>{new char[required_size]};
getenv_s(&required_size, endpoint_buffer.get(), required_size, env_var_name);
endpoint_from_env = endpoint_buffer.get();
}
Expand Down
4 changes: 2 additions & 2 deletions sdk/include/opentelemetry/sdk/resource/semantic_conventions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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). */
Expand Down

0 comments on commit 5ecbf16

Please sign in to comment.