Skip to content

Commit

Permalink
Merge branch 'main' into feature/update_googletest_version
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb authored Jul 12, 2023
2 parents a3fa3c9 + d99cbab commit e0ed1eb
Show file tree
Hide file tree
Showing 20 changed files with 288 additions and 16 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/project_management_comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

name: Add comment
on:
issues:
types:
- labeled
jobs:
add-comment:
if: github.event.label.name == 'help wanted'
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Add comment
uses: peter-evans/create-or-update-comment@c6c9a1a66007646a28c153e2a8580a5bad27bcfa
with:
issue-number: ${{ github.event.issue.number }}
body: |
This issue is available for anyone to work on. **Make sure to reference this issue in your pull request.**
:sparkles: Thank you for your contribution! :sparkles:
21 changes: 21 additions & 0 deletions .github/workflows/project_management_issue_open.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: OpenTelemetry-cpp project
on:
issues:
types:
- reopened
- opened
jobs:
label_issues:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/github-script@v6
with:
script: |
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["needs-triage"]
})
113 changes: 113 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,131 @@ Increment the:

## [Unreleased]

## [1.10.0] 2023-07-11

* [REMOVAL] Remove the jaeger exporter
[#2031](https://github.com/open-telemetry/opentelemetry-cpp/pull/2031)

* [CI] Add a C++11 build
[#2152](https://github.com/open-telemetry/opentelemetry-cpp/pull/2152)

* [CI] Add Include what you use
[#2214](https://github.com/open-telemetry/opentelemetry-cpp/pull/2214)

* [CI] opentelemetry-cpp project CI
[#2071](https://github.com/open-telemetry/opentelemetry-cpp/pull/2071)

* [CI] Do not tag pull_request with the "need-triage" label
[#2228](https://github.com/open-telemetry/opentelemetry-cpp/pull/2228)

* [BUILD] Fixing CMake to build GTest on Windows
[#1887](https://github.com/open-telemetry/opentelemetry-cpp/pull/1887)

* [BUILD] Remove option WITH_OTLP
[#2161](https://github.com/open-telemetry/opentelemetry-cpp/pull/2161)

* [BUILD] Link to opentelemetry_logs even without OTLP
[#2177](https://github.com/open-telemetry/opentelemetry-cpp/pull/2177)

* [BUILD] Avoid dependency on protobuf from the OTLP HTTP metrics exporter header
[#2179](https://github.com/open-telemetry/opentelemetry-cpp/pull/2179)

* [BUILD] Add ctime header to metrics_exporter.cc
[#2187](https://github.com/open-telemetry/opentelemetry-cpp/pull/2187)

* [BUILD] Fix the exported symbol name for 32-bit win32 DLL
[#2190](https://github.com/open-telemetry/opentelemetry-cpp/pull/2190)

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

* [BUILD] SDK Header files cleanup, use forward declarations
[#2182](https://github.com/open-telemetry/opentelemetry-cpp/pull/2182)

* [BUILD] Enable building otel-cpp extensions from main repo
[#1937](https://github.com/open-telemetry/opentelemetry-cpp/pull/1937)

* [BUILD] Fix if check on environment variable and add CMake variable
[#2207](https://github.com/open-telemetry/opentelemetry-cpp/pull/2207)

* [BUILD] Add `OPENTELEMETRY_CPP_FOUND` into cmake CONFIG file
[#2215](https://github.com/open-telemetry/opentelemetry-cpp/pull/2215)

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

* [BUILD] Include nostd/string_view which is used in severity.h
[#2219](https://github.com/open-telemetry/opentelemetry-cpp/pull/2219)

* [TEST] Expand api singleton test to cover explicit dlopen()
[#2164](https://github.com/open-telemetry/opentelemetry-cpp/pull/2164)

* [API] Remove include_trace_context
[#2194](https://github.com/open-telemetry/opentelemetry-cpp/pull/2194)

* [API] Remove Meters
[#2205](https://github.com/open-telemetry/opentelemetry-cpp/pull/2205)

* [SDK] Add AdaptingCircularBufferCounter for exponential histograms
[#2158](https://github.com/open-telemetry/opentelemetry-cpp/pull/2158)

* [SDK] Add base2 exponential histogram indexer
[#2173](https://github.com/open-telemetry/opentelemetry-cpp/pull/2173)

* [SDK] Simplify SDK version
[#2180](https://github.com/open-telemetry/opentelemetry-cpp/pull/2180)

* [SDK] Add benchmark for base2 exponential histogram indexer
[#2181](https://github.com/open-telemetry/opentelemetry-cpp/pull/2181)

* [SDK] Provide builders to avoid exposing Metrics SDK internals
[#2189](https://github.com/open-telemetry/opentelemetry-cpp/pull/2189)

* [SDK] MeterProvider should own MeterContext, not share it
[#2218](https://github.com/open-telemetry/opentelemetry-cpp/pull/2218)

* [SDK] TracerProvider should own TracerContext, not share it
[#2221](https://github.com/open-telemetry/opentelemetry-cpp/pull/2221)

* [EXPORTER] Change OTLP Json field name to camelCase
[#2162](https://github.com/open-telemetry/opentelemetry-cpp/pull/2162)

* [EXPORTER] Support empty arrays in `OtlpRecordable` attributes
[#2166](https://github.com/open-telemetry/opentelemetry-cpp/pull/2166)

* [EXPORTER] set is_monotonic only for instrument type kCounter
[#2171](https://github.com/open-telemetry/opentelemetry-cpp/pull/2171)

* [EXPORTER] Fixed HTTP CURL for 32bits platforms
[#2178](https://github.com/open-telemetry/opentelemetry-cpp/pull/2178)

* [EXPORTER] Fix OTLP HTTP exporting in sync mode
[#2193](https://github.com/open-telemetry/opentelemetry-cpp/pull/2193)

* [EXPORTER] Prometheus exporter sanitizes invalid characters
[#1934](https://github.com/open-telemetry/opentelemetry-cpp/pull/1934)

* [EXPORTER] Prometheus: Error on ingesting samples
with different value but same timestamp
[#2200](https://github.com/open-telemetry/opentelemetry-cpp/pull/2200)

* [EXPORTER] OTLP GRPC mTLS support
[#2120](https://github.com/open-telemetry/opentelemetry-cpp/pull/2120)

* [DOC] Small fix for Histogram documentation
[#2156](https://github.com/open-telemetry/opentelemetry-cpp/pull/2156)

* [DOC] Move Reiley Yang to emeritus
[#2198](https://github.com/open-telemetry/opentelemetry-cpp/pull/2198)

Important changes:

* [API] Remove Meters
[#2205](https://github.com/open-telemetry/opentelemetry-cpp/pull/2205)
* The CMake option `WITH_REMOVE_METER_PREVIEW` was added.
* This option is experimental, and may change in the future.
* Enabling it is an ABI breaking change.

Breaking changes:

* [REMOVAL] Remove the jaeger exporter
Expand Down
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@ option(WITH_OPENTRACING "Whether to include the Opentracing shim" OFF)
option(OTELCPP_VERSIONED_LIBS "Whether to generate the versioned shared libs"
OFF)

#
# This option is experimental, subject to change in the spec:
#
# * https://github.com/open-telemetry/opentelemetry-specification/issues/2232
#
option(WITH_REMOVE_METER_PREVIEW
"EXPERIMENTAL, ABI BREAKING: Allow to remove a meter" OFF)

if(OTELCPP_VERSIONED_LIBS AND NOT BUILD_SHARED_LIBS)
message(FATAL_ERROR "OTELCPP_VERSIONED_LIBS=ON requires BUILD_SHARED_LIBS=ON")
endif()
Expand Down
5 changes: 5 additions & 0 deletions api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ 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()

# A better place should be in sdk, not api
if(WITH_OTLP_HTTP_SSL_PREVIEW)
target_compile_definitions(opentelemetry_api
Expand Down
5 changes: 5 additions & 0 deletions api/include/opentelemetry/metrics/meter_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ class MeterProvider
virtual nostd::shared_ptr<Meter> GetMeter(nostd::string_view library_name,
nostd::string_view library_version = "",
nostd::string_view schema_url = "") noexcept = 0;
#ifdef ENABLE_REMOVE_METER_PREVIEW
virtual void RemoveMeter(nostd::string_view library_name,
nostd::string_view library_version = "",
nostd::string_view schema_url = "") noexcept = 0;
#endif
};
} // namespace metrics
OPENTELEMETRY_END_NAMESPACE
7 changes: 7 additions & 0 deletions api/include/opentelemetry/metrics/noop.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,13 @@ class NoopMeterProvider final : public MeterProvider
return meter_;
}

#ifdef ENABLE_REMOVE_METER_PREVIEW
void RemoveMeter(nostd::string_view /* name */,
nostd::string_view /* version */,
nostd::string_view /* schema_url */) noexcept override
{}
#endif

private:
nostd::shared_ptr<Meter> meter_;
};
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 @@ -7,10 +7,10 @@
#include "opentelemetry/detail/preprocessor.h"

#define OPENTELEMETRY_ABI_VERSION_NO 1
#define OPENTELEMETRY_VERSION "1.9.1"
#define OPENTELEMETRY_VERSION "1.10.0"
#define OPENTELEMETRY_VERSION_MAJOR 1
#define OPENTELEMETRY_VERSION_MINOR 9
#define OPENTELEMETRY_VERSION_PATCH 1
#define OPENTELEMETRY_VERSION_MINOR 10
#define OPENTELEMETRY_VERSION_PATCH 0

#define OPENTELEMETRY_ABI_VERSION OPENTELEMETRY_STRINGIFY(OPENTELEMETRY_ABI_VERSION_NO)

Expand Down
3 changes: 3 additions & 0 deletions ci/do_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ elif [[ "$1" == "cmake.maintainer.sync.test" ]]; then
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_HTTP_SSL_PREVIEW=ON \
-DWITH_OTLP_HTTP_SSL_TLS_PREVIEW=ON \
-DWITH_REMOVE_METER_PREVIEW=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_EXAMPLES=ON \
-DWITH_EXAMPLES_HTTP=ON \
Expand All @@ -132,6 +133,7 @@ elif [[ "$1" == "cmake.maintainer.async.test" ]]; then
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_HTTP_SSL_PREVIEW=ON \
-DWITH_OTLP_HTTP_SSL_TLS_PREVIEW=ON \
-DWITH_REMOVE_METER_PREVIEW=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_EXAMPLES=ON \
-DWITH_EXAMPLES_HTTP=ON \
Expand All @@ -156,6 +158,7 @@ elif [[ "$1" == "cmake.maintainer.cpp11.async.test" ]]; then
-DWITH_OTLP_HTTP=ON \
-DWITH_OTLP_HTTP_SSL_PREVIEW=ON \
-DWITH_OTLP_HTTP_SSL_TLS_PREVIEW=ON \
-DWITH_REMOVE_METER_PREVIEW=ON \
-DWITH_PROMETHEUS=ON \
-DWITH_EXAMPLES=ON \
-DWITH_EXAMPLES_HTTP=ON \
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.9.1"
release = "1.10.0"

# Run sphinx on subprojects and copy output
# -----------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions exporters/otlp/test/otlp_grpc_log_record_exporter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ TEST_F(OtlpGrpcLogRecordExporterTestPeer, ExportIntegrationTest)
std::unique_ptr<proto::collector::trace::v1::TraceService::StubInterface> trace_stub_interface(
trace_mock_stub);

auto trace_provider = opentelemetry::nostd::shared_ptr<opentelemetry::v1::trace::TracerProvider>(
auto trace_provider = opentelemetry::nostd::shared_ptr<opentelemetry::trace::TracerProvider>(
opentelemetry::sdk::trace::TracerProviderFactory::Create(
opentelemetry::sdk::trace::SimpleSpanProcessorFactory::Create(
GetExporter(trace_stub_interface))));
Expand All @@ -174,7 +174,7 @@ TEST_F(OtlpGrpcLogRecordExporterTestPeer, ExportIntegrationTest)

auto logger = provider->GetLogger("test", "opentelelemtry_library", "", schema_url,
{{"scope_key1", "scope_value"}, {"scope_key2", 2}});
std::unordered_map<std::string, opentelemetry::v1::common::AttributeValue> attributes;
std::unordered_map<std::string, opentelemetry::common::AttributeValue> attributes;
attributes["service.name"] = "unit_test_service";
attributes["tenant.id"] = "test_user";
attributes["bool_value"] = true;
Expand All @@ -197,7 +197,7 @@ TEST_F(OtlpGrpcLogRecordExporterTestPeer, ExportIntegrationTest)
opentelemetry::trace::Provider::SetTracerProvider(
opentelemetry::nostd::shared_ptr<opentelemetry::trace::TracerProvider>(
new opentelemetry::trace::NoopTracerProvider()));
trace_provider = opentelemetry::nostd::shared_ptr<opentelemetry::v1::trace::TracerProvider>();
trace_provider = opentelemetry::nostd::shared_ptr<opentelemetry::trace::TracerProvider>();
}

} // namespace otlp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include "opentelemetry/nostd/variant.h"

#include <cstdint>
#include <limits>
#include <vector>

Expand Down
4 changes: 4 additions & 0 deletions sdk/include/opentelemetry/sdk/metrics/meter_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ class MeterContext : public std::enable_shared_from_this<MeterContext>
*/
void AddMeter(std::shared_ptr<Meter> meter);

void RemoveMeter(nostd::string_view name,
nostd::string_view version,
nostd::string_view schema_url);

/**
* Force all active Collectors to flush any buffered meter data
* within the given timeout.
Expand Down
6 changes: 6 additions & 0 deletions sdk/include/opentelemetry/sdk/metrics/meter_provider.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ class MeterProvider final : public opentelemetry::metrics::MeterProvider
nostd::string_view version = "",
nostd::string_view schema_url = "") noexcept override;

#ifdef ENABLE_REMOVE_METER_PREVIEW
void RemoveMeter(nostd::string_view name,
nostd::string_view version,
nostd::string_view schema_url) noexcept override;
#endif

/**
* Obtain the resource associated with this meter provider.
* @return The resource for this meter provider.
Expand Down
2 changes: 1 addition & 1 deletion sdk/include/opentelemetry/sdk/version/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "opentelemetry/detail/preprocessor.h"

#define OPENTELEMETRY_SDK_VERSION "1.9.1"
#define OPENTELEMETRY_SDK_VERSION "1.10.0"

#include "opentelemetry/version.h"

Expand Down
27 changes: 27 additions & 0 deletions sdk/src/metrics/meter_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "opentelemetry/sdk/metrics/meter_context.h"
#include "opentelemetry/sdk/common/global_log_handler.h"
#include "opentelemetry/sdk/metrics/meter.h"
#include "opentelemetry/sdk/metrics/metric_reader.h"
#include "opentelemetry/sdk/metrics/state/metric_collector.h"
#include "opentelemetry/sdk_config.h"
Expand Down Expand Up @@ -79,6 +80,32 @@ void MeterContext::AddMeter(std::shared_ptr<Meter> meter)
meters_.push_back(meter);
}

void MeterContext::RemoveMeter(nostd::string_view name,
nostd::string_view version,
nostd::string_view schema_url)
{
std::lock_guard<opentelemetry::common::SpinLockMutex> guard(meter_lock_);

std::vector<std::shared_ptr<Meter>> filtered_meters;

for (auto &meter : meters_)
{
auto scope = meter->GetInstrumentationScope();
if (scope->equal(name, version, schema_url))
{
OTEL_INTERNAL_LOG_INFO("[MeterContext::RemoveMeter] removing meter name <"
<< name << ">, version <" << version << ">, URL <" << schema_url
<< ">");
}
else
{
filtered_meters.push_back(meter);
}
}

meters_.swap(filtered_meters);
}

bool MeterContext::Shutdown() noexcept
{
bool result = true;
Expand Down
Loading

0 comments on commit e0ed1eb

Please sign in to comment.