Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…etry#1456)

* install sdk config (open-telemetry#1273)

* Bump actions/cache from 2 to 3 (open-telemetry#1277)

* Add owent as an Approver (open-telemetry#1276)

* add owent as reviewer

* fix order

* Disable benchmark action failure (open-telemetry#1284)

* metrics exemplar round 1 (open-telemetry#1264)

* [Metrics SDK] - fix spelling (AggregationTemporarily to AggregationTemporality) (open-telemetry#1288)

* fix compilation error with protobuf 3.5 (open-telemetry#1289)

* Fix span SetAttribute crash (open-telemetry#1283)

* Synchronous Metric collection (Delta , Cumulative) (open-telemetry#1265)

* Rename `http_client_curl` to `opentelemetry_http_client_curl` (open-telemetry#1301)

Signed-off-by: owent <admin@owent.net>

* Don't show coverage annotation for pull requests (open-telemetry#1304)

* Implement periodic exporting metric reader (open-telemetry#1286)

* Add `async-changes` branch to pull_request of github action (open-telemetry#1309)

Signed-off-by: owent <admin@owent.net>

* Add InstrumentationInfo and Resource to the metrics data to be exported. (open-telemetry#1299)

* Excempt should be applied on issue instead of PR (open-telemetry#1316)

* Bump codecov/codecov-action from 2.1.0 to 3 (open-telemetry#1318)

* Move public definitions into `opentelemetry_api`. (open-telemetry#1314)

Signed-off-by: owent <admin@owent.net>

* Add building test without RTTI (open-telemetry#1294)

* Remove implicitly deleted default constructor (open-telemetry#1267)

Co-authored-by: Tom Tan <Tom.Tan@microsoft.com>
Co-authored-by: Lalit Kumar Bhasin <lalit_fin@yahoo.com>

* [ETW Exporter] - ETW provider handle cleanup (open-telemetry#1322)

* Bump actions/stale from 4 to 5 (open-telemetry#1323)

* ostream metrics example (open-telemetry#1312)

* Prepare v1.3.0 release (open-telemetry#1324)

* Update yield logic for ARM processor (open-telemetry#1325)

* Fix for open-telemetry#1292 (open-telemetry#1326)

* Implement Merge and Diff operation for Histogram Aggregation (open-telemetry#1303)

* fix metrics compiler warnings (open-telemetry#1328)

* Replace deprecated googletest API (open-telemetry#1327)

* Remove redundant tail / in CMake install (open-telemetry#1329)

* dependencies image as artifact (open-telemetry#1333)

Co-authored-by: Lalit Kumar Bhasin <lalit_fin@yahoo.com>

* metrics histogram example (open-telemetry#1330)

* Link `opentelemetry_ext` with `opentelemetry_api` (open-telemetry#1336)

* ostream metrics cmake (open-telemetry#1344)

* prometheus exporter (open-telemetry#1331)

* remove exporter registration to meter provider (open-telemetry#1350)

* Bump github/codeql-action from 1 to 2 (open-telemetry#1351)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add explicit type cast in baggage UrlDecode (open-telemetry#1353)

* Fix scalar delete against array (open-telemetry#1356)

* conditional include for codecvt header (open-telemetry#1355)

* Add missing include guard (open-telemetry#1357)

* Use latest TraceLoggingDynamic.h (open-telemetry#1354)

* prometheus example (open-telemetry#1332)

* Fix output time in metrics OStream exporter (open-telemetry#1346)

* Simplify SDK Configuration: Use View with default aggregation if no matching View is configured (open-telemetry#1358)

* Fix class member initialization order (open-telemetry#1360)

* codecov ignore (open-telemetry#1364)

* export opentelemetry_otlp_recordable (open-telemetry#1365)

* Disable test on prometheus-cpp which not need (open-telemetry#1363)

* Enable metric collection for Async Instruments - Delta and Cumulative  (open-telemetry#1334)

* fix baggage propagation for empty/invalid baggage context (open-telemetry#1367)

* Fix empty tracestate header propagation (open-telemetry#1373)

* Bump docker/setup-qemu-action from 1 to 2 (open-telemetry#1375)

* Add noexcept/const qualifier at missing places for Trace API. (open-telemetry#1374)

* fix noxcept

* fix etw

* Bump docker/build-push-action from 2 to 3 (open-telemetry#1377)

* Bump docker/setup-buildx-action from 1 to 2 (open-telemetry#1376)

* [Metrics SDK] Remove un-necessary files. (open-telemetry#1379)

* reuse temporal metric storage for sync storage (open-telemetry#1369)

* Prometheus exporter meters and instrument name (open-telemetry#1378)

* Fix sharing resource in batched exported spans (open-telemetry#1386)

Co-authored-by: Lalit Kumar Bhasin <lalit_fin@yahoo.com>

* fix: missing link to nlohmann_json (open-telemetry#1390)

* Getting started document using ostream exporter (open-telemetry#1394)

Co-authored-by: Reiley Yang <reyang@microsoft.com>

* Connect async storage with async instruments (open-telemetry#1388)

* get span_id from context when Logger::Log received invalid span_id  (open-telemetry#1398)

* Alpine image (open-telemetry#1382)

* Upgrade proto to v0.17.0, update log data model (open-telemetry#1383)

* Prepare v1.4.0 release (open-telemetry#1404)

* Fix vcpkg package name in doc (open-telemetry#1392)

* Document Getting Started with Prometheus and Grafana (open-telemetry#1396)

Co-authored-by: Lalit Kumar Bhasin <lalit_fin@yahoo.com>

* fix OTEL_INTERNAL_LOG_INFO (open-telemetry#1407)

* fix: WaitOnSocket select error when sockfd above FD_SETSIZE (open-telemetry#1410)

* [BUILD] fix nlohmann_json's (third party) include dir (open-telemetry#1415)

* [Metrics API/SDK] - Pass state to async callback function. (open-telemetry#1408)

* Copy string_view passed to ETW exporter in PropertyVariant (open-telemetry#1425)

* Fix ETW log exporter header inclusion (open-telemetry#1426)

* [Metrics SDK] Only record non-negative / finite / Non-NAN histogram values (open-telemetry#1427)

* validate histogram value

* handle Nan

* add changelog

* divide by 0 error on windows

* fix markdown lint

* Fix global log handle symbols when using dlopen (open-telemetry#1420)

* Add attributes/dimensions to metrics ostream exporter (open-telemetry#1400)

* Log current timestamp instead of epoch time (open-telemetry#1434)

* install sdk-config.h (open-telemetry#1419)

* Fix GettingStarted documentation for Jaeger HTTP exporter (open-telemetry#1347) (open-telemetry#1439)

* fix histogram (open-telemetry#1440)

* Upgrade nlohmann_json to 3.10.5 (open-telemetry#1438) (open-telemetry#1441)

* Fixed broken link to OpenTelemetry.io (open-telemetry#1445) (open-telemetry#1446)

* Fix variables inizialization (open-telemetry#1430)

* Remove `AsyncBatch*Processor`, implement [opentelemetry-specification#2452](open-telemetry/opentelemetry-specification#2452)

Signed-off-by: WenTao Ou <admin@owent.net>

* Remove invalid changelog

Signed-off-by: WenTao Ou <admin@owent.net>

* Fix compiling problems without `ENABLE_ASYNC_EXPORT`

Signed-off-by: WenTao Ou <admin@owent.net>

* Always return `ExportResult::kSuccess`

Signed-off-by: WenTao Ou <admin@owent.net>

Co-authored-by: Ehsan Saei <71217171+esigo@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Lalit Kumar Bhasin <lalit_fin@yahoo.com>
Co-authored-by: Tom Tan <Tom.Tan@microsoft.com>
Co-authored-by: Ben Landrum <71329856+benlandrum@users.noreply.github.com>
Co-authored-by: jmanjon <67091862+juandemanjon@users.noreply.github.com>
Co-authored-by: Zsolt Bölöny <bolony.zsolt@gmail.com>
Co-authored-by: Leo Di Donato <leodidonato@gmail.com>
Co-authored-by: Reiley Yang <reyang@microsoft.com>
Co-authored-by: Lalit Kumar Bhasin <labhas@microsoft.com>
Co-authored-by: Hamed Mansouri <hamed0381@gmail.com>
Co-authored-by: ztao <t@taozj.org>
Co-authored-by: Flier Lu <flier@users.noreply.github.com>
Co-authored-by: Marc Alff <marc.alff@free.fr>
Co-authored-by: Marc Alff <marc.alff@oracle.com>
Co-authored-by: univisionsrl <31103417+univisionsrl@users.noreply.github.com>
  • Loading branch information
17 people committed Jun 17, 2022
1 parent f357102 commit daf5091
Show file tree
Hide file tree
Showing 45 changed files with 208 additions and 1,825 deletions.
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://github.com/open-telemetry/opentelemetry-cpp/pull/1306))
* [EXPORTER] OTLP http exporter allow concurrency session ([#1209](https://github.com/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://github.com/open-telemetry/opentelemetry-cpp/pull/1317))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,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
71 changes: 24 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,29 @@ sdk::common::ExportResult ElasticsearchLogExporter::Export(
std::vector<uint8_t> body_vec(body.begin(), body.end());
request->SetBody(body_vec);

# ifdef ENABLE_ASYNC_EXPORT
// 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;
# else
// Send the request
auto handler = std::make_shared<ResponseHandler>(options_.console_debug_);
session->SendRequest(handler);
Expand Down Expand Up @@ -281,54 +304,8 @@ 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
{
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 @@ -122,6 +122,7 @@ class OtlpHttpClient
* Sync export
* @param message message to export, it should be ExportTraceServiceRequest,
* ExportMetricsServiceRequest or ExportLogsServiceRequest
* @return return the status of this operation
*/
sdk::common::ExportResult Export(const google::protobuf::Message &message) noexcept;

Expand All @@ -130,11 +131,25 @@ class OtlpHttpClient
* @param message message to export, it should be ExportTraceServiceRequest,
* ExportMetricsServiceRequest or ExportLogsServiceRequest
* @param result_callback callback to call when the exporting is done
* @return return the status of this operation
*/
void Export(
sdk::common::ExportResult Export(
const google::protobuf::Message &message,
std::function<bool(opentelemetry::sdk::common::ExportResult)> &&result_callback) noexcept;

/**
* Async export
* @param message message to export, it should be ExportTraceServiceRequest,
* ExportMetricsServiceRequest or ExportLogsServiceRequest
* @param result_callback callback to call when the exporting is done
* @param max_running_requests wait for at most max_running_requests running requests
* @return return the status of this operation
*/
sdk::common::ExportResult Export(
const google::protobuf::Message &message,
std::function<bool(opentelemetry::sdk::common::ExportResult)> &&result_callback,
std::size_t max_running_requests) noexcept;

/**
* Shut down the HTTP client.
* @param timeout an optional timeout, the default timeout of 0 means that no
Expand All @@ -150,6 +165,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
12 changes: 0 additions & 12 deletions exporters/otlp/src/otlp_grpc_log_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -161,18 +161,6 @@ opentelemetry::sdk::common::ExportResult OtlpGrpcLogExporter::Export(
return sdk::common::ExportResult::kSuccess;
}

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

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

0 comments on commit daf5091

Please sign in to comment.