-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add/Update telemetry events #27356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add/Update telemetry events #27356
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -157,4 +157,39 @@ | |||||
| ORT_UNUSED_PARAMETER(captureState); | ||||||
| } | ||||||
|
|
||||||
| void Telemetry::LogModelLoadStart(uint32_t session_id) const { | ||||||
| ORT_UNUSED_PARAMETER(session_id); | ||||||
| } | ||||||
|
|
||||||
| void Telemetry::LogModelLoadEnd(uint32_t session_id, const common::Status& status) const { | ||||||
| ORT_UNUSED_PARAMETER(session_id); | ||||||
| ORT_UNUSED_PARAMETER(status); | ||||||
| } | ||||||
|
|
||||||
| void Telemetry::LogSessionCreationEnd(uint32_t session_id, | ||||||
| const common::Status& status) const { | ||||||
| ORT_UNUSED_PARAMETER(session_id); | ||||||
| ORT_UNUSED_PARAMETER(status); | ||||||
| } | ||||||
|
|
||||||
| void Telemetry::LogRunStart(uint32_t session_id) const { | ||||||
| ORT_UNUSED_PARAMETER(session_id); | ||||||
| } | ||||||
|
|
||||||
| void Telemetry::LogRegisterEpLibraryWithLibPath(const std::string& registration_name, | ||||||
| const std::string& lib_path) const { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| ORT_UNUSED_PARAMETER(registration_name); | ||||||
| ORT_UNUSED_PARAMETER(lib_path); | ||||||
| } | ||||||
|
|
||||||
| void Telemetry::LogRegisterEpLibraryStart(const std::string& registration_name) const { | ||||||
| ORT_UNUSED_PARAMETER(registration_name); | ||||||
| } | ||||||
|
|
||||||
| void Telemetry::LogRegisterEpLibraryEnd(const std::string& registration_name, | ||||||
|
Check warning on line 189 in onnxruntime/core/platform/telemetry.cc
|
||||||
| const common::Status& status) const { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| ORT_UNUSED_PARAMETER(registration_name); | ||||||
| ORT_UNUSED_PARAMETER(status); | ||||||
| } | ||||||
|
|
||||||
| } // namespace onnxruntime | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -101,6 +101,23 @@ class Telemetry { | |||||
| const std::string& provider_options_string, | ||||||
| bool captureState) const; | ||||||
|
|
||||||
| virtual void LogModelLoadStart(uint32_t session_id) const; | ||||||
|
|
||||||
| virtual void LogModelLoadEnd(uint32_t session_id, const common::Status& status) const; | ||||||
|
|
||||||
| virtual void LogSessionCreationEnd(uint32_t session_id, | ||||||
| const common::Status& status) const; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| virtual void LogRunStart(uint32_t session_id) const; | ||||||
|
|
||||||
| virtual void LogRegisterEpLibraryWithLibPath(const std::string& registration_name, | ||||||
| const std::string& lib_path) const; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| virtual void LogRegisterEpLibraryStart(const std::string& registration_name) const; | ||||||
|
|
||||||
| virtual void LogRegisterEpLibraryEnd(const std::string& registration_name, | ||||||
| const common::Status& status) const; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| private: | ||||||
| ORT_DISALLOW_COPY_ASSIGNMENT_AND_MOVE(Telemetry); | ||||||
| }; | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -457,7 +457,8 @@ void WindowsTelemetry::LogCompileModelStart(uint32_t session_id, | |||||
| TraceLoggingInt32(graph_optimization_level, "graphOptimizationLevel"), | ||||||
| TraceLoggingBool(embed_ep_context, "embedEpContext"), | ||||||
| TraceLoggingBool(has_external_initializers_file, "hasExternalInitializersFile"), | ||||||
| TraceLoggingString(execution_provider_string.c_str(), "executionProviderIds")); | ||||||
| TraceLoggingString(execution_provider_string.c_str(), "executionProviderIds"), | ||||||
| TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName")); | ||||||
| } | ||||||
|
|
||||||
| void WindowsTelemetry::LogCompileModelComplete(uint32_t session_id, | ||||||
|
|
@@ -480,7 +481,8 @@ void WindowsTelemetry::LogCompileModelComplete(uint32_t session_id, | |||||
| TraceLoggingBool(success, "success"), | ||||||
| TraceLoggingUInt32(error_code, "errorCode"), | ||||||
| TraceLoggingUInt32(error_category, "errorCategory"), | ||||||
| TraceLoggingString(error_message.c_str(), "errorMessage")); | ||||||
| TraceLoggingString(error_message.c_str(), "errorMessage"), | ||||||
| TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName")); | ||||||
| } | ||||||
|
|
||||||
| void WindowsTelemetry::LogRuntimeError(uint32_t session_id, const common::Status& status, const char* file, | ||||||
|
|
@@ -668,4 +670,132 @@ void WindowsTelemetry::LogProviderOptions(const std::string& provider_id, const | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| void WindowsTelemetry::LogModelLoadStart(uint32_t session_id) const { | ||||||
| if (global_register_count_ == 0 || enabled_ == false) | ||||||
| return; | ||||||
|
|
||||||
| TraceLoggingWrite(telemetry_provider_handle, | ||||||
| "ModelLoadStart", | ||||||
| TraceLoggingBool(true, "UTCReplace_AppSessionGuid"), | ||||||
| TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage), | ||||||
| TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), | ||||||
| TraceLoggingLevel(WINEVENT_LEVEL_INFO), | ||||||
| // Telemetry info | ||||||
| TraceLoggingUInt8(0, "schemaVersion"), | ||||||
| TraceLoggingUInt32(session_id, "sessionId"), | ||||||
| TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName")); | ||||||
| } | ||||||
|
|
||||||
| void WindowsTelemetry::LogModelLoadEnd(uint32_t session_id, const common::Status& status) const { | ||||||
| if (global_register_count_ == 0 || enabled_ == false) | ||||||
| return; | ||||||
|
|
||||||
| TraceLoggingWrite(telemetry_provider_handle, | ||||||
| "ModelLoadEnd", | ||||||
| TraceLoggingBool(true, "UTCReplace_AppSessionGuid"), | ||||||
| TelemetryPrivacyDataTag(PDT_ProductAndServicePerformance), | ||||||
| TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), | ||||||
| TraceLoggingLevel(WINEVENT_LEVEL_INFO), | ||||||
| // Telemetry info | ||||||
| TraceLoggingUInt8(0, "schemaVersion"), | ||||||
| TraceLoggingUInt32(session_id, "sessionId"), | ||||||
| TraceLoggingBool(status.IsOK(), "isSuccess"), | ||||||
| TraceLoggingUInt32(status.Code(), "errorCode"), | ||||||
| TraceLoggingUInt32(status.Category(), "errorCategory"), | ||||||
| TraceLoggingString(status.IsOK() ? "" : status.ErrorMessage().c_str(), "errorMessage"), | ||||||
| TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName")); | ||||||
| } | ||||||
|
|
||||||
| void WindowsTelemetry::LogSessionCreationEnd(uint32_t session_id, | ||||||
| const common::Status& status) const { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| if (global_register_count_ == 0 || enabled_ == false) | ||||||
| return; | ||||||
|
|
||||||
| TraceLoggingWrite(telemetry_provider_handle, | ||||||
| "SessionCreationEnd", | ||||||
| TraceLoggingBool(true, "UTCReplace_AppSessionGuid"), | ||||||
| TelemetryPrivacyDataTag(PDT_ProductAndServicePerformance), | ||||||
| TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), | ||||||
| TraceLoggingLevel(WINEVENT_LEVEL_INFO), | ||||||
| // Telemetry info | ||||||
| TraceLoggingUInt8(0, "schemaVersion"), | ||||||
| TraceLoggingUInt32(session_id, "sessionId"), | ||||||
| TraceLoggingBool(status.IsOK(), "isSuccess"), | ||||||
| TraceLoggingUInt32(status.Code(), "errorCode"), | ||||||
| TraceLoggingUInt32(status.Category(), "errorCategory"), | ||||||
| TraceLoggingString(status.IsOK() ? "" : status.ErrorMessage().c_str(), "errorMessage"), | ||||||
| TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName")); | ||||||
| } | ||||||
|
|
||||||
| void WindowsTelemetry::LogRunStart(uint32_t session_id) const { | ||||||
| if (global_register_count_ == 0 || enabled_ == false) | ||||||
| return; | ||||||
|
|
||||||
| TraceLoggingWrite(telemetry_provider_handle, | ||||||
| "RunStart", | ||||||
| TraceLoggingBool(true, "UTCReplace_AppSessionGuid"), | ||||||
| TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage), | ||||||
| TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), | ||||||
| TraceLoggingLevel(WINEVENT_LEVEL_INFO), | ||||||
| // Telemetry info | ||||||
| TraceLoggingUInt8(0, "schemaVersion"), | ||||||
| TraceLoggingUInt32(session_id, "sessionId"), | ||||||
| TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName")); | ||||||
| } | ||||||
|
|
||||||
| void WindowsTelemetry::LogRegisterEpLibraryWithLibPath(const std::string& registration_name, | ||||||
| const std::string& lib_path) const { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| if (global_register_count_ == 0 || enabled_ == false) | ||||||
| return; | ||||||
|
|
||||||
| TraceLoggingWrite(telemetry_provider_handle, | ||||||
| "RegisterEpLibraryWithLibPath", | ||||||
| TraceLoggingBool(true, "UTCReplace_AppSessionGuid"), | ||||||
| TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage), | ||||||
| TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), | ||||||
| TraceLoggingLevel(WINEVENT_LEVEL_INFO), | ||||||
| // Telemetry info | ||||||
| TraceLoggingUInt8(0, "schemaVersion"), | ||||||
| TraceLoggingString(registration_name.c_str(), "registrationName"), | ||||||
| TraceLoggingString(lib_path.c_str(), "libPath"), | ||||||
| TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName")); | ||||||
| } | ||||||
|
|
||||||
| void WindowsTelemetry::LogRegisterEpLibraryStart(const std::string& registration_name) const { | ||||||
| if (global_register_count_ == 0 || enabled_ == false) | ||||||
| return; | ||||||
|
|
||||||
| TraceLoggingWrite(telemetry_provider_handle, | ||||||
| "RegisterEpLibraryStart", | ||||||
| TraceLoggingBool(true, "UTCReplace_AppSessionGuid"), | ||||||
| TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage), | ||||||
| TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), | ||||||
| TraceLoggingLevel(WINEVENT_LEVEL_INFO), | ||||||
| // Telemetry info | ||||||
| TraceLoggingUInt8(0, "schemaVersion"), | ||||||
| TraceLoggingString(registration_name.c_str(), "registrationName"), | ||||||
| TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName")); | ||||||
| } | ||||||
|
|
||||||
| void WindowsTelemetry::LogRegisterEpLibraryEnd(const std::string& registration_name, | ||||||
| const common::Status& status) const { | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| if (global_register_count_ == 0 || enabled_ == false) | ||||||
| return; | ||||||
|
|
||||||
| TraceLoggingWrite(telemetry_provider_handle, | ||||||
| "RegisterEpLibraryEnd", | ||||||
| TraceLoggingBool(true, "UTCReplace_AppSessionGuid"), | ||||||
| TelemetryPrivacyDataTag(PDT_ProductAndServicePerformance), | ||||||
| TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), | ||||||
| TraceLoggingLevel(WINEVENT_LEVEL_INFO), | ||||||
| // Telemetry info | ||||||
| TraceLoggingUInt8(0, "schemaVersion"), | ||||||
| TraceLoggingString(registration_name.c_str(), "registrationName"), | ||||||
| TraceLoggingBool(status.IsOK(), "isSuccess"), | ||||||
| TraceLoggingUInt32(status.Code(), "errorCode"), | ||||||
| TraceLoggingUInt32(status.Category(), "errorCategory"), | ||||||
| TraceLoggingString(status.IsOK() ? "" : status.ErrorMessage().c_str(), "errorMessage"), | ||||||
| TraceLoggingString(ORT_CALLER_FRAMEWORK, "frameworkName")); | ||||||
| } | ||||||
|
|
||||||
| } // namespace onnxruntime | ||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -94,6 +94,23 @@ | |||||
| const std::string& provider_options_string, | ||||||
| bool captureState) const override; | ||||||
|
|
||||||
| void LogModelLoadStart(uint32_t session_id) const override; | ||||||
|
|
||||||
| void LogModelLoadEnd(uint32_t session_id, const common::Status& status) const override; | ||||||
|
|
||||||
| void LogSessionCreationEnd(uint32_t session_id, | ||||||
| const common::Status& status) const override; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| void LogRunStart(uint32_t session_id) const override; | ||||||
|
|
||||||
| void LogRegisterEpLibraryWithLibPath(const std::string& registration_name, | ||||||
| const std::string& lib_path) const override; | ||||||
|
|
||||||
| void LogRegisterEpLibraryStart(const std::string& registration_name) const override; | ||||||
|
|
||||||
| void LogRegisterEpLibraryEnd(const std::string& registration_name, | ||||||
|
Check warning on line 111 in onnxruntime/core/platform/windows/telemetry.h
|
||||||
| const common::Status& status) const override; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| using EtwInternalCallback = std::function<void(LPCGUID SourceId, ULONG IsEnabled, UCHAR Level, | ||||||
| ULONGLONG MatchAnyKeyword, ULONGLONG MatchAllKeyword, | ||||||
| PEVENT_FILTER_DESCRIPTOR FilterData, PVOID CallbackContext)>; | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -976,8 +976,10 @@ | |||||||||
| std::unordered_map<int64_t, long long> duration_per_batch_size_; // the duration (us) of Run() calls per batch size since the last report | ||||||||||
|
|
||||||||||
| TimePoint time_sent_last_; // the TimePoint of the last report | ||||||||||
| // Event Rate per provider < 20 peak events per second | ||||||||||
| constexpr static long long kDurationBetweenSending = 1000 * 1000 * 60 * 10; // duration in (us). send a report every 10 mins | ||||||||||
| // RuntimePerf backoff: starts at 2s, doubles each emission, caps at 10 min | ||||||||||
| constexpr static long long kRuntimePerfInitialInterval = 2 * 1000 * 1000; // 2 seconds in (us) | ||||||||||
|
Check warning on line 980 in onnxruntime/core/session/inference_session.h
|
||||||||||
| constexpr static long long kRuntimePerfMaxInterval = 1000 * 1000 * 60 * 10; // 10 minutes in (us) | ||||||||||
|
Check warning on line 981 in onnxruntime/core/session/inference_session.h
|
||||||||||
|
Comment on lines
+980
to
+981
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| long long runtime_perf_interval_ = kRuntimePerfInitialInterval; | ||||||||||
|
Check warning on line 982 in onnxruntime/core/session/inference_session.h
|
||||||||||
| } telemetry_; | ||||||||||
|
|
||||||||||
| mutable std::mutex telemetry_mutex_; // to ensure thread-safe access to telemetry data | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.