Skip to content

Commit

Permalink
Merge branch 'main' into sync-gauge
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomsonTan authored Nov 21, 2023
2 parents 1248928 + cb603ad commit 272f30f
Show file tree
Hide file tree
Showing 121 changed files with 4,284 additions and 1,567 deletions.
38 changes: 38 additions & 0 deletions .github/repository-settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Process

This file documents local admin changes for opentelemetry-cpp,
per the community process: https://github.com/open-telemetry/community/blob/main/docs/how-to-configure-new-repository.md

Please note that the EasyCLA check **MUST** stay **REQUIRED**,
it should never be disabled or bypassed, at the risk of tainting the repository.

# Guidelines

The best is to open a PR first that describes the change,
so it can be discussed during review (maybe it is not needed,
maybe there is an alternate solution, ...).

The PR must add a log entry in this file, detailing:

* the date the change is implemented
* what is changed exactly (which setting)
* a short rationale

Admin changes are then applied only when the PR is merged.

If for some reason a change is implemented in emergency,
before a PR can be discussed and merged,
a PR should still be prepared and pushed after the fact to
describe the settings changed.

# Log of local changes

## 2023-11-03

Created log file `.github/repository-settings.md`, since admin permissions are now granted to maintainers.

See https://github.com/open-telemetry/community/issues/1727

No setting changed.


