Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
e072daa
install sdk config (#1273)
esigo Mar 21, 2022
6ec1b59
Bump actions/cache from 2 to 3 (#1277)
dependabot[bot] Mar 22, 2022
b5155a5
Add owent as an Approver (#1276)
lalitb Mar 23, 2022
0c9aece
Disable benchmark action failure (#1284)
esigo Mar 24, 2022
3c7b44b
metrics exemplar round 1 (#1264)
esigo Mar 24, 2022
2c9ce39
[Metrics SDK] - fix spelling (AggregationTemporarily to AggregationTe…
lalitb Mar 24, 2022
91b0572
fix compilation error with protobuf 3.5 (#1289)
esigo Mar 25, 2022
c1b9590
Fix span SetAttribute crash (#1283)
esigo Mar 26, 2022
a7e814a
Synchronous Metric collection (Delta , Cumulative) (#1265)
lalitb Mar 30, 2022
76c664a
Rename `http_client_curl` to `opentelemetry_http_client_curl` (#1301)
owent Mar 31, 2022
2034c9b
Don't show coverage annotation for pull requests (#1304)
ThomsonTan Apr 1, 2022
33d9c62
Implement periodic exporting metric reader (#1286)
lalitb Apr 1, 2022
48a4060
Add `async-changes` branch to pull_request of github action (#1309)
owent Apr 4, 2022
be75bbc
Add InstrumentationInfo and Resource to the metrics data to be export…
lalitb Apr 4, 2022
237a0b2
Excempt should be applied on issue instead of PR (#1316)
ThomsonTan Apr 5, 2022
fd338cc
Bump codecov/codecov-action from 2.1.0 to 3 (#1318)
dependabot[bot] Apr 6, 2022
74ec691
Move public definitions into `opentelemetry_api`. (#1314)
owent Apr 7, 2022
6b87300
Add building test without RTTI (#1294)
owent Apr 7, 2022
3122254
Remove implicitly deleted default constructor (#1267)
benlandrum Apr 7, 2022
d72dcb6
[ETW Exporter] - ETW provider handle cleanup (#1322)
lalitb Apr 11, 2022
e200c1f
Bump actions/stale from 4 to 5 (#1323)
dependabot[bot] Apr 11, 2022
755f109
ostream metrics example (#1312)
esigo Apr 12, 2022
da2911c
Prepare v1.3.0 release (#1324)
ThomsonTan Apr 12, 2022
75c2a8f
Update yield logic for ARM processor (#1325)
lalitb Apr 12, 2022
e7f051e
Fix for #1292 (#1326)
juandemanjon Apr 14, 2022
29d68f1
Implement Merge and Diff operation for Histogram Aggregation (#1303)
lalitb Apr 14, 2022
e3304d7
fix metrics compiler warnings (#1328)
esigo Apr 15, 2022
defdfd2
Replace deprecated googletest API (#1327)
ThomsonTan Apr 15, 2022
2e9b7a1
Remove redundant tail / in CMake install (#1329)
ThomsonTan Apr 16, 2022
1d2cd42
dependencies image as artifact (#1333)
esigo Apr 18, 2022
b33dd09
metrics histogram example (#1330)
esigo Apr 18, 2022
7fde3bc
Link `opentelemetry_ext` with `opentelemetry_api` (#1336)
owent Apr 21, 2022
bf8f433
ostream metrics cmake (#1344)
esigo Apr 21, 2022
e6fb935
prometheus exporter (#1331)
esigo Apr 25, 2022
0c74e0b
remove exporter registration to meter provider (#1350)
lalitb Apr 25, 2022
33cb827
Bump github/codeql-action from 1 to 2 (#1351)
dependabot[bot] Apr 26, 2022
c917bed
Add explicit type cast in baggage UrlDecode (#1353)
ThomsonTan Apr 26, 2022
e233791
Fix scalar delete against array (#1356)
ThomsonTan Apr 27, 2022
3b9bfd4
conditional include for codecvt header (#1355)
lalitb Apr 27, 2022
72360b4
Add missing include guard (#1357)
yzsolt Apr 27, 2022
4008da5
Use latest TraceLoggingDynamic.h (#1354)
lalitb Apr 27, 2022
a4bd3b0
prometheus example (#1332)
esigo Apr 28, 2022
3a4a3a3
Fix output time in metrics OStream exporter (#1346)
ThomsonTan Apr 28, 2022
f314522
Simplify SDK Configuration: Use View with default aggregation if no m…
lalitb Apr 30, 2022
8ef6764
Fix class member initialization order (#1360)
lalitb Apr 30, 2022
c8bd431
codecov ignore (#1364)
esigo Apr 30, 2022
c1e6e16
export opentelemetry_otlp_recordable (#1365)
esigo May 2, 2022
13ac5c3
Disable test on prometheus-cpp which not need (#1363)
ThomsonTan May 2, 2022
9c734b3
Enable metric collection for Async Instruments - Delta and Cumulative…
lalitb May 3, 2022
59a48c1
fix baggage propagation for empty/invalid baggage context (#1367)
lalitb May 4, 2022
d3c4200
Fix empty tracestate header propagation (#1373)
yzsolt May 5, 2022
5458dde
Bump docker/setup-qemu-action from 1 to 2 (#1375)
dependabot[bot] May 6, 2022
99a72e1
Add noexcept/const qualifier at missing places for Trace API. (#1374)
lalitb May 6, 2022
a0d4a72
Bump docker/build-push-action from 2 to 3 (#1377)
dependabot[bot] May 6, 2022
0d27a43
Bump docker/setup-buildx-action from 1 to 2 (#1376)
dependabot[bot] May 6, 2022
02630e0
[Metrics SDK] Remove un-necessary files. (#1379)
lalitb May 7, 2022
54abc27
reuse temporal metric storage for sync storage (#1369)
lalitb May 9, 2022
95effbd
Prometheus exporter meters and instrument name (#1378)
esigo May 10, 2022
88e23ad
Fix sharing resource in batched exported spans (#1386)
ThomsonTan May 11, 2022
4b69a10
fix: missing link to nlohmann_json (#1390)
leodido May 13, 2022
6d11b8e
Merge remote-tracking branch 'opentelemetry/main' into async-changes
owent May 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/.codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,10 @@ comment:
# to coverage report file paths.
fixes:
- "/home/runner/::"

ignore:
- "docs/**/*"
- "docker/**/*"
- "examples/**/*"
- "**/test/**/*"
- "**.md"
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
sudo ./ci/setup_cmake.sh
sudo ./ci/setup_ci_environment.sh
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: cpp
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
6 changes: 3 additions & 3 deletions .github/workflows/dependencies_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
uses: actions/checkout@v2
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
-
name: Build Image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
builder: ${{ steps.buildx.outputs.name }}
context: ci/
Expand Down
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,10 @@ if(WITH_PROMETHEUS)
if(NOT prometheus-cpp_FOUND)
message("Trying to use local prometheus-cpp from submodule")
if(EXISTS ${PROJECT_SOURCE_DIR}/third_party/prometheus-cpp/.git)
set(SAVED_ENABLE_TESTING ${ENABLE_TESTING})
set(ENABLE_TESTING OFF)
add_subdirectory(third_party/prometheus-cpp)
set(ENABLE_TESTING ${SAVED_ENABLE_TESTING})
else()
message(
FATAL_ERROR
Expand Down Expand Up @@ -362,7 +365,7 @@ if(BUILD_TESTING)
${CMAKE_BINARY_DIR}/lib/libgmock.a)
elseif(WIN32)
# Make sure we are always bootsrapped with vcpkg on Windows
find_package(GTest)
find_package(GTest REQUIRED)
if(NOT (GTEST_FOUND OR GTest_FOUND))
install_windows_deps()
find_package(GTest REQUIRED)
Expand Down
22 changes: 13 additions & 9 deletions api/include/opentelemetry/baggage/baggage.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ class Baggage
static constexpr char kMembersSeparator = ',';
static constexpr char kMetadataSeparator = ';';

Baggage() : kv_properties_(new opentelemetry::common::KeyValueProperties()) {}
Baggage(size_t size) : kv_properties_(new opentelemetry::common::KeyValueProperties(size)){};
Baggage() noexcept : kv_properties_(new opentelemetry::common::KeyValueProperties()) {}
Baggage(size_t size) noexcept
: kv_properties_(new opentelemetry::common::KeyValueProperties(size)){};

template <class T>
Baggage(const T &keys_and_values)
Baggage(const T &keys_and_values) noexcept
: kv_properties_(new opentelemetry::common::KeyValueProperties(keys_and_values))
{}

Expand All @@ -42,15 +43,16 @@ class Baggage
/* Get value for key in the baggage
@returns true if key is found, false otherwise
*/
bool GetValue(nostd::string_view key, std::string &value) const
bool GetValue(nostd::string_view key, std::string &value) const noexcept
{
return kv_properties_->GetValue(key, value);
}

/* Returns shared_ptr of new baggage object which contains new key-value pair. If key or value is
invalid, copy of current baggage is returned
*/
nostd::shared_ptr<Baggage> Set(const nostd::string_view &key, const nostd::string_view &value)
nostd::shared_ptr<Baggage> Set(const nostd::string_view &key,
const nostd::string_view &value) noexcept
{

nostd::shared_ptr<Baggage> baggage(new Baggage(kv_properties_->Size() + 1));
Expand Down Expand Up @@ -89,7 +91,7 @@ class Baggage
// if key does not exist, copy of current baggage is returned.
// Validity of key is not checked as invalid keys should never be populated in baggage in the
// first place.
nostd::shared_ptr<Baggage> Delete(nostd::string_view key)
nostd::shared_ptr<Baggage> Delete(nostd::string_view key) noexcept
{
// keeping size of baggage same as key might not be found in it
nostd::shared_ptr<Baggage> baggage(new Baggage(kv_properties_->Size()));
Expand All @@ -103,7 +105,7 @@ class Baggage
}

// Returns shared_ptr of baggage after extracting key-value pairs from header
static nostd::shared_ptr<Baggage> FromHeader(nostd::string_view header)
static nostd::shared_ptr<Baggage> FromHeader(nostd::string_view header) noexcept
{
if (header.size() > kMaxSize)
{
Expand Down Expand Up @@ -158,7 +160,7 @@ class Baggage
}

// Creates string from baggage object.
std::string ToHeader() const
std::string ToHeader() const noexcept
{
std::string header_s;
bool first = true;
Expand Down Expand Up @@ -249,7 +251,9 @@ class Baggage
};

auto from_hex = [](char c) -> char {
return std::isdigit(c) ? c - '0' : std::toupper(c) - 'A' + 10;
// c - '0' produces integer type which could trigger error/warning when casting to char,
// but the cast is safe here.
return static_cast<char>(std::isdigit(c) ? c - '0' : std::toupper(c) - 'A' + 10);
};

std::string ret;
Expand Down
7 changes: 4 additions & 3 deletions api/include/opentelemetry/baggage/baggage_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace baggage
static const std::string kBaggageHeader = "baggage";

inline nostd::shared_ptr<opentelemetry::baggage::Baggage> GetBaggage(
const opentelemetry::context::Context &context)
const opentelemetry::context::Context &context) noexcept
{
context::ContextValue context_value = context.GetValue(kBaggageHeader);
if (nostd::holds_alternative<nostd::shared_ptr<opentelemetry::baggage::Baggage>>(context_value))
Expand All @@ -28,8 +28,9 @@ inline nostd::shared_ptr<opentelemetry::baggage::Baggage> GetBaggage(
return empty_baggage;
}

inline context::Context SetBaggage(opentelemetry::context::Context &context,
nostd::shared_ptr<opentelemetry::baggage::Baggage> baggage)
inline context::Context SetBaggage(
opentelemetry::context::Context &context,
nostd::shared_ptr<opentelemetry::baggage::Baggage> baggage) noexcept
{
return context.SetValue(kBaggageHeader, baggage);
}
Expand Down
16 changes: 14 additions & 2 deletions api/include/opentelemetry/baggage/propagation/baggage_propagator.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,27 @@ class BaggagePropagator : public opentelemetry::context::propagation::TextMapPro
const opentelemetry::context::Context &context) noexcept override
{
auto baggage = opentelemetry::baggage::GetBaggage(context);
carrier.Set(kBaggageHeader, baggage->ToHeader());
auto header = baggage->ToHeader();
if (header.size())
{
carrier.Set(kBaggageHeader, header);
}
}

context::Context Extract(const opentelemetry::context::propagation::TextMapCarrier &carrier,
opentelemetry::context::Context &context) noexcept override
{
nostd::string_view baggage_str = carrier.Get(opentelemetry::baggage::kBaggageHeader);
auto baggage = opentelemetry::baggage::Baggage::FromHeader(baggage_str);
return opentelemetry::baggage::SetBaggage(context, baggage);

if (baggage->ToHeader().size())
{
return opentelemetry::baggage::SetBaggage(context, baggage);
}
else
{
return context;
}
}

bool Fields(nostd::function_ref<bool(nostd::string_view)> callback) const noexcept override
Expand Down
22 changes: 11 additions & 11 deletions api/include/opentelemetry/common/kv_properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class KeyValueStringTokenizer
public:
KeyValueStringTokenizer(
nostd::string_view str,
const KeyValueStringTokenizerOptions &opts = KeyValueStringTokenizerOptions())
const KeyValueStringTokenizerOptions &opts = KeyValueStringTokenizerOptions()) noexcept
: str_(str), opts_(opts), index_(0)
{}

Expand All @@ -48,7 +48,7 @@ class KeyValueStringTokenizer
// @param key : key in kv pair
// @param key : value in kv pair
// @returns true if next kv pair was found, false otherwise.
bool next(bool &valid_kv, nostd::string_view &key, nostd::string_view &value)
bool next(bool &valid_kv, nostd::string_view &key, nostd::string_view &value) noexcept
{
valid_kv = true;
while (index_ < str_.size())
Expand Down Expand Up @@ -170,13 +170,13 @@ class KeyValueProperties
}

// Gets the key associated with this entry.
nostd::string_view GetKey() const { return key_.get(); }
nostd::string_view GetKey() const noexcept { return key_.get(); }

// Gets the value associated with this entry.
nostd::string_view GetValue() const { return value_.get(); }
nostd::string_view GetValue() const noexcept { return value_.get(); }

// Sets the value for this entry. This overrides the previous value.
void SetValue(nostd::string_view value) { value_ = CopyStringToPointer(value); }
void SetValue(nostd::string_view value) noexcept { value_ = CopyStringToPointer(value); }

private:
// Store key and value as raw char pointers to avoid using std::string.
Expand Down Expand Up @@ -206,15 +206,15 @@ class KeyValueProperties
public:
// Create Key-value list of given size
// @param size : Size of list.
KeyValueProperties(size_t size)
KeyValueProperties(size_t size) noexcept
: num_entries_(0), max_num_entries_(size), entries_(new Entry[size])
{}

// Create Empty Key-Value list
KeyValueProperties() : num_entries_(0), max_num_entries_(0), entries_(nullptr) {}
KeyValueProperties() noexcept : num_entries_(0), max_num_entries_(0), entries_(nullptr) {}

template <class T, class = typename std::enable_if<detail::is_key_value_iterable<T>::value>::type>
KeyValueProperties(const T &keys_and_values)
KeyValueProperties(const T &keys_and_values) noexcept
: num_entries_(0),
max_num_entries_(keys_and_values.size()),
entries_(new Entry[max_num_entries_])
Expand All @@ -227,7 +227,7 @@ class KeyValueProperties
}

// Adds new kv pair into kv properties
void AddEntry(nostd::string_view key, nostd::string_view value)
void AddEntry(nostd::string_view key, nostd::string_view value) noexcept
{
if (num_entries_ < max_num_entries_)
{
Expand All @@ -238,7 +238,7 @@ class KeyValueProperties

// Returns all kv pair entries
bool GetAllEntries(
nostd::function_ref<bool(nostd::string_view, nostd::string_view)> callback) const
nostd::function_ref<bool(nostd::string_view, nostd::string_view)> callback) const noexcept
{
for (size_t i = 0; i < num_entries_; i++)
{
Expand All @@ -252,7 +252,7 @@ class KeyValueProperties
}

// Return value for key if exists, return false otherwise
bool GetValue(nostd::string_view key, std::string &value) const
bool GetValue(nostd::string_view key, std::string &value) const noexcept
{
for (size_t i = 0; i < num_entries_; i++)
{
Expand Down
4 changes: 2 additions & 2 deletions api/include/opentelemetry/common/string_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace common
class StringUtil
{
public:
static nostd::string_view Trim(nostd::string_view str, size_t left, size_t right)
static nostd::string_view Trim(nostd::string_view str, size_t left, size_t right) noexcept
{
while (str[static_cast<std::size_t>(left)] == ' ' && left <= right)
{
Expand All @@ -39,7 +39,7 @@ class StringUtil
return str.substr(left, 1 + right - left);
}

static nostd::string_view Trim(nostd::string_view str)
static nostd::string_view Trim(nostd::string_view str) noexcept
{
if (str.empty())
{
Expand Down
4 changes: 2 additions & 2 deletions api/include/opentelemetry/context/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ class Context
// Creates a context object from a map of keys and identifiers, this will
// hold a shared_ptr to the head of the DataList linked list
template <class T>
Context(const T &keys_and_values)
Context(const T &keys_and_values) noexcept
{
head_ = nostd::shared_ptr<DataList>{new DataList(keys_and_values)};
}

// Creates a context object from a key and value, this will
// hold a shared_ptr to the head of the DataList linked list
Context(nostd::string_view key, ContextValue value)
Context(nostd::string_view key, ContextValue value) noexcept
{
head_ = nostd::shared_ptr<DataList>{new DataList(key, value)};
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

#pragma once

#include <initializer_list>
#include <memory>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion api/include/opentelemetry/context/runtime_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class RuntimeContext
}
};

inline Token::~Token()
inline Token::~Token() noexcept
{
context::RuntimeContext::Detach(*this);
}
Expand Down
4 changes: 2 additions & 2 deletions api/include/opentelemetry/trace/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace trace
{

// Get Span from explicit context
inline nostd::shared_ptr<Span> GetSpan(const opentelemetry::context::Context &context)
inline nostd::shared_ptr<Span> GetSpan(const opentelemetry::context::Context &context) noexcept
{
context::ContextValue span = context.GetValue(kSpanKey);
if (nostd::holds_alternative<nostd::shared_ptr<Span>>(span))
Expand All @@ -24,7 +24,7 @@ inline nostd::shared_ptr<Span> GetSpan(const opentelemetry::context::Context &co

// Set Span into explicit context
inline context::Context SetSpan(opentelemetry::context::Context &context,
nostd::shared_ptr<Span> span)
nostd::shared_ptr<Span> span) noexcept
{
return context.SetValue(kSpanKey, span);
}
Expand Down
8 changes: 4 additions & 4 deletions api/include/opentelemetry/trace/default_span.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ class DefaultSpan : public Span

void End(const EndSpanOptions & /* options */ = {}) noexcept {}

nostd::string_view ToString() { return "DefaultSpan"; }
nostd::string_view ToString() const noexcept { return "DefaultSpan"; }

DefaultSpan(SpanContext span_context) : span_context_(span_context) {}
DefaultSpan(SpanContext span_context) noexcept : span_context_(span_context) {}

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

private:
SpanContext span_context_;
Expand Down
9 changes: 5 additions & 4 deletions api/include/opentelemetry/trace/noop.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,15 @@ class NoopTracer final : public Tracer, public std::enable_shared_from_this<Noop
class NoopTracerProvider final : public opentelemetry::trace::TracerProvider
{
public:
NoopTracerProvider()
NoopTracerProvider() noexcept
: tracer_{nostd::shared_ptr<opentelemetry::trace::NoopTracer>(
new opentelemetry::trace::NoopTracer)}
{}

nostd::shared_ptr<opentelemetry::trace::Tracer> GetTracer(nostd::string_view library_name,
nostd::string_view library_version,
nostd::string_view schema_url) override
nostd::shared_ptr<opentelemetry::trace::Tracer> GetTracer(
nostd::string_view library_name,
nostd::string_view library_version,
nostd::string_view schema_url) noexcept override
{
return tracer_;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ class HttpTraceContext : public opentelemetry::context::propagation::TextMapProp
nostd::span<char, 2>{&trace_parent[kTraceIdSize + kSpanIdSize + 5], 2});

carrier.Set(kTraceParent, nostd::string_view(trace_parent, sizeof(trace_parent)));
carrier.Set(kTraceState, span_context.trace_state()->ToHeader());
const auto trace_state = span_context.trace_state()->ToHeader();
if (!trace_state.empty())
{
carrier.Set(kTraceState, trace_state);
}
}

static SpanContext ExtractContextFromTraceHeaders(nostd::string_view trace_parent,
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 @@ -26,7 +26,7 @@ class SpanContext final
* sampled
* @param is_remote true if this context was propagated from a remote parent.
*/
SpanContext(bool sampled_flag, bool is_remote)
SpanContext(bool sampled_flag, bool is_remote) noexcept
: trace_id_(),
span_id_(),
trace_flags_(opentelemetry::trace::TraceFlags((uint8_t)sampled_flag)),
Expand Down
Loading