Skip to content

Commit 24dbbcd

Browse files
committed
deps: update opentelemetry-cpp to 1.18.0
PR-URL: #241 Reviewed-By: Juan José Arboleda <[email protected]> PR-URL: #246 Reviewed-By: Rafael Gonzaga <[email protected]>
1 parent 7c51bd9 commit 24dbbcd

File tree

206 files changed

+16890
-1555
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+16890
-1555
lines changed

deps/opentelemetry-cpp/.bazelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
# Enable automatic configs based on platform
88
common --enable_platform_specific_config
99

10+
# Make globs that don't match anything fail
11+
common --incompatible_disallow_empty_glob
12+
1013
# Needed by gRPC to build on some platforms.
1114
build --copt -DGRPC_BAZEL_BUILD
1215

deps/opentelemetry-cpp/api/include/opentelemetry/common/spin_lock_mutex.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,10 @@ class SpinLockMutex
6868
# else
6969
__builtin_ia32_pause();
7070
# endif
71-
#elif defined(__arm__)
72-
__asm__ volatile("yield" ::: "memory");
71+
#elif defined(__armel__) || defined(__ARMEL__)
72+
asm volatile("nop" ::: "memory");
73+
#elif defined(__arm__) || defined(__aarch64__) // arm big endian / arm64
74+
__asm__ __volatile__("yield" ::: "memory");
7375
#else
7476
// TODO: Issue PAGE/YIELD on other architectures.
7577
#endif

deps/opentelemetry-cpp/api/include/opentelemetry/common/string_util.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ class StringUtil
1515
public:
1616
static nostd::string_view Trim(nostd::string_view str, size_t left, size_t right) noexcept
1717
{
18-
while (left <= right && str[static_cast<std::size_t>(left)] == ' ')
18+
while (left <= right && isspace(str[left]))
1919
{
2020
left++;
2121
}
22-
while (left <= right && str[static_cast<std::size_t>(right)] == ' ')
22+
while (left <= right && isspace(str[right]))
2323
{
2424
right--;
2525
}

deps/opentelemetry-cpp/api/include/opentelemetry/logs/event_logger.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,8 @@ class EventLogger
6565
}
6666
nostd::unique_ptr<LogRecord> log_record = delegate_logger->CreateLogRecord();
6767

68-
IgnoreTraitResult(
69-
detail::LogRecordSetterTrait<typename std::decay<ArgumentType>::type>::template Set(
70-
log_record.get(), std::forward<ArgumentType>(args))...);
68+
IgnoreTraitResult(detail::LogRecordSetterTrait<typename std::decay<ArgumentType>::type>::Set(
69+
log_record.get(), std::forward<ArgumentType>(args))...);
7170

7271
EmitEvent(event_name, std::move(log_record));
7372
}

deps/opentelemetry-cpp/api/include/opentelemetry/logs/logger.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,8 @@ class Logger
7272
return;
7373
}
7474

75-
IgnoreTraitResult(
76-
detail::LogRecordSetterTrait<typename std::decay<ArgumentType>::type>::template Set(
77-
log_record.get(), std::forward<ArgumentType>(args))...);
75+
IgnoreTraitResult(detail::LogRecordSetterTrait<typename std::decay<ArgumentType>::type>::Set(
76+
log_record.get(), std::forward<ArgumentType>(args))...);
7877

7978
EmitLogRecord(std::move(log_record));
8079
}

deps/opentelemetry-cpp/api/include/opentelemetry/logs/logger_type_traits.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ struct LogRecordSetterTrait
166166
* = nullptr>
167167
inline static LogRecord *Set(LogRecord *log_record, ArgumentType &&arg) noexcept
168168
{
169-
return LogRecordSetterTrait<common::KeyValueIterable>::template Set(
170-
log_record, std::forward<ArgumentType>(arg));
169+
return LogRecordSetterTrait<common::KeyValueIterable>::Set(log_record,
170+
std::forward<ArgumentType>(arg));
171171
}
172172

173173
template <class ArgumentType,

deps/opentelemetry-cpp/api/include/opentelemetry/metrics/meter.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ class Histogram;
2121
template <typename T>
2222
class UpDownCounter;
2323

24+
template <typename T>
25+
class Gauge;
26+
2427
class ObservableInstrument;
2528

2629
/**
@@ -91,6 +94,27 @@ class Meter
9194
nostd::string_view description = "",
9295
nostd::string_view unit = "") noexcept = 0;
9396

97+
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
98+
/**
99+
* Creates a Gauge with the passed characteristics and returns a unique_ptr to that Gauge.
100+
*
101+
* @param name the name of the new Gauge.
102+
* @param description a brief description of what the Gauge is used for.
103+
* @param unit the unit of metric values following https://unitsofmeasure.org/ucum.html.
104+
* @return a unique pointer to the created Gauge.
105+
*/
106+
107+
virtual nostd::unique_ptr<Gauge<int64_t>> CreateInt64Gauge(
108+
nostd::string_view name,
109+
nostd::string_view description = "",
110+
nostd::string_view unit = "") noexcept = 0;
111+
112+
virtual nostd::unique_ptr<Gauge<double>> CreateDoubleGauge(
113+
nostd::string_view name,
114+
nostd::string_view description = "",
115+
nostd::string_view unit = "") noexcept = 0;
116+
#endif
117+
94118
/**
95119
* Creates a Asynchronous (Observable) Gauge with the passed characteristics and returns a
96120
* shared_ptr to that Observable Gauge

deps/opentelemetry-cpp/api/include/opentelemetry/metrics/noop.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,26 @@ class NoopUpDownCounter : public UpDownCounter<T>
7171
{}
7272
};
7373

74+
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
75+
template <class T>
76+
class NoopGauge : public Gauge<T>
77+
{
78+
public:
79+
NoopGauge(nostd::string_view /* name */,
80+
nostd::string_view /* description */,
81+
nostd::string_view /* unit */) noexcept
82+
{}
83+
~NoopGauge() override = default;
84+
void Record(T /* value */) noexcept override {}
85+
void Record(T /* value */, const context::Context & /* context */) noexcept override {}
86+
void Record(T /* value */, const common::KeyValueIterable & /* attributes */) noexcept override {}
87+
void Record(T /* value */,
88+
const common::KeyValueIterable & /* attributes */,
89+
const context::Context & /* context */) noexcept override
90+
{}
91+
};
92+
#endif
93+
7494
class NoopObservableInstrument : public ObservableInstrument
7595
{
7696
public:
@@ -140,6 +160,22 @@ class NoopMeter final : public Meter
140160
return nostd::unique_ptr<Histogram<double>>{new NoopHistogram<double>(name, description, unit)};
141161
}
142162