2 changes: 1 addition & 1 deletion .github/workflows/project_management_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
issues: write
steps:
- name: Add comment
uses: peter-evans/create-or-update-comment@c6c9a1a66007646a28c153e2a8580a5bad27bcfa
uses: peter-evans/create-or-update-comment@23ff15729ef2fc348714a3bb66d2f655ca9066f2
with:
issue-number: ${{ github.event.issue.number }}
body: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/project_management_issue_open.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
permissions:
issues: write
steps:
- uses: actions/github-script@v6
- uses: actions/github-script@v7
with:
script: |
github.rest.issues.addLabels({
Expand Down
153 changes: 150 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,160 @@ Increment the:

## [Unreleased]

* [BUILD] Remove WITH_REMOVE_METER_PREVIEW, use WITH_ABI_VERSION_2 instead
[#2370](https://github.com/open-telemetry/opentelemetry-cpp/pull/2370)
* [BUILD] Make WITH_OTLP_HTTP_SSL_PREVIEW mainstream
[#2378](https://github.com/open-telemetry/opentelemetry-cpp/pull/2378)
* [API] Add InstrumentationScope attributes in TracerProvider::GetTracer()
[#2371](https://github.com/open-telemetry/opentelemetry-cpp/pull/2371)
* [BUILD] enum CanonicalCode names too generic... conflict with old C defines
[#2385](https://github.com/open-telemetry/opentelemetry-cpp/pull/2385)
* [API] Add a new AddLink() operation to Span
[#2380](https://github.com/open-telemetry/opentelemetry-cpp/pull/2380)
* [SDK] Fix GetLogger with empty library name
[#2398](https://github.com/open-telemetry/opentelemetry-cpp/pull/2398)
* [EXPORTER] Rework OTLP/HTTP and OTLP/GRPC exporter options
[#2388](https://github.com/open-telemetry/opentelemetry-cpp/pull/2388)

Important changes:

* [API] Add InstrumentationScope attributes in TracerProvider::GetTracer()
[#2371](https://github.com/open-telemetry/opentelemetry-cpp/pull/2371)
* TracerProvider::GetTracer() now accepts InstrumentationScope attributes.
* Because this is an `ABI` breaking change, the fix is only available
with the `CMake` option `WITH_ABI_VERSION_2=ON`.
* When building with `CMake` option `WITH_ABI_VERSION_1=ON` (by default)
the `ABI` is unchanged, and the fix is not available.

* [API] Add a new AddLink() operation to Span
[#2380](https://github.com/open-telemetry/opentelemetry-cpp/pull/2380)
* New `API` Span::AddLink() adds a single link to a span.
* New `API` Span::AddLinks() adds multiple links to a span.
* Because this is an `ABI` breaking change, the fix is only available
with the `CMake` option `WITH_ABI_VERSION_2=ON`.
* When building with `CMake` option `WITH_ABI_VERSION_1=ON` (by default)
the `ABI` is unchanged, and the fix is not available.

* [BUILD] Make WITH_OTLP_HTTP_SSL_PREVIEW mainstream
[#2378](https://github.com/open-telemetry/opentelemetry-cpp/pull/2378)
* The experimental `CMake` option `WITH_OTLP_HTTP_SSL_PREVIEW`
is now promoted to stable. The default is changed to `ON`.
* The experimental `CMake` option `WITH_OTLP_HTTP_SSL_TLS_PREVIEW`
is now promoted to stable. The default is changed to `ON`.
* These build options are scheduled to be removed by the next release,
building without SSL/TLS will no longer be possible.

* [EXPORTER] Rework OTLP/HTTP and OTLP/GRPC exporter options
[#2388](https://github.com/open-telemetry/opentelemetry-cpp/pull/2388)
* `OtlpGrpcMetricExporterOptions` used to honor `_TRACES_`
environment variables, instead of `_METRICS_` environment variables.
* The implementation of `OtlpGrpcMetricExporterOptions` is now fixed.
* Please check configuration variables,
to make sure `_METRICS_` variables are set as expected.

Breaking changes:

* [BUILD] Remove WITH_REMOVE_METER_PREVIEW, use WITH_ABI_VERSION_2 instead
[#2370](https://github.com/open-telemetry/opentelemetry-cpp/pull/2370)
* The experimental `CMake` option `WITH_REMOVE_METER_PREVIEW` is removed,
use option `WITH_ABI_VERSION_2` instead.

* [BUILD] enum CanonicalCode names too generic... conflict with old C defines
[#2385](https://github.com/open-telemetry/opentelemetry-cpp/pull/2385)
* Header file `opentelemetry/trace/canonical_code.h` is unused,
and is now removed.
* This header should not be included directly in an application.
If this is the case, please remove any remaining include directives.

* [BUILD] Fix exported definitions when building DLL with STL
[#2387](https://github.com/open-telemetry/opentelemetry-cpp/pull/2387)
* The MeterSelector, MeterSelectorFactory, InstrumentSelector,
and InstrumentSelectorFactory APIs now use const std::string&
instead of nostd::string_view for name, version and schema to
maintain a single export definition for DLL.

* [EXPORTER] Rework OTLP/HTTP and OTLP/GRPC exporter options
[#2388](https://github.com/open-telemetry/opentelemetry-cpp/pull/2388)
* `OtlpGrpcLogRecordExporter` incorrectly used `OtlpGrpcExporterOptions`,
which are options for traces and not logs.
* This created a bug: the `OtlpGrpcLogRecordExporter` honors `_TRACES_`
environment variables, instead of `_LOGS_` environment variables.
* `OtlpGrpcLogRecordExporter` is changed to use
`OtlpGrpcLogRecordExporterOptions` instead, fixing the bug.
* User code that initializes the SDK with a GRPC Log exporter,
and uses exporter options, should adjust to replace
`OtlpGrpcExporterOptions` with `OtlpGrpcLogRecordExporterOptions`.
* Please check configuration variables,
to make sure `_LOGS_` variables are set as expected.

## [1.12.0] 2023-10-16

* [BUILD] Support `pkg-config`
[#2269](https://github.com/open-telemetry/opentelemetry-cpp/pull/2269)
* [CI] Do not automatically close stale issues
[#2277](https://github.com/open-telemetry/opentelemetry-cpp/pull/2277)
* [CI] Benchmark workflow fails, C++14 required to build grpc
[#2278](https://github.com/open-telemetry/opentelemetry-cpp/pull/2278)
* [SDK] Increase metric name maximum length from 63 to 255 characters
[#2284](https://github.com/open-telemetry/opentelemetry-cpp/pull/2284)
* [SEMANTIC CONVENTION] Deprecated semconv (in the spec)
not deprecated (in C++)
[#2285](https://github.com/open-telemetry/opentelemetry-cpp/pull/2285)
* [SDK] Remove unused member variables from SyncMetricStorage
[#2294](https://github.com/open-telemetry/opentelemetry-cpp/pull/2294)
* [DEPRECATION] Deprecate ZPAGES
[#2291](https://github.com/open-telemetry/opentelemetry-cpp/pull/2291)
* [EXPORTER] Remove explicit timestamps from metric points exported by Prometheus
* [API] Deliver ABI breaking changes
[#2222](https://github.com/open-telemetry/opentelemetry-cpp/pull/2222)
* [SDK] Allow metric instrument names to contain / characters
[#2310](https://github.com/open-telemetry/opentelemetry-cpp/pull/2310)
* [SDK] Fix Observable Counters/UpDownCounters
[#2298](https://github.com/open-telemetry/opentelemetry-cpp/pull/2298)
* [SDK] Add exemplar reservoir to async metric storage
[#2319](https://github.com/open-telemetry/opentelemetry-cpp/pull/2319)
* [TEST] Fix lifetime issues in prometheus test utils
[#2322](https://github.com/open-telemetry/opentelemetry-cpp/pull/2322)
* [EXPORTER] Prometheus: Remove explicit timestamps from metric points
[#2324](https://github.com/open-telemetry/opentelemetry-cpp/pull/2324)
* [EXPORTER] Handle attribute key collisions caused by sanitation
* [EXPORTER] Prometheus: Handle attribute key collisions from sanitation
[#2326](https://github.com/open-telemetry/opentelemetry-cpp/pull/2326)
* [EXPORTER] Replace colons with underscores when converting to Prometheus label
* [EXPORTER] Prometheus cleanup, test with TranslateToPrometheus
[#2329](https://github.com/open-telemetry/opentelemetry-cpp/pull/2329)
* [SDK] Fix log message in Meter::RegisterSyncMetricStorage
[#2325](https://github.com/open-telemetry/opentelemetry-cpp/pull/2325)
* [DOC] Simplify the project status section
[#2332](https://github.com/open-telemetry/opentelemetry-cpp/pull/2332)
* [EXPORTER] Prometheus: Sanitize labels according to spec
[#2330](https://github.com/open-telemetry/opentelemetry-cpp/pull/2330)
* [SDK] Fix deadlock when shuting down http client
[#2337](https://github.com/open-telemetry/opentelemetry-cpp/pull/2337)
* [Exporter] Group spans by resource and instrumentation scope
in OTLP export requests
[#2335](https://github.com/open-telemetry/opentelemetry-cpp/pull/2335)
* [BUILD] Need fine-grained HAVE_CPP_STDLIB
[#2304](https://github.com/open-telemetry/opentelemetry-cpp/pull/2304)
* [API] Add InstrumentationScope attributes in MeterProvider::GetMeter()
[#2224](https://github.com/open-telemetry/opentelemetry-cpp/pull/2224)
* [REMOVAL] Drop C++11 support
[#2342](https://github.com/open-telemetry/opentelemetry-cpp/pull/2342)
* [EXPORTER] prometheus: add otel_scope_name and otel_scope_version labels
[#2293](https://github.com/open-telemetry/opentelemetry-cpp/pull/2293)
* [EXPORTER] Export resource for prometheus
[#2301](https://github.com/open-telemetry/opentelemetry-cpp/pull/2301)
* [BUILD] error: read-only reference ‘value’ used as ‘asm’ output
[#2354](https://github.com/open-telemetry/opentelemetry-cpp/pull/2354)
* [BUILD] Build break with external CMake nlohman_json package
[#2353](https://github.com/open-telemetry/opentelemetry-cpp/pull/2353)
* [BUILD] Upgrade libcurl to version 8.4.0
[#2358](https://github.com/open-telemetry/opentelemetry-cpp/pull/2358)
* [BUILD] Fix opentracing-shim when added in super project
[#2356](https://github.com/open-telemetry/opentelemetry-cpp/pull/2356)
* [BUILD] Fix protoc searching with non-imported protobuf::protoc target
[#2362](https://github.com/open-telemetry/opentelemetry-cpp/pull/2362)
* [BUILD] Support to use different cmake package CONFIG of dependencies
[#2263](https://github.com/open-telemetry/opentelemetry-cpp/pull/2263)
* [SEMANTIC CONVENTION] Upgrade to semconv 1.22.0
[#2368](https://github.com/open-telemetry/opentelemetry-cpp/pull/2368)

Important changes:

Expand Down Expand Up @@ -65,6 +207,11 @@ Breaking changes:
[#2342](https://github.com/open-telemetry/opentelemetry-cpp/pull/2342)
* Building with C++11 is no longer supported.

Deprecations:

* [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
Expand Down
22 changes: 17 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,10 @@ set(OTELCPP_PROTO_PATH

if(WIN32)
option(WITH_ETW "Whether to include the ETW Exporter in the SDK" ON)
else()
if(DEFINED (WITH_ETW))
message(FATAL_ERROR "WITH_ETW is only supported on Windows")
endif()
endif(WIN32)

# Do not convert deprecated message to error
Expand Down Expand Up @@ -275,12 +279,12 @@ endif()

option(WITH_ASYNC_EXPORT_PREVIEW "Whether to enable async export" OFF)

# EXPERIMENTAL
option(WITH_OTLP_HTTP_SSL_PREVIEW "Whether to enable otlp http ssl export" OFF)
# STABLE
option(WITH_OTLP_HTTP_SSL_PREVIEW "Whether to enable otlp http ssl export" ON)

# EXPERIMENTAL
# STABLE
option(WITH_OTLP_HTTP_SSL_TLS_PREVIEW
"Whether to enable otlp http ssl tls min/max/cipher options" OFF)
"Whether to enable otlp http ssl tls min/max/cipher options" ON)

# Exemplar specs status is experimental, so behind feature flag by default
option(WITH_METRICS_EXEMPLAR_PREVIEW
Expand Down Expand Up @@ -430,6 +434,11 @@ if(WITH_OTLP_GRPC OR WITH_OTLP_HTTP)
if(TARGET protobuf::protoc)
project_build_tools_get_imported_location(PROTOBUF_PROTOC_EXECUTABLE
protobuf::protoc)
# If protobuf::protoc is not a imported target, then we use the target
# directly for fallback
if(NOT PROTOBUF_PROTOC_EXECUTABLE)
set(PROTOBUF_PROTOC_EXECUTABLE protobuf::protoc)
endif()
elseif(Protobuf_PROTOC_EXECUTABLE)
# Some versions of FindProtobuf.cmake uses mixed case instead of uppercase
set(PROTOBUF_PROTOC_EXECUTABLE ${Protobuf_PROTOC_EXECUTABLE})
Expand Down Expand Up @@ -574,7 +583,6 @@ list(APPEND CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}")

include(CTest)
if(BUILD_TESTING)
add_definitions(-DENABLE_TEST)
if(EXISTS ${CMAKE_BINARY_DIR}/lib/libgtest.a)
# Prefer GTest from build tree. GTest is not always working with
# CMAKE_PREFIX_PATH
Expand Down Expand Up @@ -624,6 +632,9 @@ endif()
include(CMakePackageConfigHelpers)

if(DEFINED OPENTELEMETRY_BUILD_DLL)
if(NOT WIN32)
message(FATAL_ERROR "Build DLL is only supported on Windows!")
endif()
if(NOT MSVC)
message(WARNING "Build DLL is supposed to work with MSVC!")
endif()
Expand Down Expand Up @@ -683,6 +694,7 @@ if(NOT WITH_API_ONLY)
endif()

include(cmake/opentelemetry-build-external-component.cmake)
include(cmake/patch-imported-config.cmake)

if(OPENTELEMETRY_INSTALL)
# Export cmake config and support find_packages(opentelemetry-cpp CONFIG)
Expand Down
5 changes: 0 additions & 5 deletions api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ if(WITH_ASYNC_EXPORT_PREVIEW)
target_compile_definitions(opentelemetry_api INTERFACE ENABLE_ASYNC_EXPORT)
endif()

if(WITH_REMOVE_METER_PREVIEW)
target_compile_definitions(opentelemetry_api
INTERFACE ENABLE_REMOVE_METER_PREVIEW)
endif()

target_compile_definitions(
opentelemetry_api
INTERFACE OPENTELEMETRY_ABI_VERSION_NO=${OPENTELEMETRY_ABI_VERSION_NO})
Expand Down
14 changes: 13 additions & 1 deletion api/include/opentelemetry/metrics/meter_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,19 @@ class MeterProvider
nostd::string_view schema_url = "") noexcept = 0;
#endif

#ifdef ENABLE_REMOVE_METER_PREVIEW
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
/**
* Remove a named Meter instance (ABI).
*
* This API is experimental, see
* https://github.com/open-telemetry/opentelemetry-specification/issues/2232
*
* @since ABI_VERSION 2
*
* @param[in] name Meter instrumentation scope
* @param[in] version Instrumentation scope version, optional
* @param[in] schema_url Instrumentation scope schema URL, optional
*/
virtual void RemoveMeter(nostd::string_view name,
nostd::string_view version = "",
nostd::string_view schema_url = "") noexcept = 0;
Expand Down
2 changes: 1 addition & 1 deletion api/include/opentelemetry/metrics/noop.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class NoopMeterProvider final : public MeterProvider
}
#endif

#ifdef ENABLE_REMOVE_METER_PREVIEW
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
void RemoveMeter(nostd::string_view /* name */,
nostd::string_view /* version */,
nostd::string_view /* schema_url */) noexcept override
Expand Down
14 changes: 14 additions & 0 deletions api/include/opentelemetry/plugin/tracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include "opentelemetry/common/key_value_iterable.h"
#include "opentelemetry/plugin/detail/tracer_handle.h"
#include "opentelemetry/trace/span_context_kv_iterable.h"
#include "opentelemetry/trace/tracer.h"
#include "opentelemetry/version.h"

Expand Down Expand Up @@ -49,6 +50,19 @@ class Span final : public trace::Span
span_->AddEvent(name, timestamp, attributes);
}

#if OPENTELEMETRY_ABI_VERSION_NO >= 2
void AddLink(const trace::SpanContext &target,
const common::KeyValueIterable &attrs) noexcept override
{
span_->AddLink(target, attrs);
}

void AddLinks(const trace::SpanContextKeyValueIterable &links) noexcept override
{
span_->AddLinks(links);
}
#endif

void SetStatus(trace::StatusCode code, nostd::string_view description) noexcept override
{
span_->SetStatus(code, description);
Expand Down
Loading

0 comments on commit 272f30f

Please sign in to comment.