Skip to content
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

Per-log labels #5313

Closed
EatonZ opened this issue Sep 13, 2020 · 11 comments · Fixed by #6662
Closed

Per-log labels #5313

EatonZ opened this issue Sep 13, 2020 · 11 comments · Fixed by #6662
Assignees
Labels
api: logging Issues related to the Cloud Logging API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@EatonZ
Copy link
Contributor

EatonZ commented Sep 13, 2020

I want to create some custom labels and add them just 1 log entry. After looking through the code in this project, I found a way:

public sealed class RequestInfoLogEntryLabelProvider : HttpLogEntryLabelProvider
{
    public RequestInfoLogEntryLabelProvider(IHttpContextAccessor httpContextAccessor) : base(httpContextAccessor) {}

    protected override void InvokeCore(Dictionary<string, string> labels, HttpContext httpContext)
    {
        var headerValue = httpContext.Request.Headers["TLS-Version"];
        if (StringValues.IsNullOrEmpty(headerValue)) headerValue = "(N/A)";
        labels["tls_version"] = headerValue;
    }
}

It works, but it adds the labels to every log. I don't want that - I just want the labels added to 1 specific log.
I think the best approach would be to let users specify labels in the Log/LogInformation/LogWarning etc calls. That base code is here. You can let the user specify labels through a new param, and then tack those on to what comes back from CreateLabels() further down.

@jskeet jskeet added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. api: logging Issues related to the Cloud Logging API. labels Sep 14, 2020
@amanda-tarafa amanda-tarafa added the priority: p3 Desirable enhancement or fix. May not be included in next release. label Sep 14, 2020
@amanda-tarafa
Copy link
Contributor

We can't add a new parameter to the the GoogleLogger.Log method, this is a method that we are implementing from Microsoft.Extensions.Logging.ILogger. And in any case I don't think there's a need for that.

You can implement conditional label providers, they can be based on HttpContext values or on any other dependency you set up via ASP.NET Core standard dependency injection mechanism. You can see examples of those in UserLogEntryLabelProvider which depends on HttpContext and only adds some labels if there's an authenticated user and EnvironmentNameLogEntryLabelProvider which has a dependency on Microsoft.AspNetCore.Hosting.IHostingEnvironment and sets the aspnetcore_environment if it's present.

Basically, your custom label provider is the one that needs to know when to add a label. If for any reason this approach doesn't work for you do provide more details about your use case and why you can't use the existing label providing mechanism.

@EatonZ
Copy link
Contributor Author

EatonZ commented Sep 14, 2020

Hi @amanda-tarafa, adding a condition to my label provider was the first thing I tried, but I wasn't able to because HttpContext doesn't provide enough information.

Here is a quick summary of what I am trying to do:

  1. At the beginning of requests, log "Request started" under the "RequestStarted" category name.
  2. Associate labels to that log, such as tls_version.
  3. Only associate labels to that 1 log, and not others that may come later.

HttpContext does not provide any information about the logging information, so I can't seem to determine whether labels should be added or not. If I could simply check for the "RequestStarted" category, that would be fine, but it doesn't seem like that is possible.

@amanda-tarafa
Copy link
Contributor

No, it's not inmediately possible to check on the entry you are creating the labels for. We could do that possibly.

But, to be honest, I'm not entirely convinced that labeling a log entry is the best way to tackle your use case. What I think I would do is create a trace span at the beginning of the request and label that span with all the info I want. The span will contain all the log entries created within so you know all those lables apply to all those log entries, i.e. to the request in it's entirety. You can see how to do that here.

This is very subjective, and there's no right or wrong, just preferences and context, but adding labels like you are describing to just one entry based on it being the "first", seems off to me. What does that say about the tls_version associated to the rest of the log entries? My point is that when looking at log entries you have to know that a decision was made to add the tls_version only to the first one of each request, and that is not intuitive in my view. If I were to add those labels, I would add them to all the log entries affected or to none. Spans on the other hand, are the ones that mark the start/end of an operation, and adding labels to them that describe that operation makes a lot of sense. Again, this is just my view and you may have any number of constraints or a context that I don't know about, so take this with a pinch of salt.

