Skip to content

Commit

Permalink
Merge branch 'main' into make-get_span-return-static-invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb authored Oct 9, 2024
2 parents 93bfdb0 + 6445819 commit 7ff6178
Show file tree
Hide file tree
Showing 126 changed files with 1,794 additions and 799 deletions.
8 changes: 7 additions & 1 deletion .iwyu.imp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
# Work around for C++ STL
{ "include": ["<bits/chrono.h>", "private", "<chrono>", "public"] },

# Local opentelemetry-cpp
# Local opentelemetry-cpp style

# We prefer to include <gtest/gtest.h> for simplicity
{ "include": ["<gtest/gtest-message.h>", "private", "<gtest/gtest.h>", "public"] },
{ "include": ["<gtest/gtest-test-part.h>", "private", "<gtest/gtest.h>", "public"] },
{ "include": ["<gtest/gtest-param-test.h>", "private", "<gtest/gtest.h>", "public"] },
{ "include": ["<gtest/gtest_pred_impl.h>", "private", "<gtest/gtest.h>", "public"] },

# We prefer to include <gmock/gmock.h> for simplicity
{ "include": ["<gmock/gmock-function-mocker.h>", "private", "<gmock/gmock.h>", "public"] },
{ "include": ["<gmock/gmock-spec-builders.h>", "private", "<gmock/gmock.h>", "public"] },
]

106 changes: 106 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,118 @@ Increment the:

## [Unreleased]

