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

Merge main into async-changes #1348

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
e072daa
install sdk config (#1273)
esigo Mar 21, 2022
6ec1b59
Bump actions/cache from 2 to 3 (#1277)
dependabot[bot] Mar 22, 2022
b5155a5
Add owent as an Approver (#1276)
lalitb Mar 23, 2022
0c9aece
Disable benchmark action failure (#1284)
esigo Mar 24, 2022
3c7b44b
metrics exemplar round 1 (#1264)
esigo Mar 24, 2022
2c9ce39
[Metrics SDK] - fix spelling (AggregationTemporarily to AggregationTe…
lalitb Mar 24, 2022
91b0572
fix compilation error with protobuf 3.5 (#1289)
esigo Mar 25, 2022
c1b9590
Fix span SetAttribute crash (#1283)
esigo Mar 26, 2022
a7e814a
Synchronous Metric collection (Delta , Cumulative) (#1265)
lalitb Mar 30, 2022
76c664a
Rename `http_client_curl` to `opentelemetry_http_client_curl` (#1301)
owent Mar 31, 2022
2034c9b
Don't show coverage annotation for pull requests (#1304)
ThomsonTan Apr 1, 2022
33d9c62
Implement periodic exporting metric reader (#1286)
lalitb Apr 1, 2022
48a4060
Add `async-changes` branch to pull_request of github action (#1309)
owent Apr 4, 2022
be75bbc
Add InstrumentationInfo and Resource to the metrics data to be export…
lalitb Apr 4, 2022
237a0b2
Excempt should be applied on issue instead of PR (#1316)
ThomsonTan Apr 5, 2022
fd338cc
Bump codecov/codecov-action from 2.1.0 to 3 (#1318)
dependabot[bot] Apr 6, 2022
74ec691
Move public definitions into `opentelemetry_api`. (#1314)
owent Apr 7, 2022
6b87300
Add building test without RTTI (#1294)
owent Apr 7, 2022
3122254
Remove implicitly deleted default constructor (#1267)
benlandrum Apr 7, 2022
d72dcb6
[ETW Exporter] - ETW provider handle cleanup (#1322)
lalitb Apr 11, 2022
e200c1f
Bump actions/stale from 4 to 5 (#1323)
dependabot[bot] Apr 11, 2022
755f109
ostream metrics example (#1312)
esigo Apr 12, 2022
da2911c
Prepare v1.3.0 release (#1324)
ThomsonTan Apr 12, 2022
75c2a8f
Update yield logic for ARM processor (#1325)
lalitb Apr 12, 2022
e7f051e
Fix for #1292 (#1326)
juandemanjon Apr 14, 2022
29d68f1
Implement Merge and Diff operation for Histogram Aggregation (#1303)
lalitb Apr 14, 2022
e3304d7
fix metrics compiler warnings (#1328)
esigo Apr 15, 2022
defdfd2
Replace deprecated googletest API (#1327)
ThomsonTan Apr 15, 2022
2e9b7a1
Remove redundant tail / in CMake install (#1329)
ThomsonTan Apr 16, 2022
1d2cd42
dependencies image as artifact (#1333)
esigo Apr 18, 2022
b33dd09
metrics histogram example (#1330)
esigo Apr 18, 2022
7fde3bc
Link `opentelemetry_ext` with `opentelemetry_api` (#1336)
owent Apr 21, 2022
bf8f433
ostream metrics cmake (#1344)
esigo Apr 21, 2022
34c36a0
Merge remote-tracking branch 'origin/main' into merge_main_into_async…
owent Apr 24, 2022
c609455
Merge remote-tracking branch 'opentelemetry/main' into merge_main_int…
owent Apr 24, 2022
ac30877
Fix conflicts
owent Apr 24, 2022
f078a6d
Using clang-format-10 to format codes(clang-format-14 has a different…
owent Apr 24, 2022
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
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,28 @@ jobs:
- name: run tests
run: ./ci/do_ci.sh bazel.noexcept

bazel_nortti:
name: Bazel nortti
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Mount Bazel Cache
uses: actions/cache@v3
env:
cache-name: bazel_cache
with:
path: /home/runner/.cache/bazel
key: bazel_nortti
- name: setup
run: |
sudo ./ci/setup_thrift.sh dependencies_only
sudo ./ci/setup_ci_environment.sh
sudo ./ci/install_bazelisk.sh
- name: run tests
run: ./ci/do_ci.sh bazel.nortti

bazel_asan:
name: Bazel asan config
runs-on: ubuntu-latest
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/dependencies_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: 'OpenTelemetry-cpp dependencies image'
on:
schedule:
- cron: "0 3 * * 6"

jobs:
docker_image:
name: Docker Image
runs-on: ubuntu-latest
timeout-minutes: 300
steps:
-
name: checkout
uses: actions/checkout@v2
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
-
name: Build Image
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: ci/
file: ./docker/Dockerfile
build-args: BASE_IMAGE=ubuntu:latest
platforms: linux/amd64
# platforms: linux/amd64,linux/arm64
push: false
tags: otel-cpp-deps
load: true
-
name: Save Image
run: |
docker images
docker save -o /opt/otel-cpp-deps-debian.tar otel-cpp-deps
-
name: Upload Image
uses: actions/upload-artifact@v3
with:
name: otel-cpp-deps
path: /opt/otel-cpp-deps-debian.tar
retention-days: 14
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v4
- uses: actions/stale@v5
with:
stale-issue-message: 'This issue was marked as stale due to lack of activity. It will be closed in 7 days if no furthur activity occurs.'
close-issue-message: 'Closed as inactive. Feel free to reopen if this is still an issue.'
Expand Down
47 changes: 46 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,54 @@ Increment the:

## [Unreleased]

* [EXPORTER] OTLP http exporter allow concurrency session ([#1209](https://github.com/open-telemetry/opentelemetry-cpp/pull/1209))

## [1.3.0] 2022-04-11

* [ETW EXPORTER] ETW provider handle cleanup ([#1322](https://github.com/open-telemetry/opentelemetry-cpp/pull/1322))
* [BUILD] Move public definitions into `opentelemetry_api`. ([#1314](https://github.com/open-telemetry/opentelemetry-cpp/pull/1314))
* [METRICS] OStream example ([#1312](https://github.com/open-telemetry/opentelemetry-cpp/pull/1312))
* [BUILD] Rename `http_client_curl` to `opentelemetry_http_client_curl` ([#1301](https://github.com/open-telemetry/opentelemetry-cpp/pull/1301))
* [METRICS SDK] Add InstrumentationInfo and Resource to the metrics data to be
exported.
([#1299](https://github.com/open-telemetry/opentelemetry-cpp/pull/1299))
* [TESTS] Add building test without RTTI ([#1294](https://github.com/open-telemetry/opentelemetry-cpp/pull/1294))
* [METRICS SDK] Implement periodic exporting metric reader ([#1286](https://github.com/open-telemetry/opentelemetry-cpp/pull/1286))
* [SDK] Bugfix: span SetAttribute crash ([#1283](https://github.com/open-telemetry/opentelemetry-cpp/pull/1283))
* [BUG] Remove implicitly deleted default constructor ([#1267](https://github.com/open-telemetry/opentelemetry-cpp/pull/1267))
* [METRICS SDK] Synchronous Metric collection (Delta , Cumulative) ([#1265](https://github.com/open-telemetry/opentelemetry-cpp/pull/1265))
* [METRICS SDK] Metrics exemplar round 1 ([#1264](https://github.com/open-telemetry/opentelemetry-cpp/pull/1264))
* [EXPORTER] Fix: use CURLOPT_TIMEOUT_MS to config OtlpHttpExporter's timeout
instead of CURLOPT_TIMEOUT
([#1261](https://github.com/open-telemetry/opentelemetry-cpp/pull/1261))
* [EXPORTER] Jaeger Exporter - Populate Span Links ([#1251](https://github.com/open-telemetry/opentelemetry-cpp/pull/1251))
* [EXPORTER] OTLP http exporter allow concurrency session ([#1209](https://github.com/open-telemetry/opentelemetry-cpp/pull/1209))
* [SDK] Reorder the destructor of members in LoggerProvider and TracerProvider ([#1245](https://github.com/open-telemetry/opentelemetry-cpp/pull/1245))
* [METRICS SDK] Enable metric collection from MetricReader ([#1241](https://github.com/open-telemetry/opentelemetry-cpp/pull/1241))
* [METRICS SDK] Asynchronous Aggregation storage ([#1232](https://github.com/open-telemetry/opentelemetry-cpp/pull/1232))
* [METRICS SDK] Synchronous Instruments - Aggregation Storage(s) creation for
configured views
([#1219](https://github.com/open-telemetry/opentelemetry-cpp/pull/1219))
* [BUILD] Added s390x arch into CMake build. ([#1216](https://github.com/open-telemetry/opentelemetry-cpp/pull/1216))
* [API] Allow extension of the lifetime of ContextStorage. ([#1214](https://github.com/open-telemetry/opentelemetry-cpp/pull/1214))
* [METRICS SDK] Add Aggregation storage ([#1213](https://github.com/open-telemetry/opentelemetry-cpp/pull/1213))
* [TESTS] Fix ostream_log_test Mac ([#1208](https://github.com/open-telemetry/opentelemetry-cpp/pull/1208))
* [BUILD] Update grpc to v1.43.2 to support VS2022/MSVC 19.30 and bazel 5.0 ([#1207](https://github.com/open-telemetry/opentelemetry-cpp/pull/1207))
* [DOCS] Benchmark documentation ([#1205](https://github.com/open-telemetry/opentelemetry-cpp/pull/1205))
* [DOCS] Fix errors in SDK documentation ([#1201](https://github.com/open-telemetry/opentelemetry-cpp/pull/1201))
* [METRICS EXPORTER] Ostream metric exporter ([#1196](https://github.com/open-telemetry/opentelemetry-cpp/pull/1196))
* [Metrics SDK] Filtering metrics attributes ([#1191](https://github.com/open-telemetry/opentelemetry-cpp/pull/1191))
* [Metrics SDK] Sync and Async Instruments SDK ([#1184](https://github.com/open-telemetry/opentelemetry-cpp/pull/1184))
* [Metrics SDK] Add Aggregation as part of metrics SDK. ([#1178](https://github.com/open-telemetry/opentelemetry-cpp/pull/1178))
* [BUILD] Cmake: thrift requires boost headers, include them as
Boost_INCLUDE_DIRS
([#1100](https://github.com/open-telemetry/opentelemetry-cpp/pull/1100))

Notes:

[#1301](https://github.com/open-telemetry/opentelemetry-cpp/pull/1301) added
`opentelemetry_` as prefix to http_client_curl library for resolving potential
naming conflict, this could break existing cmake build if http_client_curl is
listed as explicit dependency in user's cmake file.

## [1.2.0] 2022-01-31

Expand Down
51 changes: 1 addition & 50 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,24 +125,11 @@ if(NOT DEFINED CMAKE_CXX_STANDARD)
endif()
endif()

if(WITH_ABSEIL)
find_package(absl CONFIG REQUIRED)

set(CORE_RUNTIME_LIBS absl::bad_variant_access absl::any absl::base
absl::bits absl::city)

# target_link_libraries(main PRIVATE absl::any absl::base absl::bits
# absl::city)
endif()

if(WITH_STL)
# These definitions are needed for test projects that do not link against
# opentelemetry-api library directly. We ensure that variant implementation
# (absl::variant or std::variant) in variant unit test code is consistent with
# the global project build definitions.
add_definitions(-DHAVE_CPP_STDLIB)

# Optimize for speed to reduce the hops
# the global project build definitions. Optimize for speed to reduce the hops
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
if(CMAKE_BUILD_TYPE MATCHES Debug)
# Turn off optimizations for DEBUG
Expand All @@ -157,20 +144,6 @@ if(WITH_STL)
endif()
endif()

if(WITH_GSL)
add_definitions(-DHAVE_GSL)

# Guidelines Support Library path. Used if we are not on not get C++20.
#
find_package(Microsoft.GSL QUIET)
if(TARGET Microsoft.GSL::GSL)
list(APPEND CORE_RUNTIME_LIBS Microsoft.GSL::GSL)
else()
set(GSL_DIR third_party/ms-gsl)
include_directories(${GSL_DIR}/include)
endif()
endif()

option(WITH_OTLP "Whether to include the OpenTelemetry Protocol in the SDK" OFF)
option(WITH_ZIPKIN "Whether to include the Zipkin exporter in the SDK" OFF)

Expand All @@ -190,22 +163,14 @@ option(BUILD_TESTING "Whether to enable tests" ON)

option(BUILD_W3CTRACECONTEXT_TEST "Whether to build w3c trace context" OFF)

if(WITH_NO_GENENV)
add_definitions(-DNO_GETENV)
endif()

if(WIN32)
add_definitions(-DNOMINMAX)
if(BUILD_TESTING)
if(MSVC)
# GTest bug: https://github.com/google/googletest/issues/860
add_compile_options(/wd4275)
endif()
endif()
option(WITH_ETW "Whether to include the ETW Exporter in the SDK" ON)
if(WITH_ETW)
add_definitions(-DHAVE_MSGPACK)
endif(WITH_ETW)
endif(WIN32)

option(
Expand All @@ -215,23 +180,9 @@ option(
option(WITH_EXAMPLES "Whether to build examples" ON)

option(WITH_METRICS_PREVIEW "Whether to build metrics preview" OFF)

if(WITH_METRICS_PREVIEW)
add_definitions(-DENABLE_METRICS_PREVIEW)
endif()

option(WITH_LOGS_PREVIEW "Whether to build logs preview" OFF)

if(WITH_LOGS_PREVIEW)
add_definitions(-DENABLE_LOGS_PREVIEW)
endif()

option(WITH_ASYNC_EXPORT_PREVIEW "Whether enable async export" OFF)

if(WITH_ASYNC_EXPORT_PREVIEW)
add_definitions(-DENABLE_ASYNC_EXPORT)
endif()

find_package(Threads)

function(install_windows_deps)
Expand Down
33 changes: 31 additions & 2 deletions api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,14 @@ if(BUILD_TESTING)
endif()

if(WITH_ABSEIL)

find_package(absl CONFIG REQUIRED)

target_compile_definitions(opentelemetry_api INTERFACE HAVE_ABSEIL)
target_link_libraries(
opentelemetry_api INTERFACE absl::bad_variant_access absl::any absl::base
absl::bits absl::city)

endif()

if(WITH_STL)
Expand All @@ -52,6 +59,21 @@ else()
message("Building with nostd types...")
endif()

if(WITH_GSL)
target_compile_definitions(opentelemetry_api INTERFACE HAVE_GSL)

# Guidelines Support Library path. Used if we are not on not get C++20.
#
find_package(Microsoft.GSL QUIET)
if(TARGET Microsoft.GSL::GSL)
target_link_libraries(opentelemetry_api INTERFACE Microsoft.GSL::GSL)
else()
set(GSL_DIR third_party/ms-gsl)
target_include_directories(
opentelemetry_api INTERFACE "$<BUILD_INTERFACE:${GSL_DIR}/include>")
endif()
endif()

if(WITH_METRICS_PREVIEW)
target_compile_definitions(opentelemetry_api INTERFACE ENABLE_METRICS_PREVIEW)
endif()
Expand All @@ -60,8 +82,15 @@ if(WITH_LOGS_PREVIEW)
target_compile_definitions(opentelemetry_api INTERFACE ENABLE_LOGS_PREVIEW)
endif()

if(CORE_RUNTIME_LIBS)
target_link_libraries(opentelemetry_api INTERFACE ${CORE_RUNTIME_LIBS})
if(WITH_NO_GENENV)
target_compile_definitions(opentelemetry_api INTERFACE NO_GETENV)
endif()

if(WIN32)
target_compile_definitions(opentelemetry_api INTERFACE NOMINMAX)
if(WITH_ETW)
target_compile_definitions(opentelemetry_api INTERFACE HAVE_MSGPACK)
endif()
endif()

if(WITH_ASYNC_EXPORT_PREVIEW)
Expand Down
16 changes: 16 additions & 0 deletions api/include/opentelemetry/common/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,19 @@
#else
# define OPENTELEMETRY_MAYBE_UNUSED
#endif

#ifndef OPENTELEMETRY_RTTI_ENABLED
# if defined(__clang__)
# if __has_feature(cxx_rtti)
# define OPENTELEMETRY_RTTI_ENABLED
# endif
# elif defined(__GNUG__)
# if defined(__GXX_RTTI)
# define OPENTELEMETRY_RTTI_ENABLED
# endif
# elif defined(_MSC_VER)
# if defined(_CPPRTTI)
# define OPENTELEMETRY_RTTI_ENABLED
# endif
# endif
#endif
4 changes: 1 addition & 3 deletions api/include/opentelemetry/common/spin_lock_mutex.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ class SpinLockMutex
__builtin_ia32_pause();
# endif
#elif defined(__arm__)
// This intrinsic should fail to be found if YIELD is not supported on the current
// processor.
__yield();
__asm__ volatile("yield" ::: "memory");
#else
// TODO: Issue PAGE/YIELD on other architectures.
#endif
Expand Down
2 changes: 0 additions & 2 deletions api/include/opentelemetry/context/runtime_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ class Token
private:
friend class RuntimeContextStorage;

Token() noexcept = default;

// A constructor that sets the token's Context object to the
// one that was passed in.
Token(const Context &context) : context_(context) {}
Expand Down
2 changes: 1 addition & 1 deletion api/include/opentelemetry/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "opentelemetry/detail/preprocessor.h"

#define OPENTELEMETRY_ABI_VERSION_NO 1
#define OPENTELEMETRY_VERSION "1.2.0"
#define OPENTELEMETRY_VERSION "1.3.0"
#define OPENTELEMETRY_ABI_VERSION OPENTELEMETRY_STRINGIFY(OPENTELEMETRY_ABI_VERSION_NO)

// clang-format off
Expand Down
2 changes: 1 addition & 1 deletion api/test/common/spinlock_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static void BM_ProcYieldSpinLockThrashing(benchmark::State &s)
__builtin_ia32_pause();
# endif
#elif defined(__arm__)
__yield();
__asm__ volatile("yield" ::: "memory");
#endif
}
},
Expand Down
2 changes: 2 additions & 0 deletions ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ CI tests can be run on docker by invoking the script `./ci/run_docker.sh
* `bazel.legacy.test`: build bazel targets and run tests for the targets meant
to work with older compilers.
* `bazel.noexcept`: build bazel targets and run tests with exceptions disabled.
* `bazel.nortti`: build bazel targets and run tests with runtime type
identification disabled.
* `bazel.asan`: build bazel targets and run tests with AddressSanitizer.
* `bazel.tsan`: build bazel targets and run tests with ThreadSanitizer.
* `bazel.valgrind`: build bazel targets and run tests under the valgrind memory
Expand Down
12 changes: 11 additions & 1 deletion ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ mkdir -p "${BUILD_DIR}"
[ -z "${PLUGIN_DIR}" ] && export PLUGIN_DIR=$HOME/plugin
mkdir -p "${PLUGIN_DIR}"

BAZEL_OPTIONS="--copt=-DENABLE_METRICS_PREVIEW --copt=-DENABLE_LOGS_PREVIEW --copt=-DENABLE_TEST"
BAZEL_OPTIONS="--copt=-DENABLE_LOGS_PREVIEW --copt=-DENABLE_TEST"
# Previous legacy metrics use virtual drive, which can not be used without RTTI
if [[ "$1" != "bazel.nortti" ]]; then
BAZEL_OPTIONS="$BAZEL_OPTIONS --copt=-DENABLE_METRICS_PREVIEW"
fi
BAZEL_TEST_OPTIONS="$BAZEL_OPTIONS --test_output=errors"

# https://github.com/bazelbuild/bazel/issues/4341
Expand Down Expand Up @@ -221,6 +225,12 @@ elif [[ "$1" == "bazel.noexcept" ]]; then
bazel $BAZEL_STARTUP_OPTIONS build --copt=-fno-exceptions --build_tag_filters=-jaeger $BAZEL_OPTIONS -- //... -//exporters/prometheus/... -//exporters/jaeger/...
bazel $BAZEL_STARTUP_OPTIONS test --copt=-fno-exceptions --build_tag_filters=-jaeger $BAZEL_TEST_OPTIONS -- //... -//exporters/prometheus/... -//exporters/jaeger/...
exit 0
elif [[ "$1" == "bazel.nortti" ]]; then
# there are some exceptions and error handling code from the Prometheus and Jaeger Clients
# that make this test always fail. ignore Prometheus and Jaeger exporters in the noexcept here.
bazel $BAZEL_STARTUP_OPTIONS build --cxxopt=-fno-rtti --build_tag_filters=-jaeger $BAZEL_OPTIONS -- //... -//exporters/prometheus/... -//exporters/jaeger/...
bazel $BAZEL_STARTUP_OPTIONS test --cxxopt=-fno-rtti --build_tag_filters=-jaeger $BAZEL_TEST_OPTIONS -- //... -//exporters/prometheus/... -//exporters/jaeger/...
exit 0
elif [[ "$1" == "bazel.asan" ]]; then
bazel $BAZEL_STARTUP_OPTIONS test --config=asan $BAZEL_TEST_OPTIONS //...
exit 0
Expand Down
Loading