{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/ApplicationInsights-JS/issues/51","labels_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-JS/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-JS/issues/51/comments","events_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-JS/issues/51/events","html_url":"https://github.com/Microsoft/ApplicationInsights-JS/pull/51","id":99840109,"number":51,"title":"Telemetry initializer","user":{"login":"MaxShehovtsov","id":10049593,"avatar_url":"https://avatars.githubusercontent.com/u/10049593?v=3","gravatar_id":"","url":"https://api.github.com/users/MaxShehovtsov","html_url":"https://github.com/MaxShehovtsov","followers_url":"https://api.github.com/users/MaxShehovtsov/followers","following_url":"https://api.github.com/users/MaxShehovtsov/following{/other_user}","gists_url":"https://api.github.com/users/MaxShehovtsov/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxShehovtsov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxShehovtsov/subscriptions","organizations_url":"https://api.github.com/users/MaxShehovtsov/orgs","repos_url":"https://api.github.com/users/MaxShehovtsov/repos","events_url":"https://api.github.com/users/MaxShehovtsov/events{/privacy}","received_events_url":"https://api.github.com/users/MaxShehovtsov/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Microsoft/ApplicationInsights-JS/labels/cla-not-required","name":"cla-not-required","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-08-08T22:49:52Z","updated_at":"2015-08-10T15:31:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Microsoft/ApplicationInsights-JS/pulls/51","html_url":"https://github.com/Microsoft/ApplicationInsights-JS/pull/51","diff_url":"https://github.com/Microsoft/ApplicationInsights-JS/pull/51.diff","patch_url":"https://github.com/Microsoft/ApplicationInsights-JS/pull/51.patch"},"body":"Implementation of Telemtry initializer concept - allows to attach properties and measurements to all telemetry items.\r\n\r\nSuggested use:\r\n1) with snippet config\r\n\r\n       <SNIPPET>\r\n        }({\r\n            instrumentationKey: \"b9d56dad-4148-458d-8dd1-147c61a17b07\",\r\n            properties: { prop1: \"val1\", prop2: \"val2\" },\r\n            measurements: { m1: 100, m2: 200 }\r\n        });\r\n\r\n        window.appInsights = appInsights;        \r\n        appInsights.trackPageView();\r\n2) with queue push (if can't use option 1)\r\n\r\n       appInsights.queue.push(function() { \r\n         appInsights.context.properties = {prop1: \"val1\", prop2: \"val2\"}\r\n         appInsights.context.measurements = {m1: 100, m2: 200}\r\n       });\r\n\r\nNext steps - stop needing queue.push (though reading appInsights.properties in initialization)"},"comment":{"url":"https://api.github.com/repos/Microsoft/ApplicationInsights-JS/issues/comments/129497396","html_url":"https://github.com/Microsoft/ApplicationInsights-JS/pull/51#issuecomment-129497396","issue_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-JS/issues/51","id":129497396,"user":{"login":"SergeyKanzhelev","id":9950081,"avatar_url":"https://avatars.githubusercontent.com/u/9950081?v=3","gravatar_id":"","url":"https://api.github.com/users/SergeyKanzhelev","html_url":"https://github.com/SergeyKanzhelev","followers_url":"https://api.github.com/users/SergeyKanzhelev/followers","following_url":"https://api.github.com/users/SergeyKanzhelev/following{/other_user}","gists_url":"https://api.github.com/users/SergeyKanzhelev/gists{/gist_id}","starred_url":"https://api.github.com/users/SergeyKanzhelev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SergeyKanzhelev/subscriptions","organizations_url":"https://api.github.com/users/SergeyKanzhelev/orgs","repos_url":"https://api.github.com/users/SergeyKanzhelev/repos","events_url":"https://api.github.com/users/SergeyKanzhelev/events{/privacy}","received_events_url":"https://api.github.com/users/SergeyKanzhelev/received_events","type":"User","site_admin":false},"created_at":"2015-08-10T15:31:29Z","updated_at":"2015-08-10T15:31:29Z","body":"@AlexBulankou, the name ```onBeforeSendTelemetry``` is aligned with the current implementation of telemetry initializers. However while implementing dependency and operations tracking it makes more sense to call ```Initialize``` on telemetry items when you start operation, not when you send it. For instance, you can get the current thread when item was tracked, not when it was attempted to be sent. I'd suggest to change name to something closer to ```OnInitialize```"}}