{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/issues/1937","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/issues/1937/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/issues/1937/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/issues/1937/events","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-dotnet/issues/1937","id":301162415,"number":1937,"title":"Provide a logging hook to add custom labels to log entries","user":{"login":"henkmollema","id":1521207,"avatar_url":"https://avatars2.githubusercontent.com/u/1521207?v=4","gravatar_id":"","url":"https://api.github.com/users/henkmollema","html_url":"https://github.com/henkmollema","followers_url":"https://api.github.com/users/henkmollema/followers","following_url":"https://api.github.com/users/henkmollema/following{/other_user}","gists_url":"https://api.github.com/users/henkmollema/gists{/gist_id}","starred_url":"https://api.github.com/users/henkmollema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henkmollema/subscriptions","organizations_url":"https://api.github.com/users/henkmollema/orgs","repos_url":"https://api.github.com/users/henkmollema/repos","events_url":"https://api.github.com/users/henkmollema/events{/privacy}","received_events_url":"https://api.github.com/users/henkmollema/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"iantalarico","id":5264734,"avatar_url":"https://avatars0.githubusercontent.com/u/5264734?v=4","gravatar_id":"","url":"https://api.github.com/users/iantalarico","html_url":"https://github.com/iantalarico","followers_url":"https://api.github.com/users/iantalarico/followers","following_url":"https://api.github.com/users/iantalarico/following{/other_user}","gists_url":"https://api.github.com/users/iantalarico/gists{/gist_id}","starred_url":"https://api.github.com/users/iantalarico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iantalarico/subscriptions","organizations_url":"https://api.github.com/users/iantalarico/orgs","repos_url":"https://api.github.com/users/iantalarico/repos","events_url":"https://api.github.com/users/iantalarico/events{/privacy}","received_events_url":"https://api.github.com/users/iantalarico/received_events","type":"User","site_admin":false},"assignees":[{"login":"iantalarico","id":5264734,"avatar_url":"https://avatars0.githubusercontent.com/u/5264734?v=4","gravatar_id":"","url":"https://api.github.com/users/iantalarico","html_url":"https://github.com/iantalarico","followers_url":"https://api.github.com/users/iantalarico/followers","following_url":"https://api.github.com/users/iantalarico/following{/other_user}","gists_url":"https://api.github.com/users/iantalarico/gists{/gist_id}","starred_url":"https://api.github.com/users/iantalarico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iantalarico/subscriptions","organizations_url":"https://api.github.com/users/iantalarico/orgs","repos_url":"https://api.github.com/users/iantalarico/repos","events_url":"https://api.github.com/users/iantalarico/events{/privacy}","received_events_url":"https://api.github.com/users/iantalarico/received_events","type":"User","site_admin":false}],"milestone":null,"comments":9,"created_at":"2018-02-28T20:00:34Z","updated_at":"2018-03-01T19:20:11Z","closed_at":null,"author_association":"NONE","body":"It would be useful if the diagnostics library provided a hook to add custom labels to log entries. Application Insights, for example, has a concept of [telemetry initializers]https://docs.microsoft.com/en-us/azure/application-insights/app-insights-api-filtering-sampling#add-properties-itelemetryinitializer) which allows you to add additional properties to telemetry.\r\n\r\nCurrently you can use `LoggerOptions.Labels` to provide custom labels:\r\nhttps://github.com/GoogleCloudPlatform/google-cloud-dotnet/blob/d0c81fd0756e69b664610b4438f4240f42d0f005/apis/Google.Cloud.Diagnostics.AspNetCore/Google.Cloud.Diagnostics.AspNetCore/Logging/LoggerOptions.cs#L42\r\n\r\nHowever these labels are initialized once when configuring the logger. It would be nice if the `GoogleLogger` accepted a set of initializers to further populate these labels."},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/issues/comments/369700393","html_url":"https://github.com/GoogleCloudPlatform/google-cloud-dotnet/issues/1937#issuecomment-369700393","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/google-cloud-dotnet/issues/1937","id":369700393,"user":{"login":"henkmollema","id":1521207,"avatar_url":"https://avatars2.githubusercontent.com/u/1521207?v=4","gravatar_id":"","url":"https://api.github.com/users/henkmollema","html_url":"https://github.com/henkmollema","followers_url":"https://api.github.com/users/henkmollema/followers","following_url":"https://api.github.com/users/henkmollema/following{/other_user}","gists_url":"https://api.github.com/users/henkmollema/gists{/gist_id}","starred_url":"https://api.github.com/users/henkmollema/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henkmollema/subscriptions","organizations_url":"https://api.github.com/users/henkmollema/orgs","repos_url":"https://api.github.com/users/henkmollema/repos","events_url":"https://api.github.com/users/henkmollema/events{/privacy}","received_events_url":"https://api.github.com/users/henkmollema/received_events","type":"User","site_admin":false},"created_at":"2018-03-01T19:20:11Z","updated_at":"2018-03-01T19:20:11Z","author_association":"NONE","body":"@iantalarico awesome! Do you want to consolidate all these changes into one PR or split them up? E.g. should we start with refactoring the `HttpContextAccessorWrapper` to an `IServiceProvider`.\r\n\r\nWe could add new extensions methods to the [`ILoggingBuilder`](https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.logging.iloggingbuilder?view=aspnetcore-2.0) interface. At least for ASP.NET Core 2.0. I guess you want to keep support for ASP.NET Core 1.x as well so we would need both ways to register the logging providers. I could look into this if you'd like, which raises the same question: is this part of one big PR or separate ones."}}
{"actor":{"display_login":"henkmollema"}}