E57E Merge branch 'implement_resource_detectors' of https://github.com/nik… · open-telemetry/opentelemetry-cpp@b84840f · GitHub
[go: up one dir, main page]

Skip to content

Commit b84840f

Browse files
Merge branch 'implement_resource_detectors' of https://github.com/nikhilbhatia08/opentelemetry-cpp into implement_resource_detectors
2 parents 00decf9 + 86cebd6 commit b84840f

File tree

8 files changed

+54
-19
lines changed

8 files changed

+54
-19
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ What did you see instead?
1717

1818
**Additional context**
1919
Add any other context about the problem here.
20+
21+
<sub>**Tip**: [React](https://github.blog/news-insights/product-news/add-reactions-to-pull-requests-issues-and-comments/) with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it. Learn more [here](https://opentelemetry.io/community/end-user/issue-participation/).</sub>

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ Which alternative solutions or features have you considered?
1717

1818
**Additional context**
1919
Add any other context about the feature request here.
20+
21+
<sub>**Tip**: [React](https://github.blog/news-insights/product-news/add-reactions-to-pull-requests-issues-and-comments/) with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it. Learn more [here](https://opentelemetry.io/community/end-user/issue-participation/).</sub>

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ jobs:
3737
run: |
3838
sudo -E ./ci/setup_ci_environment.sh
3939
- name: Initialize CodeQL
40-
uses: github/codeql-action/init@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4
40+
uses: github/codeql-action/init@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
4141
with:
4242
languages: cpp
4343
- name: Autobuild
44-
uses: github/codeql-action/autobuild@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4
44+
uses: github/codeql-action/autobuild@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
4545
- name: Perform CodeQL Analysis
46-
uses: github/codeql-action/analyze@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4
46+
uses: github/codeql-action/analyze@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5

.github/workflows/ossf-scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,6 @@ jobs:
4747
# Upload the results to GitHub's code scanning dashboard (optional).
4848
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
4949
- name: "Upload to code-scanning"
50-
uses: github/codeql-action/upload-sarif@4e828ff8d448a8a6e532957b1811f387a63867e8 # v3.29.4
50+
uses: github/codeql-action/upload-sarif@51f77329afa6477de8c49fc9c7046c15b9a4e79d # v3.29.5
5151
with:
5252
sarif_file: results.sarif

docs/dependencies.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ There are
66
- Internal dependencies as the part of code from external libraries
77
backported/copied in main repo.
88

9+
The minimum required versions of the third-party libraries that are required can
10+
be found in the [third_party_minimum](/install/cmake/third_party_minimum) file.
11+
The minimum supported versions are listed here for convenience but the
12+
authoritative source is always the linked file.
13+
914
Both these dependencies are listed here:
1015

1116
## Internal dependencies
@@ -37,8 +42,8 @@ Both these dependencies are listed here:
3742

3843
- [OTLP/HTTP+JSON](/exporters/otlp)
3944
exporter:
40-
- [protobuf](https://github.com/protocolbuffers/protobuf): Library to
41-
serialize structured data.
45+
- [protobuf](https://github.com/protocolbuffers/protobuf) (v3.21.6 or later):
46+
Library to serialize structured data.
4247
- OTLP messages are constructed as protobuf payloads.
4348
- `protoc` compiler is used to generate C++ stubs for proto files provided
4449
by `opentelemetry-proto`.
@@ -48,18 +53,19 @@ Both these dependencies are listed here:
4853
[here](https://github.com/protocolbuffers/protobuf/blob/master/LICENSE).
4954
The code generated by protoc compiler is owned by the owner of `.proto`
5055
file.
51-
- [libcurl](https://curl.se/libcurl/) : the multiprotocol file transfer
52-
library.
56+
- [libcurl](https://curl.se/libcurl/) (curl-7_81_0 or later):
57+
the multiprotocol file transfer library.
5358
- Export connects with opentelemetry collector over HTTP protocol using
5459
libcurl library
5560
- License: Inspired by `MIT/X` but not same.
5661
<https://curl.se/docs/copyright.html>
57-
- [nlohmann/json](https://github.com/nlohmann/json): JSON for Modern C++.
62+
- [nlohmann/json](https://github.com/nlohmann/json) (v3.10.5 or later):
63+
JSON for Modern C++.
5864
- protobuf serialized otlp messages are encoded in JSON format using this
5965
library.
6066
- License: `MIT License`
61-
- [zlib](https://www.zlib.net/): A Massively Spiffy Yet Delicately
62-
Unobtrusive Compression Library.
67+
- [zlib](https://www.zlib.net/) (v1.2.11 or later):
68+
A Massively Spiffy Yet Delicately Unobtrusive Compression Library.
6369
- The `http_client` utilizes zlib to compress the message body and send
6470
it in gzip format.
6571
- License: The library is licensed
@@ -68,7 +74,7 @@ Both these dependencies are listed here:
6874
- [OTLP/gRPC](/exporters/otlp)
6975
exporter:
7076
- `protobuf` OTLP messages are constructed as protobuf payloads.
71-
- [gRPC](https://github.com/grpc/grpc): An RPC library and framework
77+
- [gRPC](https://github.com/grpc/grpc) (v1.49.2 or later): An RPC library and framework
7278
- Exporter communicates with OTLP collector using gRPC transport mechanism.
7379
- License: `Apache License 2.0`
7480

@@ -84,8 +90,8 @@ Both these dependencies are listed here:
8490

8591
- [Prometheus](/exporters/prometheus)
8692
exporter:
87-
- [`prometheus-cpp`](https://github.com/jupp0r/prometheus-cpp) Prometheus
88-
Client Library for Modern C++
93+
- [`prometheus-cpp`](https://github.com/jupp0r/prometheus-cpp)
94+
(v1.1.0 or later): Prometheus Client Library for Modern C++
8995
- License: `MIT License`
9096

9197
- [ElasticSearch](/exporters/elasticsearch)
@@ -96,6 +102,6 @@ Both these dependencies are listed here:
96102
- [Opentracing](/opentracing-shim)
97103
shim:
98104
- [`opentracing-cpp`](https://github.com/opentracing/opentracing-cpp)
99-
OpenTracing API for C++
105+
(v1.6.0 or later): OpenTracing API for C++
100106
- A bridge layer implementing the OpenTracing API using the OpenTelemetry API
101107
- License: `Apache License 2.0`

ext/include/opentelemetry/ext/http/client/curl/http_operation_curl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ class HttpOperation
338338
std::promise<CURLcode> result_promise;
339339
std::future<CURLcode> result_future;
340340
};
341+
friend class HttpOperationAccessor;
341342
std::unique_ptr<AsyncData> async_data_;
342343
};
343344
} // namespace curl

ext/src/http/client/curl/http_operation_curl.cc

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,28 @@ namespace client
4747
namespace curl
4848
{
4949

50+
class HttpOperationAccessor
51+
{
52+
public:
53+
OPENTELEMETRY_SANITIZER_NO_THREAD static std::thread::id GetThreadId(
54+
const HttpOperation::AsyncData &async_data)
55+
{
56+
#if !(defined(OPENTELEMETRY_HAVE_THREAD_SANITIZER) && OPENTELEMETRY_HAVE_THREAD_SANITIZER)
57+
std::atomic_thread_fence(std::memory_order_acquire);
58+
#endif
59+
return async_data.callback_thread;
60+
}
61+
62+
OPENTELEMETRY_SANITIZER_NO_THREAD static void SetThreadId(HttpOperation::AsyncData &async_data,
63+
std::thread::id thread_id)
64+
{
65+
async_data.callback_thread = thread_id;
66+
#if !(defined(OPENTELEMETRY_HAVE_THREAD_SANITIZER) && OPENTELEMETRY_HAVE_THREAD_SANITIZER)
67+
std::atomic_thread_fence(std::memory_order_release);
68+
#endif
69+
}
70+
};
71+
5072
size_t HttpOperation::WriteMemoryCallback(void *contents, size_t size, size_t nmemb, void *userp)
5173
{
5274
HttpOperation *self = reinterpret_cast<HttpOperation *>(userp);
@@ -335,7 +357,7 @@ HttpOperation::~HttpOperation()
335357
case opentelemetry::ext::http::client::SessionState::Sending: {
336358
if (async_data_ && async_data_->result_future.valid())
337359
{
338-
if (async_data_->callback_thread != std::this_thread::get_id())
360+
if (HttpOperationAccessor::GetThreadId(*async_data_) != std::this_thread::get_id())
339361
{
340362
async_data_->result_future.wait();
341363
last_curl_result_ = async_data_->result_future.get();
@@ -360,7 +382,7 @@ void HttpOperation::Finish()
360382
if (async_data_ && async_data_->result_future.valid())
361383
{
362384
// We should not wait in callback from Cleanup()
363-
if (async_data_->callback_thread != std::this_thread::get_id())
385+
if (HttpOperationAccessor::GetThreadId(*async_data_) != std::this_thread::get_id())
364386
{
365387
async_data_->result_future.wait();
366388
last_curl_result_ = async_data_->result_future.get();
@@ -412,9 +434,9 @@ void HttpOperation::Cleanup()
412434
callback.swap(async_data_->callback);
413435
if (callback)
414436
{
415-
async_data_->callback_thread = std::this_thread::get_id();
437+
HttpOperationAccessor::SetThreadId(*async_data_, std::this_thread::get_id());
416438
callback(*this);
417-
async_data_->callback_thread = std::thread::id();
439+
HttpOperationAccessor::SetThreadId(*async_data_, std::thread::id());
418440
}
419441

420442
// Set value to promise to continue Finish()

install/cmake/third_party_minimum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
# Minimum supported version git tags of third-party dependencies
55
# Format: <dependency_name>=<release_git_tag>
66

7+
# Update docs/dependencies.md whenever the minimum version of a library is modified.
8+
79
abseil=20220623.2
810
zlib=v1.2.11
911
curl=curl-7_81_0

0 commit comments

Comments
 (0)
0