* [API] Jaeger Propagator should not be deprecated
[#3086](https://github.com/open-telemetry/opentelemetry-cpp/pull/3086)

Important changes:

* [API] Jaeger Propagator should not be deprecated
[#3086](https://github.com/open-telemetry/opentelemetry-cpp/pull/3086)

* Deprecation of the Jaeger propagator, as announced on 2023-01-31
in version 1.8.2, is now reverted.
* This deprecation turned out to be not justified,
as the Jaeger propagator can be used without the (now removed)
Jaeger exporter.

## [1.17 2024-10-07]

* [CI] Add a clang-tidy build
[#3001](https://github.com/open-telemetry/opentelemetry-cpp/pull/3001)

* [BUILD] Upgrade to opentelemetry-proto 1.3.2
[#2991](https://github.com/open-telemetry/opentelemetry-cpp/pull/2991)

* [REMOVAL] Remove build option `WITH_DEPRECATED_SDK_FACTORY`
[#2717](https://github.com/open-telemetry/opentelemetry-cpp/pull/2717)

* [EXPORTER] ForceFlush before canceling the running requests on shutdown
[#2727](https://github.com/open-telemetry/opentelemetry-cpp/pull/2727)

* [SDK] Fix crash in PeriodicExportingMetricReader
[#2983](https://github.com/open-telemetry/opentelemetry-cpp/pull/2983)

* [SDK] Fix memory leak in TlsRandomNumberGenerator() constructor
[#2661](https://github.com/open-telemetry/opentelemetry-cpp/pull/2661)

* [EXPORTER] Ignore exception when create thread in OTLP file exporter
[#3012](https://github.com/open-telemetry/opentelemetry-cpp/pull/3012)

* [BUILD] Update the version in MODULE.bazel
[#3015](https://github.com/open-telemetry/opentelemetry-cpp/pull/3015)

* [BUILD] Fix build without vcpkg on Windows when gRPC is disabled
[#3016](https://github.com/open-telemetry/opentelemetry-cpp/pull/3016)

* [BUILD] Add abi_version_no bazel flag
[#3020](https://github.com/open-telemetry/opentelemetry-cpp/pull/3020)

* [Code health] Expand iwyu coverage to include unit tests
[#3022](https://github.com/open-telemetry/opentelemetry-cpp/pull/3022)

* [BUILD] Version opentelemetry_proto/proto_grpc shared libraries
[#2992](https://github.com/open-telemetry/opentelemetry-cpp/pull/2992)

* [SEMANTIC CONVENTIONS] Upgrade semantic conventions to 1.27.0
[#3023](https://github.com/open-telemetry/opentelemetry-cpp/pull/3023)

* [SDK] Support empty histogram buckets
[#3027](https://github.com/open-telemetry/opentelemetry-cpp/pull/3027)

* [TEST] Fix sync problems in OTLP File exporter tests
[#3031](https://github.com/open-telemetry/opentelemetry-cpp/pull/3031)

* [SDK] PeriodicExportingMetricReader: future is never set, blocks until timeout
[#3030](https://github.com/open-telemetry/opentelemetry-cpp/pull/3030)

* [Code Health] Clang Tidy cleanup, Part 2
[#3038](https://github.com/open-telemetry/opentelemetry-cpp/pull/3038)

* [Code Health] include-what-you-use cleanup, part 3
[#3004](https://github.com/open-telemetry/opentelemetry-cpp/pull/3004)

* [SDK] Fix overflow in timeout logic
[#3046](https://github.com/open-telemetry/opentelemetry-cpp/pull/3046)

* [TEST] Add missing tests to Bazel build
[#3045](https://github.com/open-telemetry/opentelemetry-cpp/pull/3045)

* [TEST] update collector tests with debug exporter
[#3050](https://github.com/open-telemetry/opentelemetry-cpp/pull/3050)

* [EXAMPLE] update collector example with debug exporter
[#3049](https://github.com/open-telemetry/opentelemetry-cpp/pull/3049)

* [TEST] update references to logging exporter
[#3053](https://github.com/open-telemetry/opentelemetry-cpp/pull/3053)

* [EXAMPLE] Clean the tracer initialization in OStream example
[#3051](https://github.com/open-telemetry/opentelemetry-cpp/pull/3051)

* [EXPORTER] Fix the format of SpanLink for ETW
[#3054](https://github.com/open-telemetry/opentelemetry-cpp/pull/3054)

* [EXPORTER] Add in-memory metric exporter
[#3043](https://github.com/open-telemetry/opentelemetry-cpp/pull/3043)

* [Code Health] include-what-you-use cleanup, part 4
[#3040](https://github.com/open-telemetry/opentelemetry-cpp/pull/3040)

* [BUILD] add loongarch info
[#3052](https://github.com/open-telemetry/opentelemetry-cpp/pull/3052)

* [CI] Update otel-collector version
[#3067](https://github.com/open-telemetry/opentelemetry-cpp/pull/3067)

* [SDK] Update MetricProducer interface to match spec
[#3044](https://github.com/open-telemetry/opentelemetry-cpp/pull/3044)

* [EXPORTER] Fix URL in ES exporter, fix ipv6 supporting for http client
[#3081](https://github.com/open-telemetry/opentelemetry-cpp/pull/3081)

* [EXPORTER] Add HttpHeaders in ElasticsearchLogRecordExporter
[#3083](https://github.com/open-telemetry/opentelemetry-cpp/pull/3083)

Breaking changes:

* [REMOVAL] Remove build option `WITH_DEPRECATED_SDK_FACTORY`
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ else()
set(ARCH s390x)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(sparc.*|SPARC.*)")
set(ARCH sparc)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(loongarch.*|LOONGARCH.*)")
set(ARCH loongarch)
else()
message(
FATAL_ERROR
Expand Down
40 changes: 1 addition & 39 deletions DEPRECATED.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,45 +46,7 @@ N/A

## [opentelemetry-cpp API]

### Jaeger propagator

#### Announcement (Jaeger)

* Version: 1.8.2
* Date: 2023-01-31
* PR: [DEPRECATION] Deprecate the Jaeger exporter
[#1923](https://github.com/open-telemetry/opentelemetry-cpp/pull/1923)

This PR also listed the Jaeger propagator as deprecated.

#### Motivation (Jaeger)

The Jaeger Exporter is now (July 2023) removed from the OpenTelemetry specification.

The Jaeger Propagator remains, because changing propagation is a longer
process compared to changing an export format.

New deployments however are encouraged to use a W3C compliant propagator,
and avoid the Jaeger propagator, which is now deprecated.

#### Scope (Jaeger)

The following are deprecated and planned for removal:

* the API header `opentelemetry/trace/propagation/jaeger.h`, including:
* the C++ class `JaegerPropagator`

#### Mitigation (Jaeger)

Use a W3C compliant propagator instead.

That is, use class HttpTraceContext and "traceparent" tags.

Do not use class JaegerPropagator and "uber-trace-id" tags.

#### Planned removal (Jaeger)

No date set yet for the Jaeger Propagator.
N/A

## [opentelemetry-cpp SDK]

Expand Down
4 changes: 2 additions & 2 deletions api/include/opentelemetry/trace/default_span.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ class DefaultSpan : public Span
DefaultSpan(SpanContext span_context) noexcept : span_context_(span_context) {}

// movable and copiable
DefaultSpan(DefaultSpan &&spn) noexcept : span_context_(spn.GetContext()) {}
DefaultSpan(const DefaultSpan &spn) noexcept : span_context_(spn.GetContext()) {}
DefaultSpan(DefaultSpan &&spn) noexcept : Span(), span_context_(spn.GetContext()) {}
DefaultSpan(const DefaultSpan &spn) noexcept : Span(), span_context_(spn.GetContext()) {}

private:
SpanContext span_context_;
Expand Down
6 changes: 1 addition & 5 deletions api/include/opentelemetry/trace/propagation/jaeger.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

#pragma once

#ifdef OPENTELEMETRY_NO_DEPRECATED_CODE
# error "header <opentelemetry/trace/propagation/jaeger.h> is deprecated."
#endif

#include "detail/hex.h"
#include "detail/string.h"
#include "opentelemetry/context/propagation/text_map_propagator.h"
Expand All @@ -21,7 +17,7 @@ namespace propagation

static const nostd::string_view kJaegerTraceHeader = "uber-trace-id";

class OPENTELEMETRY_DEPRECATED JaegerPropagator : public context::propagation::TextMapPropagator
class JaegerPropagator : public context::propagation::TextMapPropagator
{
public:
void Inject(context::propagation::TextMapCarrier &carrier,
Expand Down
6 changes: 3 additions & 3 deletions api/include/opentelemetry/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
# define OPENTELEMETRY_ABI_VERSION_NO 1
#endif

#define OPENTELEMETRY_VERSION "1.16.1"
#define OPENTELEMETRY_VERSION "1.17.0"
#define OPENTELEMETRY_VERSION_MAJOR 1
#define OPENTELEMETRY_VERSION_MINOR 16
#define OPENTELEMETRY_VERSION_PATCH 1
#define OPENTELEMETRY_VERSION_MINOR 17
#define OPENTELEMETRY_VERSION_PATCH 0

#define OPENTELEMETRY_ABI_VERSION OPENTELEMETRY_STRINGIFY(OPENTELEMETRY_ABI_VERSION_NO)

Expand Down
16 changes: 2 additions & 14 deletions api/test/trace/propagation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

add_subdirectory(detail)

foreach(testname http_text_format_test b3_propagation_test)
foreach(testname http_text_format_test b3_propagation_test
jaeger_propagation_test)
add_executable(${testname} "${testname}.cc")
target_link_libraries(${testname} ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
Expand All @@ -12,16 +13,3 @@ foreach(testname http_text_format_test b3_propagation_test)
TEST_PREFIX trace.
TEST_LIST ${testname})
endforeach()

if(NOT WITH_NO_DEPRECATED_CODE)
foreach(testname jaeger_propagation_test)

add_executable(${testname} "${testname}.cc")
target_link_libraries(${testname} ${GTEST_BOTH_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT} opentelemetry_api)
gtest_add_tests(
TARGET ${testname}
TEST_PREFIX trace.
TEST_LIST ${testname})
endforeach()
endif()
6 changes: 3 additions & 3 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function install_prometheus_cpp_client
function run_benchmarks
{
docker run -d --rm -it -p 4317:4317 -p 4318:4318 -v \
$(pwd)/examples/otlp:/cfg otel/opentelemetry-collector:0.38.0 \
$(pwd)/examples/otlp:/cfg otel/opentelemetry-collector:0.109.0 \
--config=/cfg/opentelemetry-collector-config/config.dev.yaml

[ -z "${BENCHMARK_DIR}" ] && export BENCHMARK_DIR=$HOME/benchmark
Expand Down Expand Up @@ -484,8 +484,8 @@ elif [[ "$1" == "bazel.noexcept" ]]; then
# there are some exceptions and error handling code from the Prometheus Client
# as well as Opentracing shim (due to some third party code in its Opentracing dependency)
# that make this test always fail. Ignore these packages in the noexcept test here.
bazel $BAZEL_STARTUP_OPTIONS build --copt=-fno-exceptions $BAZEL_OPTIONS_ASYNC -- //... -//exporters/prometheus/... -//examples/prometheus/... -//sdk/test/metrics:attributes_hashmap_test -//opentracing-shim/...
bazel $BAZEL_STARTUP_OPTIONS test --copt=-fno-exceptions $BAZEL_TEST_OPTIONS_ASYNC -- //... -//exporters/prometheus/... -//examples/prometheus/... -//sdk/test/metrics:attributes_hashmap_test -//opentracing-shim/...
bazel $BAZEL_STARTUP_OPTIONS build --copt=-fno-exceptions $BAZEL_OPTIONS_ASYNC -- //... -//exporters/prometheus/... -//examples/prometheus/... -//opentracing-shim/...
bazel $BAZEL_STARTUP_OPTIONS test --copt=-fno-exceptions $BAZEL_TEST_OPTIONS_ASYNC -- //... -//exporters/prometheus/... -//examples/prometheus/... -//opentracing-shim/...
exit 0
elif [[ "$1" == "bazel.nortti" ]]; then
# there are some exceptions and error handling code from the Prometheus Client
Expand Down
2 changes: 1 addition & 1 deletion docs/public/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
author = 'OpenTelemetry authors'

# The full version, including alpha/beta/rc tags
release = "1.16.1"
release = "1.17.0"

# Run sphinx on subprojects and copy output
# -----------------------------------------
Expand Down
20 changes: 10 additions & 10 deletions examples/logs_simple/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,18 @@ void InitTracer()
auto exporter = trace_exporter::OStreamSpanExporterFactory::Create();
auto processor = trace_sdk::SimpleSpanProcessorFactory::Create(std::move(exporter));

std::shared_ptr<opentelemetry::sdk::trace::TracerProvider> provider =
opentelemetry::sdk::trace::TracerProviderFactory::Create(std::move(processor));
std::shared_ptr<opentelemetry::sdk::trace::TracerProvider> sdk_provider =
trace_sdk::TracerProviderFactory::Create(std::move(processor));

// Set the global trace provider
const std::shared_ptr<trace_api::TracerProvider> &api_provider = provider;
const std::shared_ptr<trace_api::TracerProvider> &api_provider = sdk_provider;
trace_api::Provider::SetTracerProvider(api_provider);
}

void CleanupTracer()
{
std::shared_ptr<trace_api::TracerProvider> none;
trace_api::Provider::SetTracerProvider(none);
std::shared_ptr<trace_api::TracerProvider> noop;
trace_api::Provider::SetTracerProvider(noop);
}

void InitLogger()
Expand All @@ -65,18 +65,18 @@ void InitLogger()
std::unique_ptr<logs_sdk::LogRecordExporter>(new logs_exporter::OStreamLogRecordExporter);
auto processor = logs_sdk::SimpleLogRecordProcessorFactory::Create(std::move(exporter));

std::shared_ptr<opentelemetry::sdk::logs::LoggerProvider> provider(
opentelemetry::sdk::logs::LoggerProviderFactory::Create(std::move(processor)));
std::shared_ptr<opentelemetry::sdk::logs::LoggerProvider> sdk_provider(
logs_sdk::LoggerProviderFactory::Create(std::move(processor)));

// Set the global logger provider
const std::shared_ptr<logs_api::LoggerProvider> &api_provider = provider;
const std::shared_ptr<logs_api::LoggerProvider> &api_provider = sdk_provider;
logs_api::Provider::SetLoggerProvider(api_provider);
}

void CleanupLogger()
{
std::shared_ptr<logs_api::LoggerProvider> none;
logs_api::Provider::SetLoggerProvider(none);
std::shared_ptr<logs_api::LoggerProvider> noop;
logs_api::Provider::SetLoggerProvider(noop);
}

} // namespace
Expand Down
4 changes: 2 additions & 2 deletions examples/otlp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ OpenTelemetry Collector with an OTLP receiver by running:
- On Unix based systems use:

```console
docker run --rm -it -p 4317:4317 -p 4318:4318 -v $(pwd)/examples/otlp:/cfg otel/opentelemetry-collector:0.59.0 --config=/cfg/opentelemetry-collector-config/config.dev.yaml
docker run --rm -it -p 4317:4317 -p 4318:4318 -v $(pwd)/examples/otlp:/cfg otel/opentelemetry-collector:0.109.0 --config=/cfg/opentelemetry-collector-config/config.dev.yaml
```

- On Windows use:

```console
docker run --rm -it -p 4317:4317 -p 4318:4318 -v "%cd%/examples/otlp":/cfg otel/opentelemetry-collector:0.59.0 --config=/cfg/opentelemetry-collector-config/config.dev.yaml
docker run --rm -it -p 4317:4317 -p 4318:4318 -v "%cd%/examples/otlp":/cfg otel/opentelemetry-collector:0.109.0 --config=/cfg/opentelemetry-collector-config/config.dev.yaml
```

Note that the OTLP gRPC and HTTP exporters connects to the Collector at `localhost:4317` and `localhost:4318/v1/traces` respectively. This can be changed with first argument from command-line, for example:
Expand Down
10 changes: 5 additions & 5 deletions examples/otlp/opentelemetry-collector-config/config.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# SPDX-License-Identifier: Apache-2.0

exporters:
logging:
loglevel: DEBUG
debug:
verbosity: detailed
receivers:
otlp:
protocols:
Expand All @@ -17,14 +17,14 @@ service:
receivers:
- otlp
exporters:
- logging
- debug
logs:
receivers:
- otlp
exporters:
- logging
- debug
metrics:
receivers:
- otlp
exporters:
- logging
- debug
Loading

0 comments on commit 7ff6178

Please sign in to comment.