Skip to content

Commit

Permalink
Merge main into async changes (open-telemetry#1451)
Browse files Browse the repository at this point in the history
* install sdk config (open-telemetry#1273)

* Bump actions/cache from 2 to 3 (open-telemetry#1277)

* Add owent as an Approver (open-telemetry#1276)

* add owent as reviewer

* fix order

* Disable benchmark action failure (open-telemetry#1284)

* metrics exemplar round 1 (open-telemetry#1264)

* [Metrics SDK] - fix spelling (AggregationTemporarily to AggregationTemporality) (open-telemetry#1288)

* fix compilation error with protobuf 3.5 (open-telemetry#1289)

* Fix span SetAttribute crash (open-telemetry#1283)

* Synchronous Metric collection (Delta , Cumulative) (open-telemetry#1265)

* Rename `http_client_curl` to `opentelemetry_http_client_curl` (open-telemetry#1301)

Signed-off-by: owent <admin@owent.net>

* Don't show coverage annotation for pull requests (open-telemetry#1304)

* Implement periodic exporting metric reader (open-telemetry#1286)

* Add `async-changes` branch to pull_request of github action (open-telemetry#1309)

Signed-off-by: owent <admin@owent.net>

* Add InstrumentationInfo and Resource to the metrics data to be exported. (open-telemetry#1299)

* Excempt should be applied on issue instead of PR (open-telemetry#1316)

* Bump codecov/codecov-action from 2.1.0 to 3 (open-telemetry#1318)

* Move public definitions into `opentelemetry_api`. (open-telemetry#1314)

Signed-off-by: owent <admin@owent.net>

* Add building test without RTTI (open-telemetry#1294)

* Remove implicitly deleted default constructor (open-telemetry#1267)

Co-authored-by: Tom Tan <Tom.Tan@microsoft.com>
Co-authored-by: Lalit Kumar Bhasin <lalit_fin@yahoo.com>

* [ETW Exporter] - ETW provider handle cleanup (open-telemetry#1322)

* Bump actions/stale from 4 to 5 (open-telemetry#1323)

* ostream metrics example (open-telemetry#1312)

* Prepare v1.3.0 release (open-telemetry#1324)

* Update yield logic for ARM processor (open-telemetry#1325)

* Fix for open-telemetry#1292 (open-telemetry#1326)

* Implement Merge and Diff operation for Histogram Aggregation (open-telemetry#1303)

* fix metrics compiler warnings (open-telemetry#1328)

* Replace deprecated googletest API (open-telemetry#1327)

* Remove redundant tail / in CMake install (open-telemetry#1329)

* dependencies image as artifact (open-telemetry#1333)

Co-authored-by: Lalit Kumar Bhasin <lalit_fin@yahoo.com>

* metrics histogram example (open-telemetry#1330)

* Link `opentelemetry_ext` with `opentelemetry_api` (open-telemetry#1336)

* ostream metrics cmake (open-telemetry#1344)

* prometheus exporter (open-telemetry#1331)

* remove exporter registration to meter provider (open-telemetry#1350)

* Bump github/codeql-action from 1 to 2 (open-telemetry#1351)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add explicit type cast in baggage UrlDecode (open-telemetry#1353)

* Fix scalar delete against array (open-telemetry#1356)

* conditional include for codecvt header (open-telemetry#1355)

* Add missing include guard (open-telemetry#1357)

* Use latest TraceLoggingDynamic.h (open-telemetry#1354)

* prometheus example (open-telemetry#1332)

* Fix output time in metrics OStream exporter (open-telemetry#1346)

* Simplify SDK Configuration: Use View with default aggregation if no matching View is configured (open-telemetry#1358)

* Fix class member initialization order (open-telemetry#1360)

* codecov ignore (open-telemetry#1364)

* export opentelemetry_otlp_recordable (open-telemetry#1365)

* Disable test on prometheus-cpp which not need (open-telemetry#1363)

* Enable metric collection for Async Instruments - Delta and Cumulative  (open-telemetry#1334)

* fix baggage propagation for empty/invalid baggage context (open-telemetry#1367)

* Fix empty tracestate header propagation (open-telemetry#1373)

* Bump docker/setup-qemu-action from 1 to 2 (open-telemetry#1375)

* Add noexcept/const qualifier at missing places for Trace API. (open-telemetry#1374)

* fix noxcept

* fix etw

* Bump docker/build-push-action from 2 to 3 (open-telemetry#1377)

* Bump docker/setup-buildx-action from 1 to 2 (open-telemetry#1376)

* [Metrics SDK] Remove un-necessary files. (open-telemetry#1379)

* reuse temporal metric storage for sync storage (open-telemetry#1369)

* Prometheus exporter meters and instrument name (open-telemetry#1378)

* Fix sharing resource in batched exported spans (open-telemetry#1386)

Co-authored-by: Lalit Kumar Bhasin <lalit_fin@yahoo.com>

* fix: missing link to nlohmann_json (open-telemetry#1390)

* Getting started document using ostream exporter (open-telemetry#1394)

Co-authored-by: Reiley Yang <reyang@microsoft.com>

* Connect async storage with async instruments (open-telemetry#1388)

* get span_id from context when Logger::Log received invalid span_id  (open-telemetry#1398)

* Alpine image (open-telemetry#1382)

* Upgrade proto to v0.17.0, update log data model (open-telemetry#1383)

* Prepare v1.4.0 release (open-telemetry#1404)

* Fix vcpkg package name in doc (open-telemetry#1392)

* Document Getting Started with Prometheus and Grafana (open-telemetry#1396)

Co-authored-by: Lalit Kumar Bhasin <lalit_fin@yahoo.com>

* fix OTEL_INTERNAL_LOG_INFO (open-telemetry#1407)

* fix: WaitOnSocket select error when sockfd above FD_SETSIZE (open-telemetry#1410)

* [BUILD] fix nlohmann_json's (third party) include dir (open-telemetry#1415)

* [Metrics API/SDK] - Pass state to async callback function. (open-telemetry#1408)

* Copy string_view passed to ETW exporter in PropertyVariant (open-telemetry#1425)

* Fix ETW log exporter header inclusion (open-telemetry#1426)

* [Metrics SDK] Only record non-negative / finite / Non-NAN histogram values (open-telemetry#1427)

* validate histogram value

* handle Nan

* add changelog

* divide by 0 error on windows

* fix markdown lint

* Fix global log handle symbols when using dlopen (open-telemetry#1420)

* Add attributes/dimensions to metrics ostream exporter (open-telemetry#1400)

* Log current timestamp instead of epoch time (open-telemetry#1434)

* install sdk-config.h (open-telemetry#1419)

* Fix GettingStarted documentation for Jaeger HTTP exporter (open-telemetry#1347) (open-telemetry#1439)

* fix histogram (open-telemetry#1440)

* Upgrade nlohmann_json to 3.10.5 (open-telemetry#1438) (open-telemetry#1441)

* Fixed broken link to OpenTelemetry.io (open-telemetry#1445) (open-telemetry#1446)

Co-authored-by: Ehsan Saei <71217171+esigo@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lalit Kumar Bhasin <lalit_fin@yahoo.com>
Co-authored-by: Tom Tan <Tom.Tan@microsoft.com>
Co-authored-by: Ben Landrum <71329856+benlandrum@users.noreply.github.com>
Co-authored-by: jmanjon <67091862+juandemanjon@users.noreply.github.com>
Co-authored-by: Zsolt Bölöny <bolony.zsolt@gmail.com>
Co-authored-by: Leo Di Donato <leodidonato@gmail.com>
Co-authored-by: Reiley Yang <reyang@microsoft.com>
Co-authored-by: Lalit Kumar Bhasin <labhas@microsoft.com>
Co-authored-by: Hamed Mansouri <hamed0381@gmail.com>
Co-authored-by: ztao <t@taozj.org>
Co-authored-by: Flier Lu <flier@users.noreply.github.com>
Co-authored-by: Marc Alff <marc.alff@free.fr>
Co-authored-by: Marc Alff <marc.alff@oracle.com>
  • Loading branch information
16 people authored Jun 15, 2022
1 parent d7b03e8 commit f357102
Show file tree
Hide file tree
Showing 45 changed files with 513 additions and 354 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ LICENSE* text
## git files
.gitignore text eol=lf
.gitattributes text eol=lf

## bazel files
WORKSPACE text eol=lf
BUILD text eol=lf
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Increment the:
* [EXPORTER] OTLP http exporter allow concurrency session ([#1209](https://github.com/open-telemetry/opentelemetry-cpp/pull/1209))
* [EXT] `curl::HttpClient` use `curl_multi_handle` instead of creating a thread
for every request and it's able to reuse connections now. ([#1317](https://github.com/open-telemetry/opentelemetry-cpp/pull/1317))
* [METRICS] Only record non-negative / finite / Non-NAN histogram values([#1427](https://github.com/open-telemetry/opentelemetry-cpp/pull/1427))

## [1.4.0] 2022-05-17

Expand Down
2 changes: 1 addition & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,5 @@ should include all the release notes from the Changelog for this release.
## Post Release

Update the OpenTelemetry.io document
[here](https://github.com/open-telemetry/opentelemetry.io/tree/main/content/en/docs/cpp)
[here](https://github.com/open-telemetry/opentelemetry.io/tree/main/content/en/docs/instrumentation/cpp)
by sending a Pull Request.
45 changes: 26 additions & 19 deletions api/include/opentelemetry/metrics/meter.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,24 +47,26 @@ class Meter
nostd::string_view unit = "") noexcept = 0;

/**
* Creates a Asynchronouse (Observable) counter with the passed characteristics and returns a
* Creates a Asynchronous (Observable) counter with the passed characteristics and returns a
* shared_ptr to that Observable Counter
*
* @param name the name of the new Observable Counter.
* @param callback the function to be observed by the instrument.
* @param description a brief description of what the Observable Counter is used for.
* @param unit the unit of metric values following https://unitsofmeasure.org/ucum.html.
* @param callback the function to be observed by the instrument.
* @return a shared pointer to the created Observable Counter.
* @param state to be passed back to callback
*/
virtual void CreateLongObservableCounter(nostd::string_view name,
void (*callback)(ObserverResult<long> &),
void (*callback)(ObserverResult<long> &, void *),
nostd::string_view description = "",
nostd::string_view unit = "") noexcept = 0;
nostd::string_view unit = "",
void *state = nullptr) noexcept = 0;

virtual void CreateDoubleObservableCounter(nostd::string_view name,
void (*callback)(ObserverResult<double> &),
void (*callback)(ObserverResult<double> &, void *),
nostd::string_view description = "",
nostd::string_view unit = "") noexcept = 0;
nostd::string_view unit = "",
void *state = nullptr) noexcept = 0;

/**
* Creates a Histogram with the passed characteristics and returns a shared_ptr to that Histogram.
Expand All @@ -89,20 +91,22 @@ class Meter
* shared_ptr to that Observable Counter
*
* @param name the name of the new Observable Gauge.
* @param callback the function to be observed by the instrument.
* @param description a brief description of what the Observable Gauge is used for.
* @param unit the unit of metric values following https://unitsofmeasure.org/ucum.html.
* @param callback the function to be observed by the instrument.
* @return a shared pointer to the created Observable Gauge.
* @param state to be passed back to callback
*/
virtual void CreateLongObservableGauge(nostd::string_view name,
void (*callback)(ObserverResult<long> &),
void (*callback)(ObserverResult<long> &, void *),
nostd::string_view description = "",
nostd::string_view unit = "") noexcept = 0;
nostd::string_view unit = "",
void *state = nullptr) noexcept = 0;

virtual void CreateDoubleObservableGauge(nostd::string_view name,
void (*callback)(ObserverResult<double> &),
void (*callback)(ObserverResult<double> &, void *),
nostd::string_view description = "",
nostd::string_view unit = "") noexcept = 0;
nostd::string_view unit = "",
void *state = nullptr) noexcept = 0;

/**
* Creates an UpDownCounter with the passed characteristics and returns a shared_ptr to that
Expand All @@ -128,20 +132,23 @@ class Meter
* a shared_ptr to that Observable UpDownCounter
*
* @param name the name of the new Observable UpDownCounter.
* @param callback the function to be observed by the instrument.
* @param description a brief description of what the Observable UpDownCounter is used for.
* @param unit the unit of metric values following https://unitsofmeasure.org/ucum.html.
* @param callback the function to be observed by the instrument.
* @return a shared pointer to the created Observable UpDownCounter.
* @param state to be passed back to callback
*/
virtual void CreateLongObservableUpDownCounter(nostd::string_view name,
void (*callback)(ObserverResult<long> &),
void (*callback)(ObserverResult<long> &, void *),
nostd::string_view description = "",
nostd::string_view unit = "") noexcept = 0;
nostd::string_view unit = "",
void *state = nullptr) noexcept = 0;

virtual void CreateDoubleObservableUpDownCounter(nostd::string_view name,
void (*callback)(ObserverResult<double> &),
void (*callback)(ObserverResult<double> &,
void *),
nostd::string_view description = "",
nostd::string_view unit = "") noexcept = 0;
nostd::string_view unit = "",
void *state = nullptr) noexcept = 0;
};
} // namespace metrics
OPENTELEMETRY_END_NAMESPACE
Expand Down
30 changes: 18 additions & 12 deletions api/include/opentelemetry/metrics/noop.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,17 @@ class NoopMeter final : public Meter
}

void CreateLongObservableCounter(nostd::string_view name,
void (*callback)(ObserverResult<long> &),
void (*callback)(ObserverResult<long> &, void *),
nostd::string_view description = "",
nostd::string_view unit = "") noexcept override
nostd::string_view unit = "",
void *state = nullptr) noexcept override
{}

void CreateDoubleObservableCounter(nostd::string_view name,
void (*callback)(ObserverResult<double> &),
void (*callback)(ObserverResult<double> &, void *),
nostd::string_view description = "",
nostd::string_view unit = "") noexcept override
nostd::string_view unit = "",
void *state = nullptr) noexcept override
{}

nostd::shared_ptr<Histogram<long>> CreateLongHistogram(
Expand All @@ -166,15 +168,17 @@ class NoopMeter final : public Meter
}

void CreateLongObservableGauge(nostd::string_view name,
void (*callback)(ObserverResult<long> &),
void (*callback)(ObserverResult<long> &, void *),
nostd::string_view description = "",
nostd::string_view unit = "") noexcept override
nostd::string_view unit = "",
void *state = nullptr) noexcept override
{}

void CreateDoubleObservableGauge(nostd::string_view name,
void (*callback)(ObserverResult<double> &),
void (*callback)(ObserverResult<double> &, void *),
nostd::string_view description = "",
nostd::string_view unit = "") noexcept override
nostd::string_view unit = "",
void *state = nullptr) noexcept override
{}

nostd::shared_ptr<UpDownCounter<long>> CreateLongUpDownCounter(
Expand All @@ -196,15 +200,17 @@ class NoopMeter final : public Meter
}

void CreateLongObservableUpDownCounter(nostd::string_view name,
void (*callback)(ObserverResult<long> &),
void (*callback)(ObserverResult<long> &, void *),
nostd::string_view description = "",
nostd::string_view unit = "") noexcept override
nostd::string_view unit = "",
void *state = nullptr) noexcept override
{}

void CreateDoubleObservableUpDownCounter(nostd::string_view name,
void (*callback)(ObserverResult<double> &),
void (*callback)(ObserverResult<double> &, void *),
nostd::string_view description = "",
nostd::string_view unit = "") noexcept override
nostd::string_view unit = "",
void *state = nullptr) noexcept override
{}
};

Expand Down
2 changes: 1 addition & 1 deletion api/include/opentelemetry/trace/span_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class SpanContext final

bool IsRemote() const noexcept { return is_remote_; }

static SpanContext GetInvalid() { return SpanContext(false, false); }
static SpanContext GetInvalid() noexcept { return SpanContext(false, false); }

bool IsSampled() const noexcept { return trace_flags_.IsSampled(); }

Expand Down
17 changes: 15 additions & 2 deletions bazel/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ filegroup(
)
"""

#
# MAINTAINER
#
# This file is used for the Bazel build.
#
# When changing (add, upgrade, remove) dependencies
# please update:
# - the CMake build, see file
# <root>/third_party_release
# - git submodule, see command
# git submodule status
#

def opentelemetry_cpp_deps():
"""Loads dependencies need to compile the opentelemetry-cpp library."""

Expand Down Expand Up @@ -86,9 +99,9 @@ def opentelemetry_cpp_deps():
http_archive,
name = "github_nlohmann_json",
build_file = "@io_opentelemetry_cpp//bazel:nlohmann_json.BUILD",
sha256 = "69cc88207ce91347ea530b227ff0776db82dcb8de6704e1a3d74f4841bc651cf",
sha256 = "b94997df68856753b72f0d7a3703b7d484d4745c567f3584ef97c96c25a5798e",
urls = [
"https://github.com/nlohmann/json/releases/download/v3.6.1/include.zip",
"https://github.com/nlohmann/json/releases/download/v3.10.5/include.zip",
],
)

Expand Down
2 changes: 1 addition & 1 deletion cmake/nlohmann-json.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ExternalProject_Add(nlohmann_json_download
)

ExternalProject_Get_Property(nlohmann_json_download INSTALL_DIR)
SET(NLOHMANN_JSON_INCLUDE_DIR ${INSTALL_DIR}/third_party/src/nlohmann_json_download/single_include)
SET(NLOHMANN_JSON_INCLUDE_DIR ${INSTALL_DIR}/src/nlohmann_json_download/single_include)
add_library(nlohmann_json_ INTERFACE)
target_include_directories(nlohmann_json_ INTERFACE
"$<BUILD_INTERFACE:${NLOHMANN_JSON_INCLUDE_DIR}>"
Expand Down
4 changes: 2 additions & 2 deletions docs/public/sdk/GettingStarted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ OpenTelemetry offers six tracing exporters out of the box:
opentelemetry::exporter::jaeger::JaegerExporterOptions opts;
opts.transport_format = opentelemetry::exporter::jaeger::TransportFormat::kThriftHttp;
opts.endpoint = "localhost";
opts.server_port = 6831;
opts.server_port = 14268;
opts.headers = {{}}; // optional headers
auto jaeger_udp_exporter =
auto jaeger_http_exporter =
std::unique_ptr<sdktrace::SpanExporter>(new opentelemetry::exporter::jaeger::JaegerExporter(opts));
Expand Down
3 changes: 2 additions & 1 deletion examples/common/logs_foo_library/foo_library.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ void foo_library()
auto ctx = span->GetContext();
auto logger = get_logger();
logger->Log(opentelemetry::logs::Severity::kDebug, "body", {}, ctx.trace_id(), ctx.span_id(),
ctx.trace_flags(), opentelemetry::common::SystemTimestamp());
ctx.trace_flags(),
opentelemetry::common::SystemTimestamp(std::chrono::system_clock::now()));
}
#endif
2 changes: 1 addition & 1 deletion examples/common/metrics_foo_library/foo_library.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ std::map<std::string, std::string> get_random_attr()
class MeasurementFetcher
{
public:
static void Fetcher(opentelemetry::metrics::ObserverResult<double> &observer_result)
static void Fetcher(opentelemetry::metrics::ObserverResult<double> &observer_result, void *state)
{
double val = (rand() % 700) + 1.1;
std::map<std::string, std::string> labels = get_random_attr();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# include "opentelemetry/common/key_value_iterable_view.h"

# include "opentelemetry/logs/tracer_provider.h"
# include "opentelemetry/logs/logger_provider.h"
# include "opentelemetry/trace/span_id.h"
# include "opentelemetry/trace/trace_id.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class PropertyValue : public PropertyVariant
{}

/**
* @brief Convert owning PropertyValue to non-owning common::AttributeValue
* @brief Convert non-owning common::AttributeValue to owning PropertyValue.
* @return
*/
PropertyValue &FromAttributeValue(const common::AttributeValue &v)
Expand Down Expand Up @@ -222,7 +222,8 @@ class PropertyValue : public PropertyVariant
break;
}
case common::AttributeType::kTypeString: {
PropertyVariant::operator=(nostd::string_view(nostd::get<nostd::string_view>(v)).data());
PropertyVariant::operator=
(std::string{nostd::string_view(nostd::get<nostd::string_view>(v)).data()});
break;
}

Expand Down
2 changes: 1 addition & 1 deletion exporters/etw/test/etw_logger_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# include <map>
# include <string>

# include "opentelemetry/exporters/etw/etw_logger.h"
# include "opentelemetry/exporters/etw/etw_logger_exporter.h"
# include "opentelemetry/sdk/trace/simple_processor.h"

using namespace OPENTELEMETRY_NAMESPACE;
Expand Down
1 change: 1 addition & 0 deletions exporters/jaeger/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ cc_library(
tags = ["jaeger"],
deps = [
":jaeger_exporter",
"//sdk/src/common:global_log_handler",
],
)

Expand Down
3 changes: 3 additions & 0 deletions exporters/ostream/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ cc_library(
"src/log_exporter.cc",
],
hdrs = [
"include/opentelemetry/exporters/ostream/common_utils.h",
"include/opentelemetry/exporters/ostream/log_exporter.h",
],
strip_include_prefix = "include",
Expand Down Expand Up @@ -49,6 +50,7 @@ cc_library(
"src/metric_exporter.cc",
],
hdrs = [
"include/opentelemetry/exporters/ostream/common_utils.h",
"include/opentelemetry/exporters/ostream/metric_exporter.h",
],
strip_include_prefix = "include",
Expand Down Expand Up @@ -93,6 +95,7 @@ cc_library(
"src/span_exporter.cc",
],
hdrs = [
"include/opentelemetry/exporters/ostream/common_utils.h",
"include/opentelemetry/exporters/ostream/span_exporter.h",
],
strip_include_prefix = "include",
Expand Down
Loading

0 comments on commit f357102

Please sign in to comment.