@@ -240,11 +240,7 @@ common::Status InferenceSession::Load(std::function<common::Status(std::shared_p
240240 // all steps complete, mark the model as loaded.
241241 is_model_loaded_ = true ;
242242
243- // and log telemetry
244- const Env& env = Env::Default ();
245- env.GetTelemetryProvider ().LogSessionCreation (session_id_, model_->IrVersion (), model_->ProducerName (), model_->ProducerVersion (),
246- model_->Domain (), model_->MainGraph ().DomainToVersionMap (), model_->MainGraph ().Name (),
247- model_->MetaData (), event_name, execution_providers_.GetIds ());
243+ event_name_ = event_name;
248244
249245 } catch (const std::exception& ex) {
250246 status = Status (common::ONNXRUNTIME, common::FAIL, " Exception during loading: " + std::string (ex.what ()));
@@ -633,6 +629,13 @@ common::Status InferenceSession::Initialize() {
633629 // handle any subgraphs
634630 ORT_RETURN_IF_ERROR_SESSIONID_ (InitializeSubgraphSessions (graph, session_state_));
635631 is_inited_ = true ;
632+
633+ // and log telemetry
634+ const Env& env = Env::Default ();
635+ env.GetTelemetryProvider ().LogSessionCreation (session_id_, model_->IrVersion (), model_->ProducerName (), model_->ProducerVersion (),
636+ model_->Domain (), model_->MainGraph ().DomainToVersionMap (), model_->MainGraph ().Name (),
637+ model_->MetaData (), event_name_, execution_providers_.GetIds ());
638+
636639 LOGS (*session_logger_, INFO) << " Session successfully initialized." ;
637640 } catch (const NotImplementedException& ex) {
638641 status = ORT_MAKE_STATUS (ONNXRUNTIME, NOT_IMPLEMENTED, " Exception during initialization: " , ex.what ());
0 commit comments