Skip to content

Commit

Permalink
Merge branch 'main' into prometheus-exporter-failure
Browse files Browse the repository at this point in the history
  • Loading branch information
esigo committed Jun 21, 2022
2 parents 6440301 + 96534a7 commit 0c9c200
Show file tree
Hide file tree
Showing 49 changed files with 546 additions and 370 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
4 changes: 1 addition & 3 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ jobs:
steps:
- 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.'
stale-issue-message: 'This issue was marked as stale due to lack of activity.'
days-before-issue-stale: 60
days-before-issue-close: 7
exempt-issue-labels: 'do-not-stale'
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,26 @@ Increment the:

## [Unreleased]

## [1.4.1] 2022-06-19

* [METRICS SDK] Fix variables inizialization [#1430](https:/open-telemetry/opentelemetry-cpp/pull/1430)
* [DOCS] Fixed broken link to OpenTelemetry.io (#1445) [#1446](https:/open-telemetry/opentelemetry-cpp/pull/1446)
* [BUILD] Upgrade nlohmann_json to 3.10.5 (#1438) [#1441](https:/open-telemetry/opentelemetry-cpp/pull/1441)
* [METRICS SDK] fix histogram [#1440](https:/open-telemetry/opentelemetry-cpp/pull/1440)
* [DOCS] Fix GettingStarted documentation for Jaeger HTTP exporter (#1347) [#1439](https:/open-telemetry/opentelemetry-cpp/pull/1439)
* [BUILD] install sdk-config.h [#1419](https:/open-telemetry/opentelemetry-cpp/pull/1419)
* [EXAMPLE] Log current timestamp instead of epoch time [#1434](https:/open-telemetry/opentelemetry-cpp/pull/1434)
* [METRICS SDK] Add attributes/dimensions to metrics ostream exporter [#1400](https:/open-telemetry/opentelemetry-cpp/pull/1400)
* [SDK] Fix global log handle symbols when using dlopen [#1420](https:/open-telemetry/opentelemetry-cpp/pull/1420)
* [METRICS] Only record non-negative / finite / Non-NAN histogram values([#1427](https:/open-telemetry/opentelemetry-cpp/pull/1427))
* [ETW EXPORTER] Fix ETW log exporter header inclusion [#1426](https:/open-telemetry/opentelemetry-cpp/pull/1426)
* [ETW EXPORTER] Copy string_view passed to ETW exporter in PropertyVariant [#1425](https:/open-telemetry/opentelemetry-cpp/pull/1425)
* [METRICS API/SDK] Pass state to async callback function. [#1408](https:/open-telemetry/opentelemetry-cpp/pull/1408)
* [BUILD] fix nlohmann_json's (third party) include dir [#1415](https:/open-telemetry/opentelemetry-cpp/pull/1415)
* [SDK] fix: WaitOnSocket select error when sockfd above FD_SETSIZE [#1410](https:/open-telemetry/opentelemetry-cpp/pull/1410)
* [SDK] fix OTEL_INTERNAL_LOG_INFO [#1407](https:/open-telemetry/opentelemetry-cpp/pull/1407)
* [DOCS] Document Getting Started with Prometheus and Grafana [#1396](https:/open-telemetry/opentelemetry-cpp/pull/1396)

## [1.4.0] 2022-05-17

* [API SDK] Upgrade proto to v0.17.0, update log data model ([#1383](https:/open-telemetry/opentelemetry-cpp/pull/1383))
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:/open-telemetry/opentelemetry.io/tree/main/content/en/docs/cpp)
[here](https:/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
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.4.0"
#define OPENTELEMETRY_VERSION "1.4.1"
#define OPENTELEMETRY_ABI_VERSION OPENTELEMETRY_STRINGIFY(OPENTELEMETRY_ABI_VERSION_NO)

// clang-format off
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:/nlohmann/json/releases/download/v3.6.1/include.zip",
"https:/nlohmann/json/releases/download/v3.10.5/include.zip",
],
)

Expand Down
2 changes: 1 addition & 1 deletion docs/public/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
author = 'OpenTelemetry authors'

# The full version, including alpha/beta/rc tags
release = '1.4.0'
release = '1.4.1'

# Run sphinx on subprojects and copy output
# -----------------------------------------
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 @@ -30,7 +30,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 0c9c200

Please sign in to comment.