-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Description
Hi. I'm trying to run the compiled-in example on a local Windows machine. I am getting an unhandled exception on line 91 file tracer_options.cpp (see attached image and code below). Please advise.
Here is my code:
#include <datadog/opentracing.h>
#include <datadog/tags.h>
#include <iostream>
#include <string>
int main()
{
datadog::opentracing::TracerOptions tracer_options{ "localhost", 8126, "compiled-in example" };
auto tracer = datadog::opentracing::makeTracer(tracer_options); <=== this line leads to exception
// Create some spans.
{
auto span_a = tracer->StartSpan("A");
span_a->SetTag(datadog::tags::environment, "production");
span_a->SetTag("tag", 123);
auto span_b = tracer->StartSpan("B", { opentracing::ChildOf(&span_a->context()) });
span_b->SetTag("tag", "value");
}
tracer->Close();
std::cout << "Hello World!\n";
}
=====================================================================
ot::expected<TracerOptions, const char *> applyTracerOptionsFromEnvironment(
const TracerOptions &input) {
TracerOptions opts = input; <===== this line causes the exception
auto environment = std::getenv("DD_ENV");
if (environment != nullptr && std::strlen(environment) > 0) {
opts.environment = environment;
}
auto service = std::getenv("DD_SERVICE");
if (service != nullptr && std::strlen(service) > 0) {
opts.service = service;
}
Metadata
Metadata
Assignees
Labels
No labels