diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index cc63677a24..92981bc8d1 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -13,7 +13,7 @@ jobs: name: Run OpenTelemetry-cpp benchmarks runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: Mount Bazel Cache @@ -25,12 +25,12 @@ jobs: key: bazel_benchmark - name: setup run: | - sudo -E ./ci/setup_cmake.sh - sudo -E ./ci/setup_ci_environment.sh + sudo ./ci/setup_ci_environment.sh + sudo ./ci/install_bazelisk.sh - name: Run benchmark id: run_benchmarks run: | - CC=/usr/bin/gcc-10 CXX=/usr/bin/g++-10 ci/do_ci.sh bazel.benchmark + ./ci/do_ci.sh bazel.benchmark mkdir -p benchmarks mv api-benchmark_result.json benchmarks mv sdk-benchmark_result.json benchmarks @@ -47,7 +47,7 @@ jobs: name: Store benchmark result runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: actions/download-artifact@master with: name: benchmark_results diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68b40058c3..2d8db91364 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: name: CMake test (without otlp-exporter) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -36,7 +36,7 @@ jobs: name: CMake gcc 12 (maintainer mode, C++11, async) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -69,7 +69,7 @@ jobs: name: CMake gcc 12 (maintainer mode, sync) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -101,7 +101,7 @@ jobs: name: CMake gcc 12 (maintainer mode, async) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -133,7 +133,7 @@ jobs: name: CMake clang 14 (maintainer mode, sync) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -165,7 +165,7 @@ jobs: name: CMake clang 14 (maintainer mode, async) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -197,7 +197,7 @@ jobs: name: CMake msvc (maintainer mode) runs-on: windows-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -211,7 +211,7 @@ jobs: name: CMake test (without otlp-exporter and with async export) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -232,7 +232,7 @@ jobs: name: CMake test (with abseil) runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -248,7 +248,7 @@ jobs: name: CMake test (with opentracing-shim) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -262,7 +262,7 @@ jobs: name: CMake gcc 4.8 (without otlp exporter) runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: Add Ubuntu Xenial package sources @@ -291,7 +291,7 @@ jobs: name: CMake gcc 4.8 (with otlp exporter) runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: Add Ubuntu Xenial package sources @@ -320,7 +320,7 @@ jobs: name: CMake C++20 test(GCC) runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -342,7 +342,7 @@ jobs: name: CMake C++20 test(Clang with libc++) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -373,7 +373,7 @@ jobs: name: CMake test (with otlp-exporter) runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -389,7 +389,7 @@ jobs: name: CMake test (with modern protobuf,grpc and abseil) runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -414,7 +414,7 @@ jobs: name: CMake do not install test (with otlp-exporter) runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -430,7 +430,7 @@ jobs: name: CMake test (build shared libraries with otlp-exporter and static gRPC) runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -446,7 +446,7 @@ jobs: name: CMake install test (with abseil) runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -465,7 +465,7 @@ jobs: name: Plugin -> CMake runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -485,7 +485,7 @@ jobs: name: Bazel runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: Mount Bazel Cache @@ -506,7 +506,7 @@ jobs: name: Bazel with async export runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: Mount Bazel Cache @@ -527,7 +527,7 @@ jobs: name: Bazel with external abseil runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: Mount Bazel Cache @@ -548,7 +548,7 @@ jobs: name: Bazel valgrind runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: Mount Bazel Cache @@ -569,7 +569,7 @@ jobs: name: Bazel noexcept runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: Mount Bazel Cache @@ -590,7 +590,7 @@ jobs: name: Bazel nortti runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: Mount Bazel Cache @@ -611,7 +611,7 @@ jobs: name: Bazel asan config runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: Mount Bazel Cache @@ -632,7 +632,7 @@ jobs: name: Bazel tsan config runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: Mount Bazel Cache @@ -653,7 +653,7 @@ jobs: name: Bazel on MacOS runs-on: macos-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: Mount Bazel Cache @@ -670,7 +670,7 @@ jobs: name: Benchmark runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: Mount Bazel Cache @@ -698,7 +698,7 @@ jobs: name: Format runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: setup run: sudo ./ci/install_format_tools.sh - name: run tests @@ -708,7 +708,7 @@ jobs: name: Copyright runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: check copyright run: ./tools/check_copyright.sh @@ -716,7 +716,7 @@ jobs: name: CMake -> exporter proto runs-on: windows-2019 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -733,7 +733,7 @@ jobs: name: CMake -> exporter proto (Build as DLL) runs-on: windows-2019 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -750,7 +750,7 @@ jobs: name: CMake (With async export) -> exporter proto runs-on: windows-2019 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -767,7 +767,7 @@ jobs: name: Bazel Windows runs-on: windows-2019 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -780,7 +780,7 @@ jobs: name: Plugin -> CMake Windows runs-on: windows-2019 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -794,7 +794,7 @@ jobs: name: Code coverage runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: 'recursive' - name: setup @@ -819,7 +819,7 @@ jobs: steps: - name: check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: install markdownlint-cli run: sudo npm install -g markdownlint-cli @@ -831,7 +831,7 @@ jobs: runs-on: ubuntu-latest steps: - name: check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: install misspell run: | curl -L -o ./install-misspell.sh https://git.io/misspell @@ -843,7 +843,7 @@ jobs: name: DocFX check runs-on: windows-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: install docfx run: choco install docfx -y --version=2.58.5 - name: run ./ci/docfx.cmd diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 15187cb39b..2d84fcff1c 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: 'recursive' - name: Remove Third_party Modules from Code Scan diff --git a/.github/workflows/dependencies_image.yml b/.github/workflows/dependencies_image.yml index d5a96bd432..670565a943 100644 --- a/.github/workflows/dependencies_image.yml +++ b/.github/workflows/dependencies_image.yml @@ -11,7 +11,7 @@ jobs: steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up QEMU uses: docker/setup-qemu-action@v2 diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 534fb60743..65c084eb93 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,4 +1,4 @@ -name: "Mark and close stale issues" +name: "Mark stale issues" on: schedule: - cron: "30 1 * * *" @@ -11,4 +11,5 @@ jobs: with: stale-issue-message: "This issue was marked as stale due to lack of activity." days-before-issue-stale: 60 + days-before-close: -1 exempt-issue-labels: "do-not-stale" diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c4ce6f45f..f09553ce70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,9 @@ Increment the: ## [Unreleased] +* [DEPRECATION] Deprecate ZPAGES + [#2291](https://github.com/open-telemetry/opentelemetry-cpp/pull/2291) + ## [1.11.0] 2023-08-21 * [BUILD] Fix more cases for symbol name for 32-bit win32 DLL build diff --git a/CMakeLists.txt b/CMakeLists.txt index 664cc229ea..719a7b2475 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -171,7 +171,8 @@ option(WITH_PROMETHEUS "Whether to include the Prometheus Client in the SDK" option(WITH_ELASTICSEARCH "Whether to include the Elasticsearch Client in the SDK" OFF) -option(WITH_ZPAGES "Whether to include the Zpages Server in the SDK" OFF) +option(WITH_ZPAGES + "DEPRECATED - Whether to include the Zpages Server in the SDK" OFF) option(WITH_NO_GETENV "Whether the platform supports environment variables" OFF) @@ -244,6 +245,14 @@ option(WITH_OTLP_HTTP_SSL_TLS_PREVIEW option(WITH_METRICS_EXEMPLAR_PREVIEW "Whether to enable exemplar within metrics" OFF) +if(WITH_ZPAGES) + if(WITH_NO_DEPRECATED_CODE) + message(FATAL_ERROR "WITH_ZPAGES is DEPRECATED.") + else() + message(WARNING "WITH_ZPAGES is DEPRECATED.") + endif() +endif() + # # Verify options dependencies # diff --git a/DEPRECATED.md b/DEPRECATED.md index d77c3f073e..05ba8e52d4 100644 --- a/DEPRECATED.md +++ b/DEPRECATED.md @@ -151,7 +151,89 @@ N/A ## [opentelemetry-cpp Exporter] -N/A +### ZPages exporter + +#### Announcement (ZPages) + +* Version: 1.11.0 +* Date: 2023-09-01 +* PR: [DEPRECATION] Deprecate ZPAGES + [#2291](https://github.com/open-telemetry/opentelemetry-cpp/pull/2291) + +#### Motivation (ZPages) + +The ZPages specification itself was introduced in 2020, +and has been experimental ever since, +not getting a lot of attention, and never reaching a stable status. + +Several other opentelemetry projects have implemented support for zpages, +only to later deprecate and then remove the zpages implementation (Java, +C#), abandoning the zpages feature. + +In this context, it does not make sense to continue to maintain the zpages +code in opentelemetry-cpp. + +#### Scope (ZPages) + +The following are deprecated and planned for removal: + +* all the API headers located under + `ext/include/opentelemetry/ext/zpages/`, including: + * the C++ class `ThreadsafeSpanData` + * the C++ class `TracezDataAggregator` + * the C++ class `TracezHttpServer` + * the C++ class `TracezSpanProcessor` + * the C++ class `TracezSharedData` + * the C++ class `ZPages` + * the C++ class `zPagesHttpServer` +* all the code and doc located under `ext/src/zpages/` +* all the tests located under `ext/test/zpages/` +* the zpages exporter library(`opentelemetry_zpages`) +* the zpages build options in CMake (`WITH_ZPAGES`) + +The following code is no longer considered public, will no longer be +installed, and will no longer be useable outside of +the opentelemetry-cpp implementation: + +* all the API headers located under + `ext/include/opentelemetry/ext/http/server`, including: + * the C++ class `FileHttpServer` + * the C++ class `HttpRequestCallback` + * the C++ class `HttpServer` + * the C++ class `HttpRequestHandler` + * the C++ class `SocketCallback` + +This implementation of an HTTP server is meant to be used for testing only, +it is not production ready. + +#### Mitigation (ZPages) + +Consider using a different exporter, +for example the OTLP exporter (both OTLP HTTP and OTLP GRPC are supported), +to expose trace data to a separate trace backend. + +Note that this changes the access pattern: + +* with zpages, data is only available locally (in process) +* with other exporters, data is available externally (not in process) + +Our assessment is that the zpages implementation is no longer in use, +and can be removed. + +If that assessment is incorrect (i.e., if you own a project that depends +on the zpage exporter from opentelemetry-cpp), please comment on the +removal issue +[#2292](https://github.com/open-telemetry/opentelemetry-cpp/issues/2292). + +An alternative to zpage removal is to move the code to the +opentelemetry-cpp-contrib github +[repository](https://github.com/open-telemetry/opentelemetry-cpp-contrib). + +Contributions to migrate the code, and maintain zpages, are welcome. + +#### Planned removal (ZPages) + +* Date: December, 2023 ## [Documentation] diff --git a/api/include/opentelemetry/trace/semantic_conventions.h b/api/include/opentelemetry/trace/semantic_conventions.h index 42cf57d0ec..c46b41bc52 100644 --- a/api/include/opentelemetry/trace/semantic_conventions.h +++ b/api/include/opentelemetry/trace/semantic_conventions.h @@ -10,6 +10,7 @@ #pragma once +#include "opentelemetry/common/macros.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -55,105 +56,168 @@ static constexpr const char *kClientSocketPort = "client.socket.port"; /** * Deprecated, use {@code http.request.method} instead. + * + * @deprecated Deprecated, use `http.request.method` instead. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kHttpMethod = "http.method"; /** * Deprecated, use {@code http.response.status_code} instead. + * + * @deprecated Deprecated, use `http.response.status_code` instead. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kHttpStatusCode = "http.status_code"; /** * Deprecated, use {@code url.scheme} instead. + * + * @deprecated Deprecated, use `url.scheme` instead. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kHttpScheme = "http.scheme"; /** * Deprecated, use {@code url.full} instead. + * + * @deprecated Deprecated, use `url.full` instead. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kHttpUrl = "http.url"; /** * Deprecated, use {@code url.path} and {@code url.query} instead. + * + * @deprecated Deprecated, use `url.path` and `url.query` instead. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kHttpTarget = "http.target"; /** * Deprecated, use {@code http.request.body.size} instead. + * + * @deprecated Deprecated, use `http.request.body.size` instead. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kHttpRequestContentLength = "http.request_content_length"; /** * Deprecated, use {@code http.response.body.size} instead. + * + * @deprecated Deprecated, use `http.response.body.size` instead. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kHttpResponseContentLength = "http.response_content_length"; /** * Deprecated, use {@code server.socket.domain} on client spans. + * + * @deprecated Deprecated, use `server.socket.domain` on client spans. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kNetSockPeerName = "net.sock.peer.name"; /** * Deprecated, use {@code server.socket.address} on client spans and {@code client.socket.address} * on server spans. + * + * @deprecated Deprecated, use `server.socket.address` on client spans and `client.socket.address` + * on server spans. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kNetSockPeerAddr = "net.sock.peer.addr"; /** * Deprecated, use {@code server.socket.port} on client spans and {@code client.socket.port} on * server spans. + * + * @deprecated Deprecated, use `server.socket.port` on client spans and `client.socket.port` on + * server spans. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kNetSockPeerPort = "net.sock.peer.port"; /** * Deprecated, use {@code server.address} on client spans and {@code client.address} on server * spans. + * + * @deprecated Deprecated, use `server.address` on client spans and `client.address` on server + * spans. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kNetPeerName = "net.peer.name"; /** * Deprecated, use {@code server.port} on client spans and {@code client.port} on server spans. + * + * @deprecated Deprecated, use `server.port` on client spans and `client.port` on server spans. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kNetPeerPort = "net.peer.port"; /** * Deprecated, use {@code server.address}. + * + * @deprecated Deprecated, use `server.address`. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kNetHostName = "net.host.name"; /** * Deprecated, use {@code server.port}. + * + * @deprecated Deprecated, use `server.port`. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kNetHostPort = "net.host.port"; /** * Deprecated, use {@code server.socket.address}. + * + * @deprecated Deprecated, use `server.socket.address`. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kNetSockHostAddr = "net.sock.host.addr"; /** * Deprecated, use {@code server.socket.port}. + * + * @deprecated Deprecated, use `server.socket.port`. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kNetSockHostPort = "net.sock.host.port"; /** * Deprecated, use {@code network.transport}. + * + * @deprecated Deprecated, use `network.transport`. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kNetTransport = "net.transport"; /** * Deprecated, use {@code network.protocol.name}. + * + * @deprecated Deprecated, use `network.protocol.name`. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kNetProtocolName = "net.protocol.name"; /** * Deprecated, use {@code network.protocol.version}. + * + * @deprecated Deprecated, use `network.protocol.version`. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kNetProtocolVersion = "net.protocol.version"; /** * Deprecated, use {@code network.transport} and {@code network.type}. + * + * @deprecated Deprecated, use `network.transport` and `network.type`. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kNetSockFamily = "net.sock.family"; /** diff --git a/buildscripts/semantic-convention/templates/SemanticAttributes.h.j2 b/buildscripts/semantic-convention/templates/SemanticAttributes.h.j2 index 1f0188a5e3..d35b99444e 100644 --- a/buildscripts/semantic-convention/templates/SemanticAttributes.h.j2 +++ b/buildscripts/semantic-convention/templates/SemanticAttributes.h.j2 @@ -39,6 +39,7 @@ #pragma once +#include "opentelemetry/common/macros.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -59,13 +60,13 @@ static constexpr const char *kSchemaUrl = "{{schemaUrl}}"; *

