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

Optimize OtlpHttpExporter to support timeout and cancle #853

Merged
merged 2 commits into from
Jun 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
// We need include exporter.h first, which will include Windows.h with NOMINMAX on Windows
#include "opentelemetry/sdk/trace/exporter.h"

#include "opentelemetry/ext/http/client/http_client.h"

#include <chrono>
#include <memory>
#include <mutex>
#include <string>
Expand Down Expand Up @@ -65,6 +68,7 @@ struct OtlpHttpExporterOptions

// TODO: Enable/disable to verify SSL certificate
// TODO: Reuqest timeout
Copy link
Contributor

Choose a reason for hiding this comment

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

This TODO could be removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. This PR is already merged, maybe it can be remove in another PR later.

Copy link
Member

Choose a reason for hiding this comment

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

sorry if I merged it a bit earlier. There is a task to remove/handle invalid TODOs from the code base, this can be handled through that if not done before.

std::chrono::milliseconds timeout = std::chrono::milliseconds(30000);
};

/**
Expand Down Expand Up @@ -113,6 +117,11 @@ class OtlpHttpExporter final : public opentelemetry::sdk::trace::SpanExporter

// The configuration options associated with this exporter.
const OtlpHttpExporterOptions options_;

// Object that stores the HTTP sessions that have been created
std::shared_ptr<ext::http::client::HttpClient> http_client_;
// Cached parsed URI
std::string http_uri_;
};
} // namespace otlp
} // namespace exporter
Expand Down
Loading