Skip to content

Commit

Permalink
etw exporter headers added
Browse files Browse the repository at this point in the history
  • Loading branch information
mishal23 committed Oct 26, 2020
1 parent e2cda38 commit 78ccc23
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 122 deletions.
16 changes: 16 additions & 0 deletions api/include/opentelemetry/common/key_value_iterable.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,21 @@ class KeyValueIterable
*/
virtual size_t size() const noexcept = 0;
};

//
// NULL object pattern empty iterable.
//
class NullKeyValueIterable : public KeyValueIterable
{
public:
NullKeyValueIterable(){};
virtual bool ForEachKeyValue(
nostd::function_ref<bool(nostd::string_view, common::AttributeValue)>) const noexcept
{
return true;
};
virtual size_t size() const noexcept { return 0; }
};

} // namespace common
OPENTELEMETRY_END_NAMESPACE
51 changes: 0 additions & 51 deletions api/include/opentelemetry/trace/key_value_iterable.h

This file was deleted.

65 changes: 0 additions & 65 deletions api/include/opentelemetry/trace/key_value_iterable_view.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <opentelemetry/nostd/string_view.h>
#include <opentelemetry/nostd/unique_ptr.h>

#include <opentelemetry/trace/key_value_iterable_view.h>
#include <opentelemetry/common/key_value_iterable_view.h>
#include <opentelemetry/trace/span.h>
#include <opentelemetry/trace/span_id.h>
#include <opentelemetry/trace/trace_id.h>
Expand Down Expand Up @@ -115,7 +115,7 @@ class Tracer : public trace::Tracer
/// <returns>Span</returns>
virtual nostd::shared_ptr<trace::Span> StartSpan(
nostd::string_view name,
const trace::KeyValueIterable &attributes,
const common::KeyValueIterable &attributes,
const trace::StartSpanOptions &options = {}) noexcept override
{
// TODO: support attributes
Expand Down Expand Up @@ -151,7 +151,7 @@ class Tracer : public trace::Tracer
void AddEvent(Span &span,
nostd::string_view name,
core::SystemTimestamp timestamp,
const trace::KeyValueIterable &attributes) noexcept
const common::KeyValueIterable &attributes) noexcept
{
// TODO: associate events with span
(void)span;
Expand Down Expand Up @@ -192,7 +192,7 @@ class Tracer : public trace::Tracer
/// <returns></returns>
void AddEvent(Span &span, nostd::string_view name, core::SystemTimestamp timestamp) noexcept
{
AddEvent(span, name, timestamp, trace::NullKeyValueIterable());
AddEvent(span, name, timestamp, common::NullKeyValueIterable());
};

/// <summary>
Expand All @@ -202,7 +202,7 @@ class Tracer : public trace::Tracer
/// <param name="name"></param>
void AddEvent(Span &span, nostd::string_view name)
{
AddEvent(span, name, std::chrono::system_clock::now(), trace::NullKeyValueIterable());
AddEvent(span, name, std::chrono::system_clock::now(), common::NullKeyValueIterable());
};

virtual ~Tracer() { CloseWithMicroseconds(0); };
Expand Down Expand Up @@ -264,7 +264,7 @@ class Span : public trace::Span
/// <returns></returns>
void AddEvent(nostd::string_view name,
core::SystemTimestamp timestamp,
const trace::KeyValueIterable &attributes) noexcept override
const common::KeyValueIterable &attributes) noexcept override
{
owner.AddEvent(*this, name, timestamp, attributes);
}
Expand Down

0 comments on commit 78ccc23

Please sign in to comment.