Notes:

{%- endif %} -{%- if attribute.deprecated %} +{%- if (attribute.stability | string()) == "StabilityLevel.DEPRECATED" %} * - * @deprecated {{attribute.deprecated | to_doc_brief}}. + * @deprecated {{attribute.brief | to_doc_brief}}. {%- endif %} */ - {%- if attribute.deprecated %} -@Deprecated + {%- if (attribute.stability | string()) == "StabilityLevel.DEPRECATED" %} +OPENTELEMETRY_DEPRECATED {%- endif %} static constexpr const char *k{{attribute.fqn | to_camelcase(True)}} = "{{attribute.fqn}}"; {%- endfor %} diff --git a/ci/do_ci.sh b/ci/do_ci.sh index 03f0f9062e..6452faa451 100755 --- a/ci/do_ci.sh +++ b/ci/do_ci.sh @@ -25,7 +25,7 @@ function run_benchmarks [ -z "${BENCHMARK_DIR}" ] && export BENCHMARK_DIR=$HOME/benchmark mkdir -p $BENCHMARK_DIR - bazel $BAZEL_STARTUP_OPTIONS build --cxxopt=-std=c++14 $BAZEL_OPTIONS_ASYNC -c opt -- \ + bazel $BAZEL_STARTUP_OPTIONS build --host_cxxopt=-std=c++14 --cxxopt=-std=c++14 $BAZEL_OPTIONS_ASYNC -c opt -- \ $(bazel query 'attr("tags", "benchmark_result", ...)') echo "" echo "Benchmark results in $BENCHMARK_DIR:" diff --git a/sdk/include/opentelemetry/sdk/metrics/meter.h b/sdk/include/opentelemetry/sdk/metrics/meter.h index 41a10f69e9..7e89d444ab 100644 --- a/sdk/include/opentelemetry/sdk/metrics/meter.h +++ b/sdk/include/opentelemetry/sdk/metrics/meter.h @@ -130,7 +130,6 @@ class Meter final : public opentelemetry::metrics::Meter std::unique_ptr RegisterAsyncMetricStorage( InstrumentDescriptor &instrument_descriptor); opentelemetry::common::SpinLockMutex storage_lock_; - const InstrumentMetaDataValidator instrument_metadata_validator; static nostd::shared_ptr GetNoopObservableInsrument() diff --git a/sdk/include/opentelemetry/sdk/metrics/state/sync_metric_storage.h b/sdk/include/opentelemetry/sdk/metrics/state/sync_metric_storage.h index 37b0e06707..b450b92179 100644 --- a/sdk/include/opentelemetry/sdk/metrics/state/sync_metric_storage.h +++ b/sdk/include/opentelemetry/sdk/metrics/state/sync_metric_storage.h @@ -161,11 +161,6 @@ class SyncMetricStorage : public MetricStorage, public SyncWritableMetricStorage InstrumentDescriptor instrument_descriptor_; // hashmap to maintain the metrics for delta collection (i.e, collection since last Collect call) std::unique_ptr attributes_hashmap_; - // unreported metrics stash for all the collectors - std::unordered_map>> - unreported_metrics_; - // last reported metrics stash for all the collectors. - std::unordered_map last_reported_metrics_; std::function()> create_default_aggregation_; const AttributesProcessor *attributes_processor_; #ifdef ENABLE_METRICS_EXEMPLAR_PREVIEW diff --git a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h index e96f052caf..9396a6c7f9 100644 --- a/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h +++ b/sdk/include/opentelemetry/sdk/resource/semantic_conventions.h @@ -10,6 +10,7 @@ #pragma once +#include "opentelemetry/common/macros.h" #include "opentelemetry/version.h" OPENTELEMETRY_BEGIN_NAMESPACE @@ -794,12 +795,18 @@ static constexpr const char *kOtelScopeVersion = "otel.scope.version"; /** * Deprecated, use the {@code otel.scope.name} attribute. + * + * @deprecated Deprecated, use the `otel.scope.name` attribute. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kOtelLibraryName = "otel.library.name"; /** * Deprecated, use the {@code otel.scope.version} attribute. + * + * @deprecated Deprecated, use the `otel.scope.version` attribute. */ +OPENTELEMETRY_DEPRECATED static constexpr const char *kOtelLibraryVersion = "otel.library.version"; // Enum definitions diff --git a/sdk/src/metrics/instrument_metadata_validator.cc b/sdk/src/metrics/instrument_metadata_validator.cc index 4fde7d3f26..aba6344efc 100644 --- a/sdk/src/metrics/instrument_metadata_validator.cc +++ b/sdk/src/metrics/instrument_metadata_validator.cc @@ -17,8 +17,8 @@ namespace sdk { namespace metrics { -// instrument-name = ALPHA 0*62 ("_" / "." / "-" / ALPHA / DIGIT) -const std::string kInstrumentNamePattern = "[a-zA-Z][-_.a-zA-Z0-9]{0,62}"; +// instrument-name = ALPHA 0*254 ("_" / "." / "-" / ALPHA / DIGIT) +const std::string kInstrumentNamePattern = "[a-zA-Z][-_.a-zA-Z0-9]{0,254}"; // const std::string kInstrumentUnitPattern = "[\x01-\x7F]{0,63}"; // instrument-unit = It can have a maximum length of 63 ASCII chars @@ -38,8 +38,8 @@ bool InstrumentMetaDataValidator::ValidateName(nostd::string_view name) const #if OPENTELEMETRY_HAVE_WORKING_REGEX return std::regex_match(name.data(), name_reg_key_); #else - const size_t kMaxSize = 63; - // size atmost 63 chars + const size_t kMaxSize = 255; + // size atmost 255 chars if (name.size() > kMaxSize) { return false; diff --git a/sdk/test/metrics/instrument_metadata_validator_test.cc b/sdk/test/metrics/instrument_metadata_validator_test.cc index 68c350747a..0f9e7134a7 100644 --- a/sdk/test/metrics/instrument_metadata_validator_test.cc +++ b/sdk/test/metrics/instrument_metadata_validator_test.cc @@ -19,13 +19,13 @@ TEST(InstrumentMetadataValidator, TestName) { opentelemetry::sdk::metrics::InstrumentMetaDataValidator validator; std::vector invalid_names = { - "", // empty string - "1sdf", // string starting with number - "123€AAA€BBB", // unicode characters - "/\\sdsd", // string starting with special character - "***sSSs", // string starting with special character - CreateVeryLargeString(5) + "ABCERTYGJ", // total 64 charactes - CreateVeryLargeString(7), // string much bigger than 63 chars + "", // empty string + "1sdf", // string starting with number + "123€AAA€BBB", // unicode characters + "/\\sdsd", // string starting with special character + "***sSSs", // string starting with special character + CreateVeryLargeString(25) + "X", // total 256 characters + CreateVeryLargeString(26), // string much bigger than 255 characters }; for (auto const &str : invalid_names) { @@ -33,11 +33,14 @@ TEST(InstrumentMetadataValidator, TestName) } std::vector valid_names = { - "T", // single char string - "s123", // starting with char, followed by numbers - "dsdsdsd_-.", // string , and valid nonalphanumeric - "d1234_-sDSDs.sdsd344", // combination of all valid characters - CreateVeryLargeString(5) + "ABCERTYG", // total 63 charactes + "T", // single char string + "s123", // starting with char, followed by numbers + "dsdsdsd_-.", // string , and valid nonalphanumeric + "d1234_-sDSDs.sdsd344", // combination of all valid characters + CreateVeryLargeString(5) + "ABCERTYG", // total 63 characters + CreateVeryLargeString(5) + "ABCERTYGJ", // total 64 characters + CreateVeryLargeString(24) + "ABCDEFGHI", // total 254 characters + CreateVeryLargeString(25), // total 255 characters }; for (auto const &str : valid_names) {