Skip to content

Commit

Permalink
Sentry: upgrade and attach command-line arguments (#774)
Browse files Browse the repository at this point in the history
* Sentry: upgrade and attach command-line arguments

* Sentry's setContext(): explicitly pass a String
  • Loading branch information
edigaryev authored Apr 2, 2024
1 parent 560dba7 commit b7b3b70
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/getsentry/sentry-cocoa",
"state" : {
"revision" : "d277532e1c8af813981ba01f591b15bbdd735615",
"version" : "8.8.0"
"revision" : "bf7bdd75e25556d0f97ad54fb804b4287863e106",
"version" : "8.22.4"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let package = Package(
.package(url: "https://github.com/antlr/antlr4", branch: "dev"),
.package(url: "https://github.com/apple/swift-atomics.git", .upToNextMajor(from: "1.0.0")),
.package(url: "https://github.com/nicklockwood/SwiftFormat", from: "0.50.6"),
.package(url: "https://github.com/getsentry/sentry-cocoa", from: "8.8.0"),
.package(url: "https://github.com/getsentry/sentry-cocoa", from: "8.22.4"),
.package(url: "https://github.com/cfilipov/TextTable", branch: "master"),
.package(url: "https://github.com/sersoft-gmbh/swift-sysctl.git", from: "1.0.0"),
.package(url: "https://github.com/orchetect/SwiftRadix", from: "1.3.0")
Expand Down
4 changes: 4 additions & 0 deletions Sources/tart/Root.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ struct Root: AsyncParsableCommand {
}
defer { SentrySDK.flush(timeout: 2.seconds.timeInterval) }

SentrySDK.configureScope { scope in
scope.setExtra(value: ProcessInfo.processInfo.arguments, key: "Command-line arguments")
}

// Enrich future events with Cirrus CI-specific tags
if let tags = ProcessInfo.processInfo.environment["CIRRUS_SENTRY_TAGS"] {
SentrySDK.configureScope { scope in
Expand Down
2 changes: 1 addition & 1 deletion Sources/tart/VMStorageOCI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class VMStorageOCI: PrunableStorage {

func pull(_ name: RemoteName, registry: Registry, concurrency: UInt) async throws {
SentrySDK.configureScope { scope in
scope.setContext(value: ["imageName": name], key: "OCI")
scope.setContext(value: ["imageName": name.description], key: "OCI")
}

defaultLogger.appendNewLine("pulling manifest...")
Expand Down

0 comments on commit b7b3b70

Please sign in to comment.