Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement https:/open-telemetry/opentelemetry-specification/pull/2452 #1456

Merged
merged 93 commits into from
Jun 17, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
e072daa
install sdk config (#1273)
esigo Mar 21, 2022
6ec1b59
Bump actions/cache from 2 to 3 (#1277)
dependabot[bot] Mar 22, 2022
b5155a5
Add owent as an Approver (#1276)
lalitb Mar 23, 2022
0c9aece
Disable benchmark action failure (#1284)
esigo Mar 24, 2022
3c7b44b
metrics exemplar round 1 (#1264)
esigo Mar 24, 2022
2c9ce39
[Metrics SDK] - fix spelling (AggregationTemporarily to AggregationTe…
lalitb Mar 24, 2022
91b0572
fix compilation error with protobuf 3.5 (#1289)
esigo Mar 25, 2022
c1b9590
Fix span SetAttribute crash (#1283)
esigo Mar 26, 2022
a7e814a
Synchronous Metric collection (Delta , Cumulative) (#1265)
lalitb Mar 30, 2022
76c664a
Rename `http_client_curl` to `opentelemetry_http_client_curl` (#1301)
owent Mar 31, 2022
2034c9b
Don't show coverage annotation for pull requests (#1304)
ThomsonTan Apr 1, 2022
33d9c62
Implement periodic exporting metric reader (#1286)
lalitb Apr 1, 2022
48a4060
Add `async-changes` branch to pull_request of github action (#1309)
owent Apr 4, 2022
be75bbc
Add InstrumentationInfo and Resource to the metrics data to be export…
lalitb Apr 4, 2022
237a0b2
Excempt should be applied on issue instead of PR (#1316)
ThomsonTan Apr 5, 2022
fd338cc
Bump codecov/codecov-action from 2.1.0 to 3 (#1318)
dependabot[bot] Apr 6, 2022
74ec691
Move public definitions into `opentelemetry_api`. (#1314)
owent Apr 7, 2022
6b87300
Add building test without RTTI (#1294)
owent Apr 7, 2022
3122254
Remove implicitly deleted default constructor (#1267)
benlandrum Apr 7, 2022
d72dcb6
[ETW Exporter] - ETW provider handle cleanup (#1322)
lalitb Apr 11, 2022
e200c1f
Bump actions/stale from 4 to 5 (#1323)
dependabot[bot] Apr 11, 2022
755f109
ostream metrics example (#1312)
esigo Apr 12, 2022
da2911c
Prepare v1.3.0 release (#1324)
ThomsonTan Apr 12, 2022
75c2a8f
Update yield logic for ARM processor (#1325)
lalitb Apr 12, 2022
e7f051e
Fix for #1292 (#1326)
juandemanjon Apr 14, 2022
29d68f1
Implement Merge and Diff operation for Histogram Aggregation (#1303)
lalitb Apr 14, 2022
e3304d7
fix metrics compiler warnings (#1328)
esigo Apr 15, 2022
defdfd2
Replace deprecated googletest API (#1327)
ThomsonTan Apr 15, 2022
2e9b7a1
Remove redundant tail / in CMake install (#1329)
ThomsonTan Apr 16, 2022
1d2cd42
dependencies image as artifact (#1333)
esigo Apr 18, 2022
b33dd09
metrics histogram example (#1330)
esigo Apr 18, 2022
7fde3bc
Link `opentelemetry_ext` with `opentelemetry_api` (#1336)
owent Apr 21, 2022
bf8f433
ostream metrics cmake (#1344)
esigo Apr 21, 2022
e6fb935
prometheus exporter (#1331)
esigo Apr 25, 2022
0c74e0b
remove exporter registration to meter provider (#1350)
lalitb Apr 25, 2022
33cb827
Bump github/codeql-action from 1 to 2 (#1351)
dependabot[bot] Apr 26, 2022
c917bed
Add explicit type cast in baggage UrlDecode (#1353)
ThomsonTan Apr 26, 2022
e233791
Fix scalar delete against array (#1356)
ThomsonTan Apr 27, 2022
3b9bfd4
conditional include for codecvt header (#1355)
lalitb Apr 27, 2022
72360b4
Add missing include guard (#1357)
yzsolt Apr 27, 2022
4008da5
Use latest TraceLoggingDynamic.h (#1354)
lalitb Apr 27, 2022
a4bd3b0
prometheus example (#1332)
esigo Apr 28, 2022
3a4a3a3
Fix output time in metrics OStream exporter (#1346)
ThomsonTan Apr 28, 2022
f314522
Simplify SDK Configuration: Use View with default aggregation if no m…
lalitb Apr 30, 2022
8ef6764
Fix class member initialization order (#1360)
lalitb Apr 30, 2022
c8bd431
codecov ignore (#1364)
esigo Apr 30, 2022
c1e6e16
export opentelemetry_otlp_recordable (#1365)
esigo May 2, 2022
13ac5c3
Disable test on prometheus-cpp which not need (#1363)
ThomsonTan May 2, 2022
9c734b3
Enable metric collection for Async Instruments - Delta and Cumulative…
lalitb May 3, 2022
59a48c1
fix baggage propagation for empty/invalid baggage context (#1367)
lalitb May 4, 2022
d3c4200
Fix empty tracestate header propagation (#1373)
yzsolt May 5, 2022
5458dde
Bump docker/setup-qemu-action from 1 to 2 (#1375)
dependabot[bot] May 6, 2022
99a72e1
Add noexcept/const qualifier at missing places for Trace API. (#1374)
lalitb May 6, 2022
a0d4a72
Bump docker/build-push-action from 2 to 3 (#1377)
dependabot[bot] May 6, 2022
0d27a43
Bump docker/setup-buildx-action from 1 to 2 (#1376)
dependabot[bot] May 6, 2022
02630e0
[Metrics SDK] Remove un-necessary files. (#1379)
lalitb May 7, 2022
54abc27
reuse temporal metric storage for sync storage (#1369)
lalitb May 9, 2022
95effbd
Prometheus exporter meters and instrument name (#1378)
esigo May 10, 2022
88e23ad
Fix sharing resource in batched exported spans (#1386)
ThomsonTan May 11, 2022
4b69a10
fix: missing link to nlohmann_json (#1390)
leodido May 13, 2022
3fd5ca3
Getting started document using ostream exporter (#1394)
esigo May 16, 2022
45f0235
Connect async storage with async instruments (#1388)
lalitb May 16, 2022
e11cc62
get span_id from context when Logger::Log received invalid span_id (…
hamedprog May 16, 2022
1e25d58
Alpine image (#1382)
esigo May 16, 2022
280f546
Upgrade proto to v0.17.0, update log data model (#1383)
owent May 17, 2022
09b92af
Prepare v1.4.0 release (#1404)
ThomsonTan May 18, 2022
ab084ec
Fix vcpkg package name in doc (#1392)
ThomsonTan May 18, 2022
a847d0c
Document Getting Started with Prometheus and Grafana (#1396)
esigo May 18, 2022
63803d1
fix OTEL_INTERNAL_LOG_INFO (#1407)
lalitb May 19, 2022
cd3655f
Merge branch 'merge_async-changes_into_main' into merge_main_into_asy…
owent May 20, 2022
0ef9446
fix: WaitOnSocket select error when sockfd above FD_SETSIZE (#1410)
May 21, 2022
5c8f476
[BUILD] fix nlohmann_json's (third party) include dir (#1415)
leodido May 24, 2022
0abf162
Merge remote-tracking branch 'opentelemetry/main' into merge_main_int…
owent May 25, 2022
9df5c4f
[Metrics API/SDK] - Pass state to async callback function. (#1408)
lalitb May 31, 2022
93ef013
Copy string_view passed to ETW exporter in PropertyVariant (#1425)
ThomsonTan Jun 2, 2022
81df64b
Fix ETW log exporter header inclusion (#1426)
lalitb Jun 2, 2022
62b65fa
[Metrics SDK] Only record non-negative / finite / Non-NAN histogram v…
lalitb Jun 3, 2022
7e90dae
Fix global log handle symbols when using dlopen (#1420)
owent Jun 4, 2022
c484d16
Merge remote-tracking branch 'opentelemetry/main' into async-changes
owent Jun 7, 2022
18991a6
Add attributes/dimensions to metrics ostream exporter (#1400)
lalitb Jun 7, 2022
473c931
Log current timestamp instead of epoch time (#1434)
ThomsonTan Jun 7, 2022
4c657a1
install sdk-config.h (#1419)
flier Jun 9, 2022
6ee70a7
Fix GettingStarted documentation for Jaeger HTTP exporter (#1347) (#1…
marcalff Jun 10, 2022
423a1a2
fix histogram (#1440)
lalitb Jun 10, 2022
33567b9
Upgrade nlohmann_json to 3.10.5 (#1438) (#1441)
marcalff Jun 10, 2022
2f0a3d6
Fixed broken link to OpenTelemetry.io (#1445) (#1446)
marcalff Jun 11, 2022
5ce608c
Merge remote-tracking branch 'opentelemetry/main' into merge_main_int…
owent Jun 15, 2022
2d78a56
Fix variables inizialization (#1430)
univisionsrl Jun 15, 2022
b4d47e1
Merge remote-tracking branch 'opentelemetry/main' into merge_main_int…
owent Jun 16, 2022
b75089a
Remove `AsyncBatch*Processor`, implement [opentelemetry-specification…
owent Jun 16, 2022
a4ec016
Remove invalid changelog
owent Jun 16, 2022
fe77084
Fix compiling problems without `ENABLE_ASYNC_EXPORT`
owent Jun 16, 2022
31dfd5a
Always return `ExportResult::kSuccess`
owent Jun 17, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Increment the:

## [Unreleased]

* [SDK] Async Batch Span/Log processor with max async support ([#1306](https:/open-telemetry/opentelemetry-cpp/pull/1306))
* [EXPORTER] OTLP http exporter allow concurrency session ([#1209](https:/open-telemetry/opentelemetry-cpp/pull/1209))
* [EXT] `curl::HttpClient` use `curl_multi_handle` instead of creating a thread
for every request and it's able to reuse connections now. ([#1317](https:/open-telemetry/opentelemetry-cpp/pull/1317))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ struct ElasticsearchExporterOptions
// Whether to print the status of the exporter in the console
bool console_debug_;

# ifdef ENABLE_ASYNC_EXPORT
bool asynchronous_mode_ = false;
# endif

/**
* Constructor for the ElasticsearchExporterOptions. By default, the endpoint is
* localhost:9200/logs with a timeout of 30 seconds and disabled console debugging
Expand All @@ -49,12 +53,19 @@ struct ElasticsearchExporterOptions
int port = 9200,
std::string index = "logs",
int response_timeout = 30,
bool console_debug = false)
: host_{host},
port_{port},
index_{index},
response_timeout_{response_timeout},
console_debug_{console_debug}
bool console_debug = false
# ifdef ENABLE_ASYNC_EXPORT
,
bool asynchronous_mode = false
# endif
)
: host_{host}, port_{port}, index_{index}, response_timeout_{response_timeout}, console_debug_
{
console_debug
}
# ifdef ENABLE_ASYNC_EXPORT
, asynchronous_mode_ { asynchronous_mode }
# endif
Copy link
Member

@lalitb lalitb Jun 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought - Is it necessary to keep the sync mode, or can we have async as default and only option? And ExportResult would always mean that exporter has received the event batch and uploading them. Upload may fail, in which case exporter will retry and eventually log the error.

Copy link
Member Author

@owent owent Jun 17, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OTLP may also need always return ExportResult::kSuccess and ignore the result of HTTP client.

{}
};

Expand Down Expand Up @@ -89,19 +100,6 @@ class ElasticsearchLogExporter final : public opentelemetry::sdk::logs::LogExpor
const opentelemetry::nostd::span<std::unique_ptr<opentelemetry::sdk::logs::Recordable>>
&records) noexcept override;

# ifdef ENABLE_ASYNC_EXPORT
/**
* Exports a vector of log records to the Elasticsearch instance asynchronously.
* @param records A list of log records to send to Elasticsearch.
* @param result_callback callback function accepting ExportResult as argument
*/
void Export(
const opentelemetry::nostd::span<std::unique_ptr<opentelemetry::sdk::logs::Recordable>>
&records,
std::function<bool(opentelemetry::sdk::common::ExportResult)> &&result_callback) noexcept
override;
# endif

/**
* Shutdown this exporter.
* @param timeout The maximum time to wait for the shutdown method to return
Expand Down
73 changes: 26 additions & 47 deletions exporters/elasticsearch/src/es_log_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,32 @@ sdk::common::ExportResult ElasticsearchLogExporter::Export(
std::vector<uint8_t> body_vec(body.begin(), body.end());
request->SetBody(body_vec);

# ifdef ENABLE_ASYNC_EXPORT
if (options_.asynchronous_mode_)
{
// Send the request
std::size_t span_count = records.size();
auto handler = std::make_shared<AsyncResponseHandler>(
session,
[span_count](opentelemetry::sdk::common::ExportResult result) {
if (result != opentelemetry::sdk::common::ExportResult::kSuccess)
{
OTEL_INTERNAL_LOG_ERROR("[ES Trace Exporter] ERROR: Export "
<< span_count
<< " trace span(s) error: " << static_cast<int>(result));
}
else
{
OTEL_INTERNAL_LOG_DEBUG("[ES Trace Exporter] DEBUG: Export "
<< span_count << " trace span(s) success");
}
return true;
},
options_.console_debug_);
session->SendRequest(handler);
return sdk::common::ExportResult::kSuccess;
}
# endif
// Send the request
auto handler = std::make_shared<ResponseHandler>(options_.console_debug_);
session->SendRequest(handler);
Expand Down Expand Up @@ -283,53 +309,6 @@ sdk::common::ExportResult ElasticsearchLogExporter::Export(
return sdk::common::ExportResult::kSuccess;
}

# ifdef ENABLE_ASYNC_EXPORT
void ElasticsearchLogExporter::Export(
const opentelemetry::nostd::span<std::unique_ptr<opentelemetry::sdk::logs::Recordable>>
&records,
std::function<bool(opentelemetry::sdk::common::ExportResult)> &&result_callback) noexcept
{
// Return failure if this exporter has been shutdown
if (isShutdown())
{
OTEL_INTERNAL_LOG_ERROR("[ES Log Exporter] Exporting "
<< records.size() << " log(s) failed, exporter is shutdown");
return;
}

// Create a connection to the ElasticSearch instance
auto session = http_client_->CreateSession(options_.host_ + std::to_string(options_.port_));
auto request = session->CreateRequest();

// Populate the request with headers and methods
request->SetUri(options_.index_ + "/_bulk?pretty");
request->SetMethod(http_client::Method::Post);
request->AddHeader("Content-Type", "application/json");
request->SetTimeoutMs(std::chrono::milliseconds(1000 * options_.response_timeout_));

// Create the request body
std::string body = "";
for (auto &record : records)
{
// Append {"index":{}} before JSON body, which tells Elasticsearch to write to index specified
// in URI
body += "{\"index\" : {}}\n";

// Add the context of the Recordable
auto json_record = std::unique_ptr<ElasticSearchRecordable>(
static_cast<ElasticSearchRecordable *>(record.release()));
body += json_record->GetJSON().dump() + "\n";
}
std::vector<uint8_t> body_vec(body.begin(), body.end());
request->SetBody(body_vec);

// Send the request
auto handler = std::make_shared<AsyncResponseHandler>(session, std::move(result_callback),
options_.console_debug_);
session->SendRequest(handler);
}
# endif

bool ElasticsearchLogExporter::Shutdown(std::chrono::microseconds timeout) noexcept
{
const std::lock_guard<opentelemetry::common::SpinLockMutex> locked(lock_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,6 @@ class JaegerExporter final : public opentelemetry::sdk::trace::SpanExporter
const nostd::span<std::unique_ptr<opentelemetry::sdk::trace::Recordable>> &spans) noexcept
override;

#ifdef ENABLE_ASYNC_EXPORT
/**
* Exports a batch of span recordables asynchronously.
* @param spans a span of unique pointers to span recordables
* @param result_callback callback function accepting ExportResult as argument
*/
void Export(const nostd::span<std::unique_ptr<opentelemetry::sdk::trace::Recordable>> &spans,
std::function<bool(opentelemetry::sdk::common::ExportResult)>
&&result_callback) noexcept override;
#endif

/**
* Shutdown the exporter.
* @param timeout an option timeout, default to max.
Expand Down
11 changes: 0 additions & 11 deletions exporters/jaeger/src/jaeger_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,6 @@ sdk_common::ExportResult JaegerExporter::Export(
return sdk_common::ExportResult::kSuccess;
}

#ifdef ENABLE_ASYNC_EXPORT
void JaegerExporter::Export(
const nostd::span<std::unique_ptr<sdk::trace::Recordable>> &spans,
std::function<bool(opentelemetry::sdk::common::ExportResult)> &&result_callback) noexcept
{
OTEL_INTERNAL_LOG_WARN(" async not supported. Making sync interface call");
auto status = Export(spans);
result_callback(status);
}
#endif

void JaegerExporter::InitializeEndpoint()
{
if (options_.transport_format == TransportFormat::kThriftUdpCompact)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,6 @@ class InMemorySpanExporter final : public opentelemetry::sdk::trace::SpanExporte
return sdk::common::ExportResult::kSuccess;
}

#ifdef ENABLE_ASYNC_EXPORT
/**
* Exports a batch of span recordables asynchronously.
* @param spans a span of unique pointers to span recordables
* @param result_callback callback function accepting ExportResult as argument
*/
void Export(const nostd::span<std::unique_ptr<sdk::trace::Recordable>> &spans,
std::function<bool(opentelemetry::sdk::common::ExportResult)>
&&result_callback) noexcept override
{
OTEL_INTERNAL_LOG_WARN(" async not supported. Making sync interface call");
auto status = Export(spans);
result_callback(status);
}
#endif

/**
* @param timeout an optional value containing the timeout of the exporter
* note: passing custom timeout values is not currently supported for this exporter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,6 @@ class OStreamLogExporter final : public opentelemetry::sdk::logs::LogExporter
const opentelemetry::nostd::span<std::unique_ptr<sdk::logs::Recordable>> &records) noexcept
override;

# ifdef ENABLE_ASYNC_EXPORT
/**
* Exports a span of logs sent from the processor asynchronously.
*/
void Export(
const opentelemetry::nostd::span<std::unique_ptr<sdk::logs::Recordable>> &records,
std::function<bool(opentelemetry::sdk::common::ExportResult)> &&result_callback) noexcept;
# endif

/**
* Marks the OStream Log Exporter as shut down.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@ class OStreamSpanExporter final : public opentelemetry::sdk::trace::SpanExporter
const opentelemetry::nostd::span<std::unique_ptr<opentelemetry::sdk::trace::Recordable>>
&spans) noexcept override;

#ifdef ENABLE_ASYNC_EXPORT
void Export(
const opentelemetry::nostd::span<std::unique_ptr<opentelemetry::sdk::trace::Recordable>>
&spans,
std::function<bool(opentelemetry::sdk::common::ExportResult)> &&result_callback) noexcept
override;
#endif

bool Shutdown(
std::chrono::microseconds timeout = std::chrono::microseconds::max()) noexcept override;

Expand Down
11 changes: 0 additions & 11 deletions exporters/ostream/src/log_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,6 @@ sdk::common::ExportResult OStreamLogExporter::Export(
return sdk::common::ExportResult::kSuccess;
}

# ifdef ENABLE_ASYNC_EXPORT
void OStreamLogExporter::Export(
const opentelemetry::nostd::span<std::unique_ptr<sdk::logs::Recordable>> &records,
std::function<bool(opentelemetry::sdk::common::ExportResult)> &&result_callback) noexcept
{
// Do not have async support
auto result = Export(records);
result_callback(result);
}
# endif

bool OStreamLogExporter::Shutdown(std::chrono::microseconds) noexcept
{
const std::lock_guard<opentelemetry::common::SpinLockMutex> locked(lock_);
Expand Down
10 changes: 0 additions & 10 deletions exporters/ostream/src/span_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,6 @@ sdk::common::ExportResult OStreamSpanExporter::Export(
return sdk::common::ExportResult::kSuccess;
}

#ifdef ENABLE_ASYNC_EXPORT
void OStreamSpanExporter::Export(
const opentelemetry::nostd::span<std::unique_ptr<opentelemetry::sdk::trace::Recordable>> &spans,
std::function<bool(opentelemetry::sdk::common::ExportResult)> &&result_callback) noexcept
{
auto result = Export(spans);
result_callback(result);
}
#endif

bool OStreamSpanExporter::Shutdown(std::chrono::microseconds timeout) noexcept
{
const std::lock_guard<opentelemetry::common::SpinLockMutex> locked(lock_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,6 @@ class OtlpGrpcExporter final : public opentelemetry::sdk::trace::SpanExporter
sdk::common::ExportResult Export(
const nostd::span<std::unique_ptr<sdk::trace::Recordable>> &spans) noexcept override;

#ifdef ENABLE_ASYNC_EXPORT
/**
* Exports a batch of span recordables asynchronously.
* @param spans a span of unique pointers to span recordables
* @param result_callback callback function accepting ExportResult as argument
*/
virtual void Export(const nostd::span<std::unique_ptr<sdk::trace::Recordable>> &spans,
std::function<bool(opentelemetry::sdk::common::ExportResult)>
&&result_callback) noexcept override;
#endif

/**
* Shut down the exporter.
* @param timeout an optional timeout, the default timeout of 0 means that no
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,6 @@ class OtlpGrpcLogExporter : public opentelemetry::sdk::logs::LogExporter
const nostd::span<std::unique_ptr<opentelemetry::sdk::logs::Recordable>> &records) noexcept
override;

# ifdef ENABLE_ASYNC_EXPORT
/**
* Exports a vector of log records asynchronously.
* @param records A list of log records.
* @param result_callback callback function accepting ExportResult as argument
*/
virtual void Export(
const nostd::span<std::unique_ptr<opentelemetry::sdk::logs::Recordable>> &records,
std::function<bool(opentelemetry::sdk::common::ExportResult)> &&result_callback) noexcept
override;
# endif

/**
* Shutdown this exporter.
* @param timeout The maximum time to wait for the shutdown method to return.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ class OtlpHttpClient
*/
void ReleaseSession(const opentelemetry::ext::http::client::Session &session) noexcept;

/**
* Get options of current OTLP http client.
* @return options of current OTLP http client.
*/
inline const OtlpHttpClientOptions &GetOptions() const noexcept { return options_; }

private:
struct HttpSessionData
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,6 @@ class OtlpHttpExporter final : public opentelemetry::sdk::trace::SpanExporter
const nostd::span<std::unique_ptr<opentelemetry::sdk::trace::Recordable>> &spans) noexcept
override;

#ifdef ENABLE_ASYNC_EXPORT
/**
* Exports a batch of span recordables asynchronously.
* @param spans a span of unique pointers to span recordables
* @param result_callback callback function accepting ExportResult as argument
*/
virtual void Export(
const nostd::span<std::unique_ptr<opentelemetry::sdk::trace::Recordable>> &spans,
std::function<bool(opentelemetry::sdk::common::ExportResult)> &&result_callback) noexcept
override;
#endif

/**
* Shut down the exporter.
* @param timeout an optional timeout, the default timeout of 0 means that no
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,6 @@ class OtlpHttpLogExporter final : public opentelemetry::sdk::logs::LogExporter
const nostd::span<std::unique_ptr<opentelemetry::sdk::logs::Recordable>> &records) noexcept
override;

# ifdef ENABLE_ASYNC_EXPORT
/**
* Exports a vector of log records asynchronously.
* @param records A list of log records.
* @param result_callback callback function accepting ExportResult as argument
*/
virtual void Export(
const nostd::span<std::unique_ptr<opentelemetry::sdk::logs::Recordable>> &records,
std::function<bool(opentelemetry::sdk::common::ExportResult)> &&result_callback) noexcept
override;
# endif

/**
* Shutdown this exporter.
* @param timeout The maximum time to wait for the shutdown method to return
Expand Down
12 changes: 0 additions & 12 deletions exporters/otlp/src/otlp_grpc_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,6 @@ sdk::common::ExportResult OtlpGrpcExporter::Export(
return sdk::common::ExportResult::kSuccess;
}

#ifdef ENABLE_ASYNC_EXPORT
void OtlpGrpcExporter::Export(
const nostd::span<std::unique_ptr<sdk::trace::Recordable>> &spans,
std::function<bool(opentelemetry::sdk::common::ExportResult)> &&result_callback) noexcept
{
OTEL_INTERNAL_LOG_WARN(
"[OTLP TRACE GRPC Exporter] async not supported. Making sync interface call");
auto status = Export(spans);
result_callback(status);
}
#endif

bool OtlpGrpcExporter::Shutdown(std::chrono::microseconds timeout) noexcept
{
const std::lock_guard<opentelemetry::common::SpinLockMutex> locked(lock_);
Expand Down
Loading