コード例 #1
0
 def test_app_insights_get_instrumentation_key(self, mock_handler_run):
     self.assertEqual(
         AppInsightsHelper.get_instrumentation_key('azure://' + GUID), GUID)
     self.assertEqual(
         AppInsightsHelper.get_instrumentation_key(
             'azure://resourceGroup/name'), GUID)
     mock_handler_run.assert_called_once_with('resourceGroup', 'name')
コード例 #2
0
 def get_handler(self):
     self.instrumentation_key = AppInsightsHelper.get_instrumentation_key(self.config['url'])
     self.subscription_id = local_session(self.ctx.policy.session_factory).get_subscription_id()
     return AppInsightsLogHandler(self.instrumentation_key,
                                  self.ctx.policy.name,
                                  self.subscription_id,
                                  self.ctx.execution_id)
コード例 #3
0
 def _initialize(self):
     if self.tc is not None:
         return
     self.instrumentation_key = AppInsightsHelper.get_instrumentation_key(
         self.config['url'])
     self.tc = TelemetryClient(self.instrumentation_key)
     self.subscription_id = local_session(
         self.ctx.policy.session_factory).get_subscription_id()
コード例 #4
0
 def test_app_insights_get_instrumentation_key(self, mock_handler_run):
     self.assertEqual(AppInsightsHelper.get_instrumentation_key('azure://' + GUID), GUID)
     self.assertEqual(AppInsightsHelper.get_instrumentation_key('azure://resourceGroup/name'),
                      GUID)
     mock_handler_run.assert_called_once_with('resourceGroup', 'name')