From 12e5553426b80274405c4e44e257c4de35a18d7e Mon Sep 17 00:00:00 2001 From: Chris Stavitsky Date: Tue, 29 Mar 2022 13:45:50 -0700 Subject: [PATCH 01/11] Instrument performance (not yet working) --- Makefile | 2 +- sentry-native | 2 +- src/example.c | 32 +++++++++++++++++++++++++++++++- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 325872c..52e45f1 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ SENTRY_ORG=testorg-az -SENTRY_PROJECT=sentry-native +SENTRY_PROJECT=native VERSION ?= $(shell sentry-cli releases propose-version) CMAKE=cmake diff --git a/sentry-native b/sentry-native index 1c04660..9eecb1b 160000 --- a/sentry-native +++ b/sentry-native @@ -1 +1 @@ -Subproject commit 1c046603d9c61e1790a80ac2f8fb80c255152225 +Subproject commit 9eecb1bdf2c7762ba7babe9ea437545a1f759bdc diff --git a/src/example.c b/src/example.c index 4264700..7f4691c 100644 --- a/src/example.c +++ b/src/example.c @@ -84,6 +84,8 @@ int main(int argc, char *argv[]) // sentry_options_add_attachment(options, "application.log", "application.log"); + sentry_options_set_traces_sample_rate(options, 1.0); // Set sample rate to capture performance data + sentry_init(options); // Native Crash else do a Sentry Message @@ -99,6 +101,34 @@ int main(int argc, char *argv[]) printf("WrongArguments: run \'make run_crash\' or \'make run_message\' \n"); } - sentry_shutdown(); + // Trigger transactions + sentry_transaction_context_t *tx_ctx + = sentry_transaction_context_new("little.teapot", + "Short and stout here is my handle and here is my spout"); + + sentry_transaction_context_set_sampled(tx_ctx, 0); + + sentry_transaction_t *tx + = sentry_transaction_start(tx_ctx, sentry_value_new_null()); + + sentry_transaction_set_status( + tx, SENTRY_SPAN_STATUS_INTERNAL_ERROR); + + sentry_span_t *child + = sentry_transaction_start_child(tx, "littler.teapot", NULL); + sentry_span_t *grandchild + = sentry_span_start_child(child, "littlest.teapot", NULL); + + sentry_span_set_status(child, SENTRY_SPAN_STATUS_NOT_FOUND); + sentry_span_set_status( + grandchild, SENTRY_SPAN_STATUS_ALREADY_EXISTS); + + sentry_span_finish(grandchild); + sentry_span_finish(child); + + sentry_transaction_finish(tx); + // End instrument performance + + sentry_close(); return 0; } From dac977da5cf121da1fa4779f1d26fdbee0c07865 Mon Sep 17 00:00:00 2001 From: Chris Stavitsky Date: Tue, 29 Mar 2022 13:57:59 -0700 Subject: [PATCH 02/11] Add print statements --- src/example.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/src/example.c b/src/example.c index 7f4691c..b411153 100644 --- a/src/example.c +++ b/src/example.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "sentry.h" // /bin has crashpad binary executables @@ -84,23 +85,12 @@ int main(int argc, char *argv[]) // sentry_options_add_attachment(options, "application.log", "application.log"); + printf("CHRIS0"); sentry_options_set_traces_sample_rate(options, 1.0); // Set sample rate to capture performance data + printf("CHRIS1"); sentry_init(options); - // Native Crash else do a Sentry Message - if (argc != 2) { - printf("Usage: %s [--crash|--message]\n", argv[0]); - } else if(strcmp(argv[1], "--crash") == 0) { - printf("SentryEventType: %s\n", argv[1]); - startup(); - } else if( strcmp(argv[1], "--message") == 0 ) { - printf("SentryEventType: %s\n", argv[1]); - send_event(); - } else { - printf("WrongArguments: run \'make run_crash\' or \'make run_message\' \n"); - } - // Trigger transactions sentry_transaction_context_t *tx_ctx = sentry_transaction_context_new("little.teapot", @@ -111,6 +101,7 @@ int main(int argc, char *argv[]) sentry_transaction_t *tx = sentry_transaction_start(tx_ctx, sentry_value_new_null()); + printf("CHRIS2"); sentry_transaction_set_status( tx, SENTRY_SPAN_STATUS_INTERNAL_ERROR); @@ -118,6 +109,7 @@ int main(int argc, char *argv[]) = sentry_transaction_start_child(tx, "littler.teapot", NULL); sentry_span_t *grandchild = sentry_span_start_child(child, "littlest.teapot", NULL); + printf("CHRIS3"); sentry_span_set_status(child, SENTRY_SPAN_STATUS_NOT_FOUND); sentry_span_set_status( @@ -127,8 +119,23 @@ int main(int argc, char *argv[]) sentry_span_finish(child); sentry_transaction_finish(tx); + printf("CHRIS4"); + // End instrument performance + // Native Crash else do a Sentry Message + if (argc != 2) { + printf("Usage: %s [--crash|--message]\n", argv[0]); + } else if(strcmp(argv[1], "--crash") == 0) { + printf("SentryEventType: %s\n", argv[1]); + startup(); + } else if( strcmp(argv[1], "--message") == 0 ) { + printf("SentryEventType: %s\n", argv[1]); + send_event(); + } else { + printf("WrongArguments: run \'make run_crash\' or \'make run_message\' \n"); + } + sentry_close(); return 0; } From e5a47ce9163bedaf1f2a05e66a0efe1f964ca8f3 Mon Sep 17 00:00:00 2001 From: Chris Stavitsky Date: Tue, 29 Mar 2022 14:45:40 -0700 Subject: [PATCH 03/11] remove unused included lib --- src/example.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/example.c b/src/example.c index b411153..3cda0a5 100644 --- a/src/example.c +++ b/src/example.c @@ -1,7 +1,6 @@ #include #include #include -#include #include "sentry.h" // /bin has crashpad binary executables From 475799164d24387ae06f59bfdf3986a38f736253 Mon Sep 17 00:00:00 2001 From: Chris Stavitsky Date: Tue, 29 Mar 2022 16:15:00 -0700 Subject: [PATCH 04/11] Working transaction, woohoo --- Makefile | 10 +++---- src/example.c | 74 ++++++++++++++++++++++++++++++++++----------------- 2 files changed, 54 insertions(+), 30 deletions(-) diff --git a/Makefile b/Makefile index 52e45f1..73a2795 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ SENTRY_ORG=testorg-az -SENTRY_PROJECT=native +SENTRY_PROJECT=chris-danny-native-testing VERSION ?= $(shell sentry-cli releases propose-version) CMAKE=cmake @@ -7,7 +7,7 @@ all: bin/example .PHONY: all prereqs sentry-makefile sentry-makefile setup_release create_release associate_commits upload_debug_files run_crash run_message clean clean_db bin/example: prereqs src/example.c - $(CC) -g -o $@ -DSENTRY_RELEASE=\"$(VERSION)\" -Isentry-native/include src/example.c -Lbin -lsentry -Wl,-rpath,"@executable_path" + $(CC) -g -o $@ -DSENTRY_RELEASE=\"$(VERSION)\" -DSENTRY_PERFORMANCE_MONITORING="ON" -Isentry-native/include src/example.c -Lbin -lsentry -Wl,-rpath,"@executable_path" prereqs: bin/libsentry.dylib bin/crashpad_handler @@ -39,13 +39,13 @@ upload_debug_files: sentry-cli upload-dif --org testorg-az --project $(SENTRY_PROJECT) --wait --include-sources bin/ run_crash: - SENTRY_DSN=https://b5ceabee4e4a4cd6b21afe3bd2cbbed4@sentry.io/1720457 bin/example --crash + SENTRY_DSN=https://35a178f3e42445ada24add8bca35a226@o87286.ingest.sentry.io/6297711 bin/example --crash run_message: - SENTRY_DSN=https://b5ceabee4e4a4cd6b21afe3bd2cbbed4@sentry.io/1720457 bin/example --message + SENTRY_DSN=https://35a178f3e42445ada24add8bca35a226@o87286.ingest.sentry.io/6297711 bin/example --message run_clean: - SENTRY_DSN=https://b5ceabee4e4a4cd6b21afe3bd2cbbed4@sentry.io/1720457 bin/example + SENTRY_DSN=https://35a178f3e42445ada24add8bca35a226@o87286.ingest.sentry.io/6297711 bin/example clean: rm -rf ./bin/exampl* diff --git a/src/example.c b/src/example.c index 3cda0a5..2cfa275 100644 --- a/src/example.c +++ b/src/example.c @@ -18,7 +18,7 @@ void initialize_memory(char *mem) void startup(void) { - sentry_set_transaction("startup"); + // sentry_set_transaction("startup"); sentry_set_level(SENTRY_LEVEL_ERROR); sentry_add_breadcrumb(sentry_value_new_breadcrumb(0, "Setting user to John Doe")); @@ -38,7 +38,7 @@ void startup(void) void send_event(void) { - sentry_set_transaction("send_event"); + // sentry_set_transaction("send_event"); sentry_add_breadcrumb(sentry_value_new_breadcrumb(0, "Configuring GPU Context")); @@ -90,37 +90,61 @@ int main(int argc, char *argv[]) sentry_init(options); - // Trigger transactions - sentry_transaction_context_t *tx_ctx - = sentry_transaction_context_new("little.teapot", - "Short and stout here is my handle and here is my spout"); - - sentry_transaction_context_set_sampled(tx_ctx, 0); + // Transactions can be started by providing the name and the operation + sentry_transaction_context_t *tx_ctx = sentry_transaction_context_new( + "transaction name", + "transaction operation" + ); + sentry_transaction_t *tx = sentry_transaction_start(tx_ctx, sentry_value_new_null()); + + // Transactions can have child spans (and those spans can have child spans as well) + sentry_span_t *span = sentry_transaction_start_child( + tx, + "child operation", + "child description" + ); + printf("CHRIS2"); - sentry_transaction_t *tx - = sentry_transaction_start(tx_ctx, sentry_value_new_null()); + // ... + // (Perform the operation represented by the span/transaction) + // ... - printf("CHRIS2"); - sentry_transaction_set_status( - tx, SENTRY_SPAN_STATUS_INTERNAL_ERROR); + sentry_span_finish(span); // Mark the span as finished + sentry_transaction_finish(tx); // Mark the transaction as finished and send - sentry_span_t *child - = sentry_transaction_start_child(tx, "littler.teapot", NULL); - sentry_span_t *grandchild - = sentry_span_start_child(child, "littlest.teapot", NULL); printf("CHRIS3"); - sentry_span_set_status(child, SENTRY_SPAN_STATUS_NOT_FOUND); - sentry_span_set_status( - grandchild, SENTRY_SPAN_STATUS_ALREADY_EXISTS); + // // Trigger transactions + // sentry_transaction_context_t *tx_ctx + // = sentry_transaction_context_new("little.teapot", + // "Short and stout here is my handle and here is my spout"); + + // sentry_transaction_context_set_sampled(tx_ctx, 0); + + // sentry_transaction_t *tx + // = sentry_transaction_start(tx_ctx, sentry_value_new_null()); + + // printf("CHRIS2"); + // sentry_transaction_set_status( + // tx, SENTRY_SPAN_STATUS_INTERNAL_ERROR); + + // sentry_span_t *child + // = sentry_transaction_start_child(tx, "littler.teapot", NULL); + // sentry_span_t *grandchild + // = sentry_span_start_child(child, "littlest.teapot", NULL); + // printf("CHRIS3"); + + // sentry_span_set_status(child, SENTRY_SPAN_STATUS_NOT_FOUND); + // sentry_span_set_status( + // grandchild, SENTRY_SPAN_STATUS_ALREADY_EXISTS); - sentry_span_finish(grandchild); - sentry_span_finish(child); + // sentry_span_finish(grandchild); + // sentry_span_finish(child); - sentry_transaction_finish(tx); - printf("CHRIS4"); + // sentry_transaction_finish(tx); + // printf("CHRIS4"); - // End instrument performance + // // End instrument performance // Native Crash else do a Sentry Message if (argc != 2) { From cb991dc21bef41bc5402f6d8f0f50c4dfc84fb28 Mon Sep 17 00:00:00 2001 From: Chris Stavitsky Date: Thu, 31 Mar 2022 16:08:48 -0700 Subject: [PATCH 05/11] More built-out transaction --- Makefile | 14 +++++- src/example.c | 115 +++++++++++++++++++++++++++++++++----------------- 2 files changed, 89 insertions(+), 40 deletions(-) diff --git a/Makefile b/Makefile index 73a2795..835d493 100644 --- a/Makefile +++ b/Makefile @@ -3,11 +3,23 @@ SENTRY_PROJECT=chris-danny-native-testing VERSION ?= $(shell sentry-cli releases propose-version) CMAKE=cmake +# This should point to a directory that holds libcurl, if it isn't +# in the system's standard lib dir +# We also set a -L to include the directory where we have the openssl +# libraries +LDFLAGS = -L/home/dast/lib -L/usr/local/ssl/lib + +# We need -lcurl for the curl stuff +# We need -lsocket and -lnsl when on Solaris +# We need -lssl and -lcrypto when using libcurl with SSL support +# We need -lpthread for the pthread example +LIBS = -lcurl -lsocket -lnsl -lssl -lcrypto + all: bin/example .PHONY: all prereqs sentry-makefile sentry-makefile setup_release create_release associate_commits upload_debug_files run_crash run_message clean clean_db bin/example: prereqs src/example.c - $(CC) -g -o $@ -DSENTRY_RELEASE=\"$(VERSION)\" -DSENTRY_PERFORMANCE_MONITORING="ON" -Isentry-native/include src/example.c -Lbin -lsentry -Wl,-rpath,"@executable_path" + $(CC) -g -o $@ -DSENTRY_RELEASE=\"$(VERSION)\" -DSENTRY_PERFORMANCE_MONITORING="ON" -lcurl -Isentry-native/include src/example.c -Lbin -lsentry -Wl,-rpath,"@executable_path" prereqs: bin/libsentry.dylib bin/crashpad_handler diff --git a/src/example.c b/src/example.c index 2cfa275..42a5616 100644 --- a/src/example.c +++ b/src/example.c @@ -1,7 +1,9 @@ #include #include #include +#include #include "sentry.h" +#include // /bin has crashpad binary executables #ifdef _WIN32 @@ -16,6 +18,26 @@ void initialize_memory(char *mem) memset(mem, 1, 100); } +void api_call(void) +{ + printf("CHRIS api call"); + + CURL *curl; + char url[80]; + CURLcode res; + + strcpy(url,"https://application-monitoring-flask-dot-sales-engineering-sf.appspot.com/products-join"); + + curl = curl_easy_init(); + if(curl) { + curl_easy_setopt(curl, CURLOPT_URL, url); + curl_easy_setopt(curl, CURLOPT_POST, url); + + res = curl_easy_perform(curl); + curl_easy_cleanup(curl); + } +} + void startup(void) { // sentry_set_transaction("startup"); @@ -84,67 +106,82 @@ int main(int argc, char *argv[]) // sentry_options_add_attachment(options, "application.log", "application.log"); - printf("CHRIS0"); sentry_options_set_traces_sample_rate(options, 1.0); // Set sample rate to capture performance data - printf("CHRIS1"); sentry_init(options); - // Transactions can be started by providing the name and the operation sentry_transaction_context_t *tx_ctx = sentry_transaction_context_new( - "transaction name", - "transaction operation" + "renderscreen", + "render.screen" ); sentry_transaction_t *tx = sentry_transaction_start(tx_ctx, sentry_value_new_null()); - // Transactions can have child spans (and those spans can have child spans as well) - sentry_span_t *span = sentry_transaction_start_child( + sentry_span_t *async = sentry_transaction_start_child( tx, - "child operation", - "child description" + "http.async", + "async operation 1" ); - printf("CHRIS2"); - // ... - // (Perform the operation represented by the span/transaction) - // ... + sleep(2); - sentry_span_finish(span); // Mark the span as finished - sentry_transaction_finish(tx); // Mark the transaction as finished and send + sentry_span_finish(async); - printf("CHRIS3"); + sentry_span_t *child_filewrite = sentry_transaction_start_child( + tx, + "file.write", + "file write 1" + ); + sleep(3); - // // Trigger transactions - // sentry_transaction_context_t *tx_ctx - // = sentry_transaction_context_new("little.teapot", - // "Short and stout here is my handle and here is my spout"); + sentry_span_t *grandchild_network_request_1 = sentry_transaction_start_child( + tx, + "http.server", + "network request 1" + ); + sleep(2); - // sentry_transaction_context_set_sampled(tx_ctx, 0); + //////////////////////////////////////////////// + ///////////// API CALL HERE //////////////////// + //////////////////////////////////////////////// + printf("Chris before apicall"); + // api_call(); + sentry_span_finish(grandchild_network_request_1); - // sentry_transaction_t *tx - // = sentry_transaction_start(tx_ctx, sentry_value_new_null()); + sentry_span_t *grandchild_network_request_2 = sentry_transaction_start_child( + tx, + "http.server", + "network request 2" + ); + sleep(1); + sentry_span_finish(grandchild_network_request_2); - // printf("CHRIS2"); - // sentry_transaction_set_status( - // tx, SENTRY_SPAN_STATUS_INTERNAL_ERROR); + sentry_span_finish(child_filewrite); - // sentry_span_t *child - // = sentry_transaction_start_child(tx, "littler.teapot", NULL); - // sentry_span_t *grandchild - // = sentry_span_start_child(child, "littlest.teapot", NULL); - // printf("CHRIS3"); + sentry_span_t *async2 = sentry_transaction_start_child( + tx, + "http.async", + "async operation 2" + ); - // sentry_span_set_status(child, SENTRY_SPAN_STATUS_NOT_FOUND); - // sentry_span_set_status( - // grandchild, SENTRY_SPAN_STATUS_ALREADY_EXISTS); + sleep(2); - // sentry_span_finish(grandchild); - // sentry_span_finish(child); + sentry_span_t *fileread = sentry_transaction_start_child( + tx, + "file.read", + "file read 1" + ); + sleep(1); + sentry_span_finish(fileread); - // sentry_transaction_finish(tx); - // printf("CHRIS4"); + sentry_span_t *filewrite = sentry_transaction_start_child( + tx, + "file.write", + "file write 2" + ); + sleep(3); + sentry_span_finish(filewrite); - // // End instrument performance + sentry_transaction_finish(tx); // Mark the transaction as finished and send // Native Crash else do a Sentry Message if (argc != 2) { From 141d7b0469ba773c134aee26e02b1cd1e75faed5 Mon Sep 17 00:00:00 2001 From: Chris Stavitsky Date: Thu, 31 Mar 2022 16:45:38 -0700 Subject: [PATCH 06/11] Transaction makes api call but distributed tracing not yet enabled --- Makefile | 2 +- src/example.c | 42 +++++++++++++++++++++--------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index 835d493..819d4ee 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ all: bin/example .PHONY: all prereqs sentry-makefile sentry-makefile setup_release create_release associate_commits upload_debug_files run_crash run_message clean clean_db bin/example: prereqs src/example.c - $(CC) -g -o $@ -DSENTRY_RELEASE=\"$(VERSION)\" -DSENTRY_PERFORMANCE_MONITORING="ON" -lcurl -Isentry-native/include src/example.c -Lbin -lsentry -Wl,-rpath,"@executable_path" + $(CC) -g -o $@ -DSENTRY_RELEASE=\"$(VERSION)\" -DSENTRY_PERFORMANCE_MONITORING="ON" -lcurl -mmacosx-version-min=10.6 -Isentry-native/include src/example.c -Lbin -lsentry -Wl,-rpath,"@executable_path" prereqs: bin/libsentry.dylib bin/crashpad_handler diff --git a/src/example.c b/src/example.c index 42a5616..5db81ba 100644 --- a/src/example.c +++ b/src/example.c @@ -21,21 +21,14 @@ void initialize_memory(char *mem) void api_call(void) { printf("CHRIS api call"); - - CURL *curl; - char url[80]; - CURLcode res; - - strcpy(url,"https://application-monitoring-flask-dot-sales-engineering-sf.appspot.com/products-join"); - - curl = curl_easy_init(); - if(curl) { - curl_easy_setopt(curl, CURLOPT_URL, url); - curl_easy_setopt(curl, CURLOPT_POST, url); - - res = curl_easy_perform(curl); - curl_easy_cleanup(curl); - } + CURL *curl = curl_easy_init(); + curl_easy_setopt(curl, CURLOPT_URL, + "https://application-monitoring-flask-dot-sales-engineering-sf.appspot.com/products"); + curl_easy_perform(curl); + sentry_value_t request = sentry_value_new_object(); + sentry_value_set_by_key(request, "url", sentry_value_new_string("https://application-monitoring-flask-dot-sales-engineering-sf.appspot.com/products")); + sentry_value_set_by_key(request, "method", sentry_value_new_string("GET")); + sentry_set_context("request", request); } void startup(void) @@ -124,14 +117,12 @@ int main(int argc, char *argv[]) sleep(2); - sentry_span_finish(async); - sentry_span_t *child_filewrite = sentry_transaction_start_child( - tx, + async, "file.write", "file write 1" ); - sleep(3); + sleep(1); sentry_span_t *grandchild_network_request_1 = sentry_transaction_start_child( tx, @@ -139,13 +130,20 @@ int main(int argc, char *argv[]) "network request 1" ); sleep(2); + sentry_span_finish(grandchild_network_request_1); //////////////////////////////////////////////// ///////////// API CALL HERE //////////////////// //////////////////////////////////////////////// printf("Chris before apicall"); - // api_call(); - sentry_span_finish(grandchild_network_request_1); + sentry_span_t *call_endpoint = sentry_transaction_start_child( + tx, + "http.server", + "call api endpoint" + ); + + api_call(); + sentry_span_finish(call_endpoint); sentry_span_t *grandchild_network_request_2 = sentry_transaction_start_child( tx, @@ -156,6 +154,8 @@ int main(int argc, char *argv[]) sentry_span_finish(grandchild_network_request_2); sentry_span_finish(child_filewrite); + sentry_span_finish(async); + sentry_span_t *async2 = sentry_transaction_start_child( tx, From 7459c15cd5f53bc0aa607be5e6d702662c2e5929 Mon Sep 17 00:00:00 2001 From: Chris Stavitsky Date: Fri, 1 Apr 2022 14:11:42 -0700 Subject: [PATCH 07/11] remove api call --- src/example.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/example.c b/src/example.c index 5db81ba..34ba380 100644 --- a/src/example.c +++ b/src/example.c @@ -20,6 +20,9 @@ void initialize_memory(char *mem) void api_call(void) { + // struct curl_slist *chunk = NULL; + // chunk = curl_slist_append(chunk, "sentry-trace: "); //Need to retrieve and interpolate the current trace-id? + printf("CHRIS api call"); CURL *curl = curl_easy_init(); curl_easy_setopt(curl, CURLOPT_URL, @@ -118,7 +121,7 @@ int main(int argc, char *argv[]) sleep(2); sentry_span_t *child_filewrite = sentry_transaction_start_child( - async, + tx, "file.write", "file write 1" ); @@ -142,7 +145,8 @@ int main(int argc, char *argv[]) "call api endpoint" ); - api_call(); + // api_call(); + sleep(2); sentry_span_finish(call_endpoint); sentry_span_t *grandchild_network_request_2 = sentry_transaction_start_child( @@ -156,14 +160,13 @@ int main(int argc, char *argv[]) sentry_span_finish(child_filewrite); sentry_span_finish(async); + // sentry_span_t *async2 = sentry_transaction_start_child( + // tx, + // "http.async", + // "async operation 2" + // ); - sentry_span_t *async2 = sentry_transaction_start_child( - tx, - "http.async", - "async operation 2" - ); - - sleep(2); + // sleep(2); sentry_span_t *fileread = sentry_transaction_start_child( tx, From e5d1091c6701713e44d7e18b7a184d87669185b2 Mon Sep 17 00:00:00 2001 From: Chris Stavitsky Date: Fri, 1 Apr 2022 14:14:45 -0700 Subject: [PATCH 08/11] Clean up makefile --- Makefile | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 819d4ee..de3d949 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,8 @@ SENTRY_ORG=testorg-az -SENTRY_PROJECT=chris-danny-native-testing +SENTRY_PROJECT=sentry-native VERSION ?= $(shell sentry-cli releases propose-version) CMAKE=cmake -# This should point to a directory that holds libcurl, if it isn't -# in the system's standard lib dir -# We also set a -L to include the directory where we have the openssl -# libraries -LDFLAGS = -L/home/dast/lib -L/usr/local/ssl/lib - -# We need -lcurl for the curl stuff -# We need -lsocket and -lnsl when on Solaris -# We need -lssl and -lcrypto when using libcurl with SSL support -# We need -lpthread for the pthread example -LIBS = -lcurl -lsocket -lnsl -lssl -lcrypto - all: bin/example .PHONY: all prereqs sentry-makefile sentry-makefile setup_release create_release associate_commits upload_debug_files run_crash run_message clean clean_db From 8d55ad1e4c87a054610673deb617125432416b75 Mon Sep 17 00:00:00 2001 From: Chris Stavitsky Date: Fri, 1 Apr 2022 14:16:02 -0700 Subject: [PATCH 09/11] more makefile update --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index de3d949..f0d4401 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,10 @@ CMAKE=cmake all: bin/example .PHONY: all prereqs sentry-makefile sentry-makefile setup_release create_release associate_commits upload_debug_files run_crash run_message clean clean_db +# add the following flags if you want to enable the real api call: -lcurl -mmacosx-version-min=10.6 +# note that including `-lcurl` flag will require you to download libcurl locally and set that up. bin/example: prereqs src/example.c - $(CC) -g -o $@ -DSENTRY_RELEASE=\"$(VERSION)\" -DSENTRY_PERFORMANCE_MONITORING="ON" -lcurl -mmacosx-version-min=10.6 -Isentry-native/include src/example.c -Lbin -lsentry -Wl,-rpath,"@executable_path" + $(CC) -g -o $@ -DSENTRY_RELEASE=\"$(VERSION)\" -DSENTRY_PERFORMANCE_MONITORING="ON" -Isentry-native/include src/example.c -Lbin -lsentry -Wl,-rpath,"@executable_path" prereqs: bin/libsentry.dylib bin/crashpad_handler From 7a9737e35f20e0486375f933b9aad304205a9b28 Mon Sep 17 00:00:00 2001 From: Chris Stavitsky Date: Fri, 1 Apr 2022 14:17:12 -0700 Subject: [PATCH 10/11] swap DSNs to correct values --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f0d4401..91ab406 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ SENTRY_ORG=testorg-az -SENTRY_PROJECT=sentry-native +SENTRY_PROJECT=native VERSION ?= $(shell sentry-cli releases propose-version) CMAKE=cmake @@ -41,13 +41,13 @@ upload_debug_files: sentry-cli upload-dif --org testorg-az --project $(SENTRY_PROJECT) --wait --include-sources bin/ run_crash: - SENTRY_DSN=https://35a178f3e42445ada24add8bca35a226@o87286.ingest.sentry.io/6297711 bin/example --crash + SENTRY_DSN=https://b5ceabee4e4a4cd6b21afe3bd2cbbed4@o87286.ingest.sentry.io/1720457 bin/example --crash run_message: - SENTRY_DSN=https://35a178f3e42445ada24add8bca35a226@o87286.ingest.sentry.io/6297711 bin/example --message + SENTRY_DSN=https://b5ceabee4e4a4cd6b21afe3bd2cbbed4@o87286.ingest.sentry.io/1720457 bin/example --message run_clean: - SENTRY_DSN=https://35a178f3e42445ada24add8bca35a226@o87286.ingest.sentry.io/6297711 bin/example + SENTRY_DSN=https://b5ceabee4e4a4cd6b21afe3bd2cbbed4@o87286.ingest.sentry.io/1720457 bin/example clean: rm -rf ./bin/exampl* From aac3ece0e9dd69ef823a522da28937869d89e6cf Mon Sep 17 00:00:00 2001 From: Chris Stavitsky Date: Fri, 1 Apr 2022 14:22:31 -0700 Subject: [PATCH 11/11] Comment out real api call --- src/example.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/example.c b/src/example.c index 34ba380..ccf0993 100644 --- a/src/example.c +++ b/src/example.c @@ -18,21 +18,21 @@ void initialize_memory(char *mem) memset(mem, 1, 100); } -void api_call(void) -{ - // struct curl_slist *chunk = NULL; - // chunk = curl_slist_append(chunk, "sentry-trace: "); //Need to retrieve and interpolate the current trace-id? - - printf("CHRIS api call"); - CURL *curl = curl_easy_init(); - curl_easy_setopt(curl, CURLOPT_URL, - "https://application-monitoring-flask-dot-sales-engineering-sf.appspot.com/products"); - curl_easy_perform(curl); - sentry_value_t request = sentry_value_new_object(); - sentry_value_set_by_key(request, "url", sentry_value_new_string("https://application-monitoring-flask-dot-sales-engineering-sf.appspot.com/products")); - sentry_value_set_by_key(request, "method", sentry_value_new_string("GET")); - sentry_set_context("request", request); -} +// void api_call(void) +// { +// // struct curl_slist *chunk = NULL; +// // chunk = curl_slist_append(chunk, "sentry-trace: "); //Need to retrieve and interpolate the current trace-id? + +// printf("CHRIS api call"); +// CURL *curl = curl_easy_init(); +// curl_easy_setopt(curl, CURLOPT_URL, +// "https://application-monitoring-flask-dot-sales-engineering-sf.appspot.com/products"); +// curl_easy_perform(curl); +// sentry_value_t request = sentry_value_new_object(); +// sentry_value_set_by_key(request, "url", sentry_value_new_string("https://application-monitoring-flask-dot-sales-engineering-sf.appspot.com/products")); +// sentry_value_set_by_key(request, "method", sentry_value_new_string("GET")); +// sentry_set_context("request", request); +// } void startup(void) {