If labeling spans works for you, great, else, let me know and I can take a look at defining label providers that know about the entry being logged. But just to set expectations, I probably wouldn't be able to get to this in a couple of weeks.

@EatonZ
Copy link
Contributor Author

EatonZ commented Sep 16, 2020

Hi @amanda-tarafa, 2 things:

  1. It appears a similar request has just come in.

  2. I am reconsidering my implementation and had an idea. Instead of creating a new span, I thought maybe I could update the existing/current/parent span, like this:
    tracer.AnnotateSpan(new Dictionary<string, string> { { "Test", "test" } });
    Unfortunately, it doesn't work - no additional labels show up. See below for what span I am referring to. Is the library able to update this span?

2020-09-15_21-16-57

@amanda-tarafa
Copy link
Contributor

  1. The Log4Net implementation is different from the Diagnostics libraries, first it doens't include tracing, which meand there's no alternative to labeling log entries, and second, as far as I know about it, it doesn't have anything like Diagnostic's label providers, so labels are truly static.

  2. That's a case of the Diagnostics trace not being there. The span you are showing was created by the LoadBalancer and we don't have access to it on the Diagnostics library. That load balancer span should contain the Diagnostics span, see how mine looks like:
    image

And if I click on the inner span, that's where your label should appear, alongside with the /agent and other labels that we set automatically for all request encompasing spans.
image

Note also that not all traces are started by the LoadBalancer, some are directly started by Diagnostics, and look as follows. It seems to me that this has to do with the Load Balancer doing sample tracing only (as Diagnostics does by default, with qps = 1) but that's just an assumption on my part, I'm not really familiar with how the Load Balancer works or how to configure it if you wanted it to trace everything.

image

@EatonZ
Copy link
Contributor Author

EatonZ commented Sep 16, 2020

The span you are showing was created by the LoadBalancer and we don't have access to it on the Diagnostics library

Yes - so it's impossible to update it? I thought that since it's "in progress" you could at least add an annotation to it.

@amanda-tarafa
Copy link
Contributor

The span you are showing was created by the LoadBalancer and we don't have access to it on the Diagnostics library

Yes - so it's impossible to update it? I thought that since it's "in progress" you could at least add an annotation to it.

Not through the Diagnostics library, we don't modify spans that we don't create and we almost certainly don't want to do so. Also, think that in this particular case, you would be setting application specific information on a Load Balancer span, which might be a little unexpected.
In Diagnostics if we are sampling a trace, we already create a span at the start of the request, in our middleware, and that one you can annotate.

In any case, if you really want to annotate and external span, you could do it using the Google.Cloud.Trace.v1 library directly, you could inspect the header, get the trace ID, and use the library to fetch the load balancer span and patch it.

@EatonZ
Copy link
Contributor Author

EatonZ commented Sep 16, 2020

In Diagnostics if we are sampling a trace, we already create a span at the start of the request, in our middleware, and that one you can annotate.

You're right. I just tested, and it worked.
This is a sufficient solution for me, so I will close this now. Thank you for the suggestions and insight.😁

@EatonZ EatonZ closed this as completed Sep 16, 2020
@EatonZ
Copy link
Contributor Author

EatonZ commented Sep 16, 2020

Oh, this is unfortunate. Turns out those labels in the span don't show up in the Cloud Console Logs Viewer. Only Trace list.
This solution will not work as I need to be able to filter by TLS Version and several other fields I am adding, which was why I was adding a log entry in the first place - to be able to filter.
I think my original suggestion should still stand, unless you have another suggestion.

@EatonZ EatonZ reopened this Sep 16, 2020
@amanda-tarafa
Copy link
Contributor

Traces can be filtered as well based on the span labels, see below, with the added benefit, in my view, that you can see everything, traces and logs, in one screen.

image

If you still want to be able to add labels to specific log entries, I can look into adding this feature, but, to set expectations, we won't be able to look/work on this for a couple of weeks.

@EatonZ
Copy link
Contributor Author

EatonZ commented Sep 17, 2020

