-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from lightstep/jmacd/envoy_carrier_v2
EnvoyCarrier v2
- Loading branch information
Showing
16 changed files
with
388 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ config.h | |
.dirstamp | ||
stamp-h1 | ||
tracer_test | ||
carrier_test | ||
cppclient | ||
flushproto_test | ||
*.pb.h | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
EXTRA_DIST = LICENSE lightstep-tracer-common/collector.proto | ||
EXTRA_DIST = \ | ||
LICENSE \ | ||
lightstep-tracer-common/collector.proto \ | ||
lightstep-tracer-common/lightstep_carrier.proto | ||
|
||
SUBDIRS = src test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule lightstep-tracer-common
updated
2 files
+2 −0 | collector.proto | |
+35 −0 | lightstep_carrier.proto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// -*- Mode: C++ -*- | ||
// | ||
// Note! Most LightStep client libraries support injecting/extracting | ||
// LightStepCarrier to/from a string type and handle base64 | ||
// encoding/decoding as part of the library. | ||
// | ||
// This library DOES NOT PERFORM BASE64 encoding/decoding. | ||
#ifndef __LIGHTSTEP_CARRIER_H__ | ||
#define __LIGHTSTEP_CARRIER_H__ | ||
|
||
#include "lightstep_carrier.pb.h" | ||
#include "lightstep/propagation.h" | ||
|
||
namespace lightstep { | ||
|
||
// ProtoReader reads a LightStepCarrier. | ||
class ProtoReader : public CarrierReader { | ||
public: | ||
explicit ProtoReader(const BinaryCarrier& data) : data_(data) { } | ||
|
||
private: | ||
friend class lightstep::TracerImpl; | ||
const BinaryCarrier& data_; | ||
}; | ||
|
||
// ProtoReader writes a BinaryCarrier. | ||
class ProtoWriter : public CarrierWriter { | ||
public: | ||
explicit ProtoWriter(BinaryCarrier *output) : output_(output) { } | ||
|
||
private: | ||
friend class lightstep::TracerImpl; | ||
BinaryCarrier *const output_; | ||
}; | ||
|
||
// TextProtoReader/Writer handle reading and writing the opentracing | ||
// text carrier representation. | ||
class TextProtoReader : public BasicCarrierReader { | ||
public: | ||
explicit TextProtoReader(const BinaryCarrier& data) : data_(data) { } | ||
|
||
void ForeachKey(std::function<void(const std::string& key, | ||
const std::string& value)> f) const override { | ||
for (const auto& c : data_.text_ctx()) { | ||
f(c.key(), c.value()); | ||
} | ||
} | ||
|
||
private: | ||
const BinaryCarrier& data_; | ||
}; | ||
|
||
class TextProtoWriter : public BasicCarrierWriter { | ||
public: | ||
explicit TextProtoWriter(BinaryCarrier *output) : output_(output) { } | ||
|
||
void Set(const std::string &key, const std::string &value) const override { | ||
TextCarrierPair *kv = output_->add_text_ctx(); | ||
kv->set_key(key); | ||
kv->set_value(value); | ||
} | ||
|
||
private: | ||
BinaryCarrier *const output_; | ||
}; | ||
|
||
} // namespace lightstep | ||
|
||
#endif // __LIGHTSTEP_CARRIER_H__ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.