Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…try-cpp into origin/propagators

# Conflicts:
#	api/include/opentelemetry/context/context.h
#	api/include/opentelemetry/context/context_value.h
#	api/include/opentelemetry/nostd/string_view.h
#	api/include/opentelemetry/trace/span_context.h
#	api/test/trace/CMakeLists.txt
  • Loading branch information
Tianlin-Zhao committed Jul 29, 2020
1 parent f035678 commit 1139a77
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ namespace propagators
template <typename T>
class CompositeHTTPPropagator(trace::propagation::HTTPTextFormat<T>) {
public:
// Rules that manages how context will be extracted from carrier.
using Getter = nostd::string_view(*)(const T &carrier, nostd::string_view trace_type);

// Rules that manages how context will be injected to carrier.
using Setter = void(*)(T &carrier, nostd::string_view trace_type,nostd::string_view trace_description);

// Initializes a Composite Http Propagator with given propagators
CompositeHTTPPropagator(nostd::span<trace::propagation::HTTPTextFormat> &propagators) {
this.propagators_ = propagators;
Expand Down
6 changes: 3 additions & 3 deletions api/include/opentelemetry/trace/default_span.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ class DefaultSpan: public Span {
DefaultSpan(DefaultSpan&& spn) : span_context_(spn.GetContext()) {}
DefaultSpan(const DefaultSpan& spn) : span_context_(spn.GetContext()) {}

// trace::Tracer &tracer() const noexcept {
// return trace::Tracer(); // Invalid tracer
// }
trace::Tracer &tracer() const noexcept {
return trace::Tracer(); // Invalid tracer
}

// Creates an instance of this class with spancontext.
static DefaultSpan Create(SpanContext span_context) {
Expand Down
2 changes: 1 addition & 1 deletion api/include/opentelemetry/trace/span.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class Span
// AddEvent).
virtual bool IsRecording() const noexcept = 0;

// virtual trace::Tracer &tracer() const noexcept = 0;
virtual trace::Tracer &tracer() const noexcept = 0;
};
} // namespace trace
OPENTELEMETRY_END_NAMESPACE
54 changes: 27 additions & 27 deletions api/include/opentelemetry/trace/tracer.h
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
//#pragma once
//
//#include "opentelemetry/nostd/string_view.h"
//#include "opentelemetry/nostd/unique_ptr.h"
//#include "opentelemetry/trace/span.h"
//#include "opentelemetry/version.h"
//
//#include <chrono>
//
//OPENTELEMETRY_BEGIN_NAMESPACE
//namespace trace
//{
///**
// * Handles span creation and in-process context propagation.
// *
// * This class provides methods for manipulating the context, creating spans, and controlling spans'
// * lifecycles.
// */
//class Span;
//
//struct StartSpanOptions;
//
//class Tracer
//{
#pragma once

#include "opentelemetry/nostd/string_view.h"
#include "opentelemetry/nostd/unique_ptr.h"
#include "opentelemetry/trace/span.h"
#include "opentelemetry/version.h"

#include <chrono>

OPENTELEMETRY_BEGIN_NAMESPACE
namespace trace
{
/**
* Handles span creation and in-process context propagation.
*
* This class provides methods for manipulating the context, creating spans, and controlling spans'
* lifecycles.
*/
class Span;

struct StartSpanOptions;

class Tracer
{
//public:
// virtual ~Tracer() = default;
// /**
Expand Down Expand Up @@ -86,6 +86,6 @@
// }
//
// virtual void CloseWithMicroseconds(uint64_t timeout) noexcept = 0;
//};
//} // namespace trace
//OPENTELEMETRY_END_NAMESPACE
};
} // namespace trace
OPENTELEMETRY_END_NAMESPACE

0 comments on commit 1139a77

Please sign in to comment.