-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathGitHubCopilotTelemetryService.swift
More file actions
30 lines (25 loc) · 1.06 KB
/
GitHubCopilotTelemetryService.swift
File metadata and controls
30 lines (25 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import CopilotForXcodeKit
import Foundation
import TelemetryServiceProvider
import BuiltinExtension
public final class GitHubCopilotTelemetryService: TelemetryServiceType {
private let serviceLocator: ServiceLocator
init(serviceLocator: ServiceLocator) {
self.serviceLocator = serviceLocator
}
public func sendError(_ request: TelemetryExceptionRequest,
workspace: WorkspaceInfo) async throws {
guard let service = await serviceLocator.getService(from: workspace) else { return }
let sessionId = service.getSessionId()
var properties = request.properties ?? [:]
properties.updateValue(sessionId, forKey: "common_vscodesessionid")
properties.updateValue(sessionId, forKey: "client_sessionid")
try await service.sendError(
transaction: request.transaction,
stacktrace: request.stacktrace,
properties: properties,
platform: request.platform,
exceptionDetail: request.exceptionDetail
)
}
}