@amanda-tarafa Thanks for that. I think that will work for now, but I'd still like this for logs, so I can do all filtering in one place.

I will await your update in a few weeks.🙂

amanda-tarafa added a commit to amanda-tarafa/google-cloud-dotnet that referenced this issue Jun 8, 2021
Moves GoogleLoggerScope to Diagnostics.Common.
In preparation for allowing LogEntry augmentation and making it easier to use Google logging from non ASP.NET Core apps.
Towards googleapis#5313, googleapis#5360, googleapis#5929 and googleapis#6367
amanda-tarafa added a commit to amanda-tarafa/google-cloud-dotnet that referenced this issue Jun 8, 2021
amanda-tarafa added a commit to amanda-tarafa/google-cloud-dotnet that referenced this issue Jun 8, 2021
Moves GoogleLoggerScope to Diagnostics.Common.
In preparation for allowing LogEntry augmentation and making it easier to use Google logging from non ASP.NET Core apps.
Towards googleapis#5313, googleapis#5360, googleapis#5929 and googleapis#6367
amanda-tarafa added a commit to amanda-tarafa/google-cloud-dotnet that referenced this issue Jun 8, 2021
amanda-tarafa added a commit to amanda-tarafa/google-cloud-dotnet that referenced this issue Jun 8, 2021
Moves GoogleLoggerScope to Diagnostics.Common.
In preparation for allowing LogEntry augmentation and making it easier to use Google logging from non ASP.NET Core apps.
Towards googleapis#5313, googleapis#5360, googleapis#5929 and googleapis#6367
amanda-tarafa added a commit to amanda-tarafa/google-cloud-dotnet that referenced this issue Jun 8, 2021
amanda-tarafa added a commit to amanda-tarafa/google-cloud-dotnet that referenced this issue Jun 8, 2021
Moves GoogleLoggerScope to Diagnostics.Common.
In preparation for allowing LogEntry augmentation and making it easier to use Google logging from non ASP.NET Core apps.
Towards googleapis#5313, googleapis#5360, googleapis#5929 and googleapis#6367
amanda-tarafa added a commit to amanda-tarafa/google-cloud-dotnet that referenced this issue Jun 8, 2021
amanda-tarafa added a commit to amanda-tarafa/google-cloud-dotnet that referenced this issue Jun 16, 2021
Moves GoogleLoggerScope to Diagnostics.Common.
In preparation for allowing LogEntry augmentation and making it easier to use Google logging from non ASP.NET Core apps.
Towards googleapis#5313, googleapis#5360, googleapis#5929 and googleapis#6367
amanda-tarafa added a commit to amanda-tarafa/google-cloud-dotnet that referenced this issue Jun 16, 2021
amanda-tarafa added a commit to amanda-tarafa/google-cloud-dotnet that referenced this issue Jun 16, 2021
Moves GoogleLoggerScope to Diagnostics.Common.
In preparation for allowing LogEntry augmentation and making it easier to use Google logging from non ASP.NET Core apps.
Towards googleapis#5313, googleapis#5360, googleapis#5929 and googleapis#6367
amanda-tarafa added a commit to amanda-tarafa/google-cloud-dotnet that referenced this issue Jun 16, 2021
amanda-tarafa added a commit that referenced this issue Jun 16, 2021
Moves GoogleLoggerScope to Diagnostics.Common.
In preparation for allowing LogEntry augmentation and making it easier to use Google logging from non ASP.NET Core apps.
Towards #5313, #5360, #5929 and #6367
jskeet added a commit to jskeet/google-cloud-dotnet that referenced this issue Jun 24, 2021
Changes in Google.Cloud.Diagnostics.AspNetCore version 4.3.0-beta01:

