From d61b9398e9dc0f583b6c1427d45a5d3e3e76863a Mon Sep 17 00:00:00 2001 From: Dhiogo Brustolin Date: Wed, 6 Sep 2023 08:50:42 +0200 Subject: [PATCH] ref: Rename "http.method" to "http.request.method" for network Spans (#3268) * renaming http.method to http.request.method * Format code * Update CHANGELOG.md * Update no-changes-in-high-risk-files.sh --------- Co-authored-by: Sentry Github Bot --- CHANGELOG.md | 6 ++++++ Sources/Sentry/SentryNetworkTracker.m | 3 ++- .../Performance/Network/SentryNetworkTrackerTests.swift | 2 +- scripts/no-changes-in-high-risk-files.sh | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b31c1230856..e8504aef2f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +### Features + +- Rename "http.method" to "http.request.method" for network Spans #3268 + ## 8.11.0 ### Features diff --git a/Sources/Sentry/SentryNetworkTracker.m b/Sources/Sentry/SentryNetworkTracker.m index 7c1500014f5..361d6959be3 100644 --- a/Sources/Sentry/SentryNetworkTracker.m +++ b/Sources/Sentry/SentryNetworkTracker.m @@ -179,7 +179,8 @@ - (void)urlSessionTaskResume:(NSURLSessionTask *)sessionTask safeUrl.sanitizedUrl]]; netSpan.origin = SentryTraceOriginAutoHttpNSURLSession; - [netSpan setDataValue:sessionTask.currentRequest.HTTPMethod forKey:@"http.method"]; + [netSpan setDataValue:sessionTask.currentRequest.HTTPMethod + forKey:@"http.request.method"]; [netSpan setDataValue:safeUrl.sanitizedUrl forKey:@"url"]; [netSpan setDataValue:@"fetch" forKey:@"type"]; diff --git a/Tests/SentryTests/Integrations/Performance/Network/SentryNetworkTrackerTests.swift b/Tests/SentryTests/Integrations/Performance/Network/SentryNetworkTrackerTests.swift index 8628aed1728..dd37ffc1f84 100644 --- a/Tests/SentryTests/Integrations/Performance/Network/SentryNetworkTrackerTests.swift +++ b/Tests/SentryTests/Integrations/Performance/Network/SentryNetworkTrackerTests.swift @@ -837,7 +837,7 @@ class SentryNetworkTrackerTests: XCTestCase { } let path = span.data["url"] as? String - let method = span.data["http.method"] as? String + let method = span.data["http.request.method"] as? String let requestType = span.data["type"] as? String let query = span.data["http.query"] as? String let fragment = span.data["http.fragment"] as? String diff --git a/scripts/no-changes-in-high-risk-files.sh b/scripts/no-changes-in-high-risk-files.sh index 13db2b40446..de5ae89f43f 100755 --- a/scripts/no-changes-in-high-risk-files.sh +++ b/scripts/no-changes-in-high-risk-files.sh @@ -5,7 +5,7 @@ set -euo pipefail ACTUAL=$(shasum -a 256 ./Sources/Sentry/SentryNSURLSessionTaskSearch.m ./Sources/Sentry/SentryNetworkTracker.m ./Sources/Sentry/SentryUIViewControllerSwizzling.m ./Sources/Sentry/SentryNSDataSwizzling.m ./Sources/Sentry/SentrySubClassFinder.m ./Sources/Sentry/SentryCoreDataSwizzling.m ./Sources/Sentry/SentrySwizzleWrapper.m ./Sources/Sentry/include/SentrySwizzle.h ./Sources/Sentry/SentrySwizzle.m) EXPECTED="819d5ca5e3db2ac23c859b14c149b7f0754d3ae88bea1dba92c18f49a81da0e1 ./Sources/Sentry/SentryNSURLSessionTaskSearch.m -545bdd91204ab45d04328dd40233b6fc789b216e1301b5fe2ef23b56db6e3719 ./Sources/Sentry/SentryNetworkTracker.m +57056426d77fd1cc27e72bdcea4bbf617dd8c1e82eecf003df8f0e348aae90ab ./Sources/Sentry/SentryNetworkTracker.m 128dee523c75c121e9b8b767d84a2a137e5b60498c9f3ba604aad3c935d780d0 ./Sources/Sentry/SentryUIViewControllerSwizzling.m e95e62ec7363984f20c78643bb7d992a41a740f97e1befb71525ac34caf88b37 ./Sources/Sentry/SentryNSDataSwizzling.m 9ad05dd8dd29788cba994736fdcd3bbde59a94e32612640d11f4f9c38ad6610e ./Sources/Sentry/SentrySubClassFinder.m