-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #262139 from jfroche/feat/add-opentelemtry-cpp
opentelemetry-cpp: init at 1.13.0
- Loading branch information
Showing
3 changed files
with
174 additions
and
0 deletions.
There are no files selected for viewing
79 changes: 79 additions & 0 deletions
79
pkgs/by-name/op/opentelemetry-cpp/0001-Disable-tests-requiring-network-access.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
diff --git a/ext/test/http/curl_http_test.cc b/ext/test/http/curl_http_test.cc | ||
index 7c66d98b..62d40f49 100644 | ||
--- a/ext/test/http/curl_http_test.cc | ||
+++ b/ext/test/http/curl_http_test.cc | ||
@@ -229,7 +229,7 @@ TEST_F(BasicCurlHttpTests, HttpResponse) | ||
ASSERT_EQ(count, 4); | ||
} | ||
|
||
-TEST_F(BasicCurlHttpTests, SendGetRequest) | ||
+TEST_F(BasicCurlHttpTests, DISABLED_SendGetRequest) | ||
{ | ||
received_requests_.clear(); | ||
auto session_manager = http_client::HttpClientFactory::Create(); | ||
@@ -246,7 +246,7 @@ TEST_F(BasicCurlHttpTests, SendGetRequest) | ||
ASSERT_TRUE(handler->got_response_); | ||
} | ||
|
||
-TEST_F(BasicCurlHttpTests, SendPostRequest) | ||
+TEST_F(BasicCurlHttpTests, DISABLED_SendPostRequest) | ||
{ | ||
received_requests_.clear(); | ||
auto session_manager = http_client::HttpClientFactory::Create(); | ||
@@ -325,7 +325,7 @@ TEST_F(BasicCurlHttpTests, CurlHttpOperations) | ||
delete handler; | ||
} | ||
|
||
-TEST_F(BasicCurlHttpTests, SendGetRequestSync) | ||
+TEST_F(BasicCurlHttpTests, DISABLED_SendGetRequestSync) | ||
{ | ||
received_requests_.clear(); | ||
curl::HttpClientSync http_client; | ||
@@ -336,7 +336,7 @@ TEST_F(BasicCurlHttpTests, SendGetRequestSync) | ||
EXPECT_EQ(result.GetSessionState(), http_client::SessionState::Response); | ||
} | ||
|
||
-TEST_F(BasicCurlHttpTests, SendGetRequestSyncTimeout) | ||
+TEST_F(BasicCurlHttpTests, DISABLED_SendGetRequestSyncTimeout) | ||
{ | ||
received_requests_.clear(); | ||
curl::HttpClientSync http_client; | ||
@@ -350,7 +350,7 @@ TEST_F(BasicCurlHttpTests, SendGetRequestSyncTimeout) | ||
result.GetSessionState() == http_client::SessionState::SendFailed); | ||
} | ||
|
||
-TEST_F(BasicCurlHttpTests, SendPostRequestSync) | ||
+TEST_F(BasicCurlHttpTests, DISABLED_SendPostRequestSync) | ||
{ | ||
received_requests_.clear(); | ||
curl::HttpClientSync http_client; | ||
@@ -378,7 +378,7 @@ TEST_F(BasicCurlHttpTests, GetBaseUri) | ||
"http://127.0.0.1:31339/"); | ||
} | ||
|
||
-TEST_F(BasicCurlHttpTests, SendGetRequestAsync) | ||
+TEST_F(BasicCurlHttpTests, DISABLED_SendGetRequestAsync) | ||
{ | ||
curl::HttpClient http_client; | ||
|
||
@@ -452,7 +452,7 @@ TEST_F(BasicCurlHttpTests, SendGetRequestAsyncTimeout) | ||
} | ||
} | ||
|
||
-TEST_F(BasicCurlHttpTests, SendPostRequestAsync) | ||
+TEST_F(BasicCurlHttpTests, DISABLED_SendPostRequestAsync) | ||
{ | ||
curl::HttpClient http_client; | ||
|
||
@@ -491,7 +491,7 @@ TEST_F(BasicCurlHttpTests, SendPostRequestAsync) | ||
} | ||
} | ||
|
||
-TEST_F(BasicCurlHttpTests, FinishInAsyncCallback) | ||
+TEST_F(BasicCurlHttpTests, DISABLED_FinishInAsyncCallback) | ||
{ | ||
curl::HttpClient http_client; | ||
|
||
-- | ||
2.40.1 | ||
|
16 changes: 16 additions & 0 deletions
16
pkgs/by-name/op/opentelemetry-cpp/0002-Disable-segfaulting-test-on-Darwin.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
diff --git a/api/test/singleton/singleton_test.cc b/api/test/singleton/singleton_test.cc | ||
index 187e26f..ddbe29f 100644 | ||
--- a/api/test/singleton/singleton_test.cc | ||
+++ b/api/test/singleton/singleton_test.cc | ||
@@ -306,7 +306,7 @@ void cleanup_otel() | ||
trace_api::Provider::SetTracerProvider(provider); | ||
} | ||
|
||
-TEST(SingletonTest, Uniqueness) | ||
+TEST(SingletonTest, DISABLED_Uniqueness) | ||
{ | ||
do_something(); | ||
|
||
-- | ||
2.42.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
{ lib | ||
, stdenv | ||
, fetchFromGitHub | ||
, cmake | ||
, gtest | ||
, protobuf | ||
, curl | ||
, grpc | ||
, prometheus-cpp | ||
, nlohmann_json | ||
, nix-update-script | ||
}: | ||
|
||
let | ||
opentelemetry-proto = fetchFromGitHub { | ||
owner = "open-telemetry"; | ||
repo = "opentelemetry-proto"; | ||
rev = "v1.0.0"; | ||
hash = "sha256-1IylAZs8gElpruSX52A+ZopU8jXH/MjRE+FQV3gQ+Gk="; | ||
}; | ||
in | ||
stdenv.mkDerivation (finalAttrs: { | ||
pname = "opentelemetry-cpp"; | ||
version = "1.13.0"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "open-telemetry"; | ||
repo = "opentelemetry-cpp"; | ||
rev = "v${finalAttrs.version}"; | ||
hash = "sha256-Tf1ZnmHavnwwvRb4Tes20LMld+w/2kRo5UErT8pHf3w="; | ||
}; | ||
|
||
patches = [ | ||
./0001-Disable-tests-requiring-network-access.patch | ||
] ++ lib.optional stdenv.isDarwin ./0002-Disable-segfaulting-test-on-Darwin.patch; | ||
|
||
nativeBuildInputs = [ cmake ]; | ||
|
||
buildInputs = [ | ||
curl | ||
grpc | ||
nlohmann_json | ||
prometheus-cpp | ||
protobuf | ||
]; | ||
|
||
doCheck = true; | ||
|
||
checkInputs = [ | ||
gtest | ||
]; | ||
|
||
strictDeps = true; | ||
|
||
cmakeFlags = [ | ||
"-DBUILD_SHARED_LIBS=ON" | ||
"-DWITH_OTLP_HTTP=ON" | ||
"-DWITH_OTLP_GRPC=ON" | ||
"-DWITH_ABSEIL=ON" | ||
"-DWITH_PROMETHEUS=ON" | ||
"-DWITH_ELASTICSEARCH=ON" | ||
"-DWITH_ZIPKIN=ON" | ||
"-DWITH_BENCHMARK=OFF" | ||
"-DOTELCPP_PROTO_PATH=${opentelemetry-proto}" | ||
]; | ||
|
||
outputs = [ "out" "dev" ]; | ||
|
||
passthru.updateScript = nix-update-script { }; | ||
|
||
meta = { | ||
description = "The OpenTelemetry C++ Client Library"; | ||
homepage = "https://github.com/open-telemetry/opentelemetry-cpp"; | ||
license = [ lib.licenses.asl20 ]; | ||
maintainers = with lib.maintainers; [ jfroche ]; | ||
# https://github.com/protocolbuffers/protobuf/issues/14492 | ||
broken = !(stdenv.buildPlatform.canExecute stdenv.hostPlatform); | ||
}; | ||
}) |