- [Commit 60e8cd8](googleapis@60e8cd8):
  - feat: Copies GoogleLogger to Common. This allows easier use of GoogleLogger in non ASP.NET Core applications.
  - Towards [issue 6367](googleapis#6367)
  - Replicate LoggerOptions in Common, and have AspNetCore\*.LoggerOptions be just a wrapper of Common.LoggerOptions.
  - Copies ILogEntryLabelProvider to Common and marks the one in AspNetCore* Obsolete.
  - Makes AspNetCore*.IExternalTraceProvider obsolete. It can now be replaced by Common.ITraceContext.
- [Commit 32cb606](googleapis@32cb606):
  - feat: Allows per log entry labels.
  - Closes [issue 5313](googleapis#5313)
  - Closes [issue 5929](googleapis#5929)
- [Commit c8e9a48](googleapis@c8e9a48):
  - refactor: Makes GoogleLoggerScope extendable.
    Moves GoogleLoggerScope to Diagnostics.Common.
    In preparation for allowing LogEntry augmentation and making it easier to use Google logging from non ASP.NET Core apps.
    Towards [issue 5313](googleapis#5313), [issue 5360](googleapis#5360), [issue 5929](googleapis#5929) and [issue 6367](googleapis#6367)
- [Commit 7f5f89e](googleapis@7f5f89e):
  - docs: Change Stackdriver to Google Cloud, and fix some typos, including in test code.
- [Commit c4c9cd5](googleapis@c4c9cd5):
  - feat: Makes it easier to use tracing from non ASP.NET Core applications
    Closes [issue 5897](googleapis#5897)
    Towards [issue 6367](googleapis#6367)
- [Commit b35b9ea](googleapis@b35b9ea):
  - feat: Decouples Diagnostics tracing from Google's trace header. Towards [issue 5360](googleapis#5360) and [issue 5897](googleapis#5897)
- [Commit 0c00d2c](googleapis@0c00d2c):
  - refactor: Remove unnecesary service provider extension method. There's an equivalent method offered by Microsoft.Extensions.DependencyInjection so we don't need our own.
- [Commit bb0c7b2](googleapis@bb0c7b2):
  - refactor: Remove unnecesary interface IManagedTracerFactory. It's an internal interface that we don't use anywhere. We can always add it back in if we need it at some point.
- [Commit 8ef3983](googleapis@8ef3983):
  - fix: X-Cloud-Trace-Context trace mask values should be 0-1. See https://cloud.google.com/trace/docs/setup#force-trace

Note: changing a generic type parameter constraint in
`LabelProviderExtensions` is notionally a breaking change, but due
to how it will be used, we don't expect it to actually break any customers.

Changes in Google.Cloud.Diagnostics.AspNetCore3 version 4.3.0-beta01:

- [Commit 60e8cd8](googleapis@60e8cd8):
  - feat: Copies GoogleLogger to Common.
  - This allows easier use of GoogleLogger in non ASP.NET Core applications.
  - Towards [issue 6367](googleapis#6367)
  - Replicate LoggerOptions in Common.
    - And have AspNetCore*.LoggerOptions be just a wrapper of Common.LoggerOptions.
  - Copies ILogEntryLabelProvider to Common.
    - And marks the one in AspNetCore* Obsolete.
  - Makes AspNetCore*.IExternalTraceProvider obsolete.
    - It can now be replaced by Common.ITraceContext.
- [Commit 32cb606](googleapis@32cb606):
  - feat: Allows per log entry labels.
  - Closes [issue 5313](googleapis#5313)
  - Closes [issue 5929](googleapis#5929)
- [Commit c8e9a48](googleapis@c8e9a48):
  - refactor: Makes GoogleLoggerScope extendable.
  - Moves GoogleLoggerScope to Diagnostics.Common.
  - In preparation for allowing LogEntry augmentation and making it easier to use Google logging from non ASP.NET Core apps.
  - Towards [issue 5313](googleapis#5313), [issue 5360](googleapis#5360), [issue 5929](googleapis#5929) and [issue 6367](googleapis#6367)
- [Commit 7f5f89e](googleapis@7f5f89e):
  - docs: Change Stackdriver to Google Cloud
  - And fix some typos, including in test code.
- [Commit c4c9cd5](googleapis@c4c9cd5):
  - feat: Makes it easier to use tracing from non ASP.NET Core applications
  - Closes [issue 5897](googleapis#5897)
  - Towards [issue 6367](googleapis#6367)
- [Commit b35b9ea](googleapis@b35b9ea):
  - feat: Decouples Diagnostics tracing from Google's trace header
  - Towards [issue 5360](googleapis#5360) and [issue 5897](googleapis#5897)
- [Commit bb0c7b2](googleapis@bb0c7b2):
  - refactor: Remove unnecesary interface IManagedTracerFactory.
  - It's an internal interface that we don't use anywhere. We can always add it back in if we need it at some point.
- [Commit 8ef3983](googleapis@8ef3983):
  - fix: X-Cloud-Trace-Context trace mask values should be 0-1.
  - See https://cloud.google.com/trace/docs/setup#force-trace

Packages in this release:
- Release Google.Cloud.Diagnostics.AspNetCore version 4.3.0-beta01
- Release Google.Cloud.Diagnostics.AspNetCore3 version 4.3.0-beta01
- Release Google.Cloud.Diagnostics.Common version 4.3.0-beta01
jskeet added a commit to jskeet/google-cloud-dotnet that referenced this issue Jun 24, 2021
Changes in Google.Cloud.Diagnostics.AspNetCore version 4.3.0-beta01:

- [Commit 60e8cd8](googleapis@60e8cd8):
  - feat: Copies GoogleLogger to Common. This allows easier use of GoogleLogger in non ASP.NET Core applications.
  - Towards [issue 6367](googleapis#6367)
  - Replicate LoggerOptions in Common, and have AspNetCore\*.LoggerOptions be just a wrapper of Common.LoggerOptions.
  - Copies ILogEntryLabelProvider to Common and marks the one in AspNetCore* Obsolete.
  - Makes AspNetCore*.IExternalTraceProvider obsolete. It can now be replaced by Common.ITraceContext.
- [Commit 32cb606](googleapis@32cb606):
  - feat: Allows per log entry labels.
  - Closes [issue 5313](googleapis#5313)
  - Closes [issue 5929](googleapis#5929)
- [Commit c8e9a48](googleapis@c8e9a48):
  - refactor: Makes GoogleLoggerScope extendable.
    Moves GoogleLoggerScope to Diagnostics.Common.
    In preparation for allowing LogEntry augmentation and making it easier to use Google logging from non ASP.NET Core apps.
    Towards [issue 5313](googleapis#5313), [issue 5360](googleapis#5360), [issue 5929](googleapis#5929) and [issue 6367](googleapis#6367)
- [Commit 7f5f89e](googleapis@7f5f89e):
  - docs: Change Stackdriver to Google Cloud, and fix some typos, including in test code.
- [Commit c4c9cd5](googleapis@c4c9cd5):
  - feat: Makes it easier to use tracing from non ASP.NET Core applications
    Closes [issue 5897](googleapis#5897)
    Towards [issue 6367](googleapis#6367)
- [Commit b35b9ea](googleapis@b35b9ea):
  - feat: Decouples Diagnostics tracing from Google's trace header. Towards [issue 5360](googleapis#5360) and [issue 5897](googleapis#5897)
- [Commit 0c00d2c](googleapis@0c00d2c):
  - refactor: Remove unnecesary service provider extension method. There's an equivalent method offered by Microsoft.Extensions.DependencyInjection so we don't need our own.
- [Commit bb0c7b2](googleapis@bb0c7b2):
  - refactor: Remove unnecesary interface IManagedTracerFactory. It's an internal interface that we don't use anywhere. We can always add it back in if we need it at some point.
- [Commit 8ef3983](googleapis@8ef3983):
  - fix: X-Cloud-Trace-Context trace mask values should be 0-1. See https://cloud.google.com/trace/docs/setup#force-trace

Note: changing a generic type parameter constraint in
`LabelProviderExtensions` is notionally a breaking change, but due
to how it will be used, we don't expect it to actually break any customers.

Changes in Google.Cloud.Diagnostics.AspNetCore3 version 4.3.0-beta01:

- [Commit 60e8cd8](googleapis@60e8cd8):
  - feat: Copies GoogleLogger to Common. This allows easier use of GoogleLogger in non ASP.NET Core applications.
  - Towards [issue 6367](googleapis#6367)
  - Replicate LoggerOptions in Common, and have AspNetCore\*.LoggerOptions be just a wrapper of Common.LoggerOptions.
  - Copies ILogEntryLabelProvider to Common and marks the one in AspNetCore* Obsolete.
  - Makes AspNetCore*.IExternalTraceProvider obsolete. It can now be replaced by Common.ITraceContext.
- [Commit 32cb606](googleapis@32cb606):
  - feat: Allows per log entry labels.
  - Closes [issue 5313](googleapis#5313)
  - Closes [issue 5929](googleapis#5929)
- [Commit c8e9a48](googleapis@c8e9a48):
  - refactor: Makes GoogleLoggerScope extendable.
    Moves GoogleLoggerScope to Diagnostics.Common.
    In preparation for allowing LogEntry augmentation and making it easier to use Google logging from non ASP.NET Core apps.
    Towards [issue 5313](googleapis#5313), [issue 5360](googleapis#5360), [issue 5929](googleapis#5929) and [issue 6367](googleapis#6367)
- [Commit 7f5f89e](googleapis@7f5f89e):
  - docs: Change Stackdriver to Google Cloud, and fix some typos, including in test code.
- [Commit c4c9cd5](googleapis@c4c9cd5):
  - feat: Makes it easier to use tracing from non ASP.NET Core applications
    Closes [issue 5897](googleapis#5897)
    Towards [issue 6367](googleapis#6367)
- [Commit b35b9ea](googleapis@b35b9ea):
  - feat: Decouples Diagnostics tracing from Google's trace header. Towards [issue 5360](googleapis#5360) and [issue 5897](googleapis#5897)
- [Commit 0c00d2c](googleapis@0c00d2c):
  - refactor: Remove unnecesary service provider extension method. There's an equivalent method offered by Microsoft.Extensions.DependencyInjection so we don't need our own.
- [Commit bb0c7b2](googleapis@bb0c7b2):
  - refactor: Remove unnecesary interface IManagedTracerFactory. It's an internal interface that we don't use anywhere. We can always add it back in if we need it at some point.
- [Commit 8ef3983](googleapis@8ef3983):
  - fix: X-Cloud-Trace-Context trace mask values should be 0-1. See https://cloud.google.com/trace/docs/setup#force-trace

Note: changing a generic type parameter constraint in
`LabelProviderExtensions` is notionally a breaking change, but due
to how it will be used, we don't expect it to actually break any customers.

Packages in this release:
- Release Google.Cloud.Diagnostics.AspNetCore version 4.3.0-beta01
- Release Google.Cloud.Diagnostics.AspNetCore3 version 4.3.0-beta01
- Release Google.Cloud.Diagnostics.Common version 4.3.0-beta01
jskeet added a commit that referenced this issue Jun 24, 2021
Changes in Google.Cloud.Diagnostics.AspNetCore version 4.3.0-beta01:

- [Commit 60e8cd8](60e8cd8):
  - feat: Copies GoogleLogger to Common. This allows easier use of GoogleLogger in non ASP.NET Core applications.
  - Towards [issue 6367](#6367)
  - Replicate LoggerOptions in Common, and have AspNetCore\*.LoggerOptions be just a wrapper of Common.LoggerOptions.
  - Copies ILogEntryLabelProvider to Common and marks the one in AspNetCore* Obsolete.
  - Makes AspNetCore*.IExternalTraceProvider obsolete. It can now be replaced by Common.ITraceContext.
- [Commit 32cb606](32cb606):
  - feat: Allows per log entry labels.
  - Closes [issue 5313](#5313)
  - Closes [issue 5929](#5929)
- [Commit c8e9a48](c8e9a48):
  - refactor: Makes GoogleLoggerScope extendable.
    Moves GoogleLoggerScope to Diagnostics.Common.
    In preparation for allowing LogEntry augmentation and making it easier to use Google logging from non ASP.NET Core apps.
    Towards [issue 5313](#5313), [issue 5360](#5360), [issue 5929](#5929) and [issue 6367](#6367)
- [Commit 7f5f89e](7f5f89e):
  - docs: Change Stackdriver to Google Cloud, and fix some typos, including in test code.
- [Commit c4c9cd5](c4c9cd5):
  - feat: Makes it easier to use tracing from non ASP.NET Core applications
    Closes [issue 5897](#5897)
    Towards [issue 6367](#6367)
- [Commit b35b9ea](b35b9ea):
  - feat: Decouples Diagnostics tracing from Google's trace header. Towards [issue 5360](#5360) and [issue 5897](#5897)
- [Commit 0c00d2c](0c00d2c):
  - refactor: Remove unnecesary service provider extension method. There's an equivalent method offered by Microsoft.Extensions.DependencyInjection so we don't need our own.
- [Commit bb0c7b2](bb0c7b2):
  - refactor: Remove unnecesary interface IManagedTracerFactory. It's an internal interface that we don't use anywhere. We can always add it back in if we need it at some point.
- [Commit 8ef3983](8ef3983):
  - fix: X-Cloud-Trace-Context trace mask values should be 0-1. See https://cloud.google.com/trace/docs/setup#force-trace

Note: changing a generic type parameter constraint in
`LabelProviderExtensions` is notionally a breaking change, but due
to how it will be used, we don't expect it to actually break any customers.

Changes in Google.Cloud.Diagnostics.AspNetCore3 version 4.3.0-beta01:

- [Commit 60e8cd8](60e8cd8):
  - feat: Copies GoogleLogger to Common. This allows easier use of GoogleLogger in non ASP.NET Core applications.
  - Towards [issue 6367](#6367)
  - Replicate LoggerOptions in Common, and have AspNetCore\*.LoggerOptions be just a wrapper of Common.LoggerOptions.
  - Copies ILogEntryLabelProvider to Common and marks the one in AspNetCore* Obsolete.
  - Makes AspNetCore*.IExternalTraceProvider obsolete. It can now be replaced by Common.ITraceContext.
- [Commit 32cb606](32cb606):
  - feat: Allows per log entry labels.
  - Closes [issue 5313](#5313)
  - Closes [issue 5929](#5929)
- [Commit c8e9a48](c8e9a48):
  - refactor: Makes GoogleLoggerScope extendable.
    Moves GoogleLoggerScope to Diagnostics.Common.
    In preparation for allowing LogEntry augmentation and making it easier to use Google logging from non ASP.NET Core apps.
    Towards [issue 5313](#5313), [issue 5360](#5360), [issue 5929](#5929) and [issue 6367](#6367)
- [Commit 7f5f89e](7f5f89e):
  - docs: Change Stackdriver to Google Cloud, and fix some typos, including in test code.
- [Commit c4c9cd5](c4c9cd5):
  - feat: Makes it easier to use tracing from non ASP.NET Core applications
    Closes [issue 5897](#5897)
    Towards [issue 6367](#6367)
- [Commit b35b9ea](b35b9ea):
  - feat: Decouples Diagnostics tracing from Google's trace header. Towards [issue 5360](#5360) and [issue 5897](#5897)
- [Commit 0c00d2c](0c00d2c):
  - refactor: Remove unnecesary service provider extension method. There's an equivalent method offered by Microsoft.Extensions.DependencyInjection so we don't need our own.
- [Commit bb0c7b2](bb0c7b2):
  - refactor: Remove unnecesary interface IManagedTracerFactory. It's an internal interface that we don't use anywhere. We can always add it back in if we need it at some point.
- [Commit 8ef3983](8ef3983):
  - fix: X-Cloud-Trace-Context trace mask values should be 0-1. See https://cloud.google.com/trace/docs/setup#force-trace

Note: changing a generic type parameter constraint in
`LabelProviderExtensions` is notionally a breaking change, but due
to how it will be used, we don't expect it to actually break any customers.

Packages in this release:
- Release Google.Cloud.Diagnostics.AspNetCore version 4.3.0-beta01
- Release Google.Cloud.Diagnostics.AspNetCore3 version 4.3.0-beta01
- Release Google.Cloud.Diagnostics.Common version 4.3.0-beta01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the Cloud Logging API. priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
3 participants