This repository has been archived by the owner on Aug 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update README regarding Thrift, begin example application Signed-off-by: Isaac Hier <[email protected]> * Fix dynamic load test Signed-off-by: Isaac Hier <[email protected]> * Fix configs and example Signed-off-by: Isaac Hier <[email protected]> * Close tracer just in case Signed-off-by: Isaac Hier <[email protected]> * Update README regarding Thrift, begin example application Signed-off-by: Isaac Hier <[email protected]> * Fix configs and example Signed-off-by: Isaac Hier <[email protected]> * Close tracer just in case Signed-off-by: Isaac Hier <[email protected]> * Remove broken test case Signed-off-by: Isaac Hier <[email protected]>
- Loading branch information
Showing
10 changed files
with
68 additions
and
39 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
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,45 @@ | ||
#include <iostream> | ||
|
||
#include <yaml-cpp/yaml.h> | ||
|
||
#include <jaegertracing/Tracer.h> | ||
|
||
namespace { | ||
|
||
void setUpTracer(const char* configFilePath) | ||
{ | ||
auto configYAML = YAML::LoadFile(configFilePath); | ||
auto config = jaegertracing::Config::parse(configYAML); | ||
auto tracer = jaegertracing::Tracer::make( | ||
"example-service", config, jaegertracing::logging::consoleLogger()); | ||
opentracing::Tracer::InitGlobal( | ||
std::static_pointer_cast<opentracing::Tracer>(tracer)); | ||
} | ||
|
||
void tracedSubroutine(const std::unique_ptr<opentracing::Span>& parentSpan) | ||
{ | ||
auto span = opentracing::Tracer::Global()->StartSpan( | ||
"tracedSubroutine", { opentracing::ChildOf(&parentSpan->context()) }); | ||
} | ||
|
||
void tracedFunction() | ||
{ | ||
auto span = opentracing::Tracer::Global()->StartSpan("tracedFunction"); | ||
tracedSubroutine(span); | ||
} | ||
|
||
} // anonymous namespace | ||
|
||
int main(int argc, char* argv[]) | ||
{ | ||
if (argc < 2) { | ||
std::cerr << "usage: " << argv[0] << " <config-yaml-path>\n"; | ||
return 1; | ||
} | ||
setUpTracer(argv[1]); | ||
tracedFunction(); | ||
// Not stricly necessary to close tracer, but might flush any buffered | ||
// spans. See more details in opentracing::Tracer::Close() documentation. | ||
opentracing::Tracer::Global()->Close(); | ||
return 0; | ||
} |
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,19 +1,6 @@ | ||
service_name: test-service | ||
disabled: false | ||
sampler: | ||
type: probabilistic | ||
param: 0.001 | ||
reporter: | ||
queueSize: 100 | ||
bufferFlushInterval: 10 | ||
logSpans: false | ||
localAgentHostPort: 127.0.0.1:6831 | ||
headers: | ||
jaegerDebugHeader: debug-id | ||
jaegerBaggageHeader: baggage | ||
TraceContextHeaderName: trace-id | ||
traceBaggageHeaderPrefix: testctx- | ||
baggage_restrictions: | ||
denyBaggageOnInitializationFailure: false | ||
hostPort: 127.0.0.1:5778 | ||
refreshInterval: 60 | ||
logSpans: true | ||
sampler: | ||
type: const | ||
param: 1 |
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
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
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