163+
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
164+
nostd::unique_ptr<Gauge<int64_t>> CreateInt64Gauge(nostd::string_view name,
165+
nostd::string_view description = "",
166+
nostd::string_view unit = "") noexcept override
167+
{
168+
return nostd::unique_ptr<Gauge<int64_t>>{new NoopGauge<int64_t>(name, description, unit)};
169+
}
170+
171+
nostd::unique_ptr<Gauge<double>> CreateDoubleGauge(nostd::string_view name,
172+
nostd::string_view description = "",
173+
nostd::string_view unit = "") noexcept override
174+
{
175+
return nostd::unique_ptr<Gauge<double>>{new NoopGauge<double>(name, description, unit)};
176+
}
177+
#endif
178+
143179
nostd::shared_ptr<ObservableInstrument> CreateInt64ObservableGauge(
144180
nostd::string_view name,
145181
nostd::string_view description = "",

deps/opentelemetry-cpp/api/include/opentelemetry/metrics/sync_instruments.h

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,5 +247,82 @@ class UpDownCounter : public SynchronousInstrument
247247
}
248248
};
249249

250+
#if OPENTELEMETRY_ABI_VERSION_NO >= 2
251+
/* A Gauge instrument that records values. */
252+
template <class T>
253+
class Gauge : public SynchronousInstrument
254+
{
255+
256+
public:
257+
/**
258+
* Record a value
259+
*
260+
* @param value The measurement value. May be positive, negative or zero.
261+
*/
262+
virtual void Record(T value) noexcept = 0;
263+
264+
/**
265+
* Record a value
266+
*
267+
* @param value The measurement value. May be positive, negative or zero.
268+
* @param context The explicit context to associate with this measurement.
269+
*/
270+
virtual void Record(T value, const context::Context &context) noexcept = 0;
271+
272+
/**
273+
* Record a value with a set of attributes.
274+
*
275+
* @param value The measurement value. May be positive, negative or zero.
276+
* @param attributes A set of attributes to associate with the value.
277+
*/
278+
279+
virtual void Record(T value, const common::KeyValueIterable &attributes) noexcept = 0;
280+
281+
/**
282+
* Record a value with a set of attributes.
283+
*
284+
* @param value The measurement value. May be positive, negative or zero.
285+
* @param attributes A set of attributes to associate with the value.
286+
* @param context The explicit context to associate with this measurement.
287+
*/
288+
virtual void Record(T value,
289+
const common::KeyValueIterable &attributes,
290+
const context::Context &context) noexcept = 0;
291+
292+
template <class U,
293+
nostd::enable_if_t<common::detail::is_key_value_iterable<U>::value> * = nullptr>
294+
void Record(T value, const U &attributes) noexcept
295+
{
296+
this->Record(value, common::KeyValueIterableView<U>{attributes});
297+
}
298+
299+
template <class U,
300+
nostd::enable_if_t<common::detail::is_key_value_iterable<U>::value> * = nullptr>
301+
void Record(T value, const U &attributes, const context::Context &context) noexcept
302+
{
303+
this->Record(value, common::KeyValueIterableView<U>{attributes}, context);
304+
}
305+
306+
void Record(T value,
307+
std::initializer_list<std::pair<nostd::string_view, common::AttributeValue>>
308+
attributes) noexcept
309+
{
310+
this->Record(value, nostd::span<const std::pair<nostd::string_view, common::AttributeValue>>{
311+
attributes.begin(), attributes.end()});
312+
}
313+
314+
void Record(
315+
T value,
316+
std::initializer_list<std::pair<nostd::string_view, common::AttributeValue>> attributes,
317+
const context::Context &context) noexcept
318+
{
319+
this->Record(value,
320+
nostd::span<const std::pair<nostd::string_view, common::AttributeValue>>{
321+
attributes.begin(), attributes.end()},
322+
context);
323+
}
324+
};
325+
#endif
326+
250327
} // namespace metrics
251328
OPENTELEMETRY_END_NAMESPACE
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Notes on Abseil Variant implementation
22

3-
This is a snapshot of Abseil Variant `absl::variant` from Abseil
4-
`v2020-03-03#8`.
3+
This is a snapshot of Abseil Variant
4+
`absl::OTABSL_OPTION_NAMESPACE_NAME::variant` from Abseil `v2020-03-03#8`.

0 commit comments

Comments
 (0)