You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instrumentation scope is a valuable field and is present on ScopeLogs, ScopeMetrics, and ScopeSpans proto models. As described in the glossary instrumentation scope is a good place to differentiate logs coming from a particular module, package, or class which is exactly what we are looking to use them for.
From what I can tell this field remains untouched by the dotnet implementation when converting log records into open telemetry form, see here. It is used, however, in metrics and activities
Describe the solution you'd like:
Any way to influence this field on logs for a particular scope within an application would be valuable. Tying it in some way to activities or ILogger.BeginScope are two ideas that come to mind. Setting it manually at each ILogger.Log callsite would be undesirable and error prone.
LogRecord.CategoryName Seems to be set automatically based on the class that the log record is for and a similar strategy could be acceptable here as well, though I'm not sure mapping the fields 1:1 is the right approach.
Describe alternatives you've considered.
We can (and probably will) make use of attributes to fill this gap for now, but it's unfortunate given that there is a dedicated field for this and we can't make use of it.
Additional Context
None.
The text was updated successfully, but these errors were encountered:
Feature Request
Before opening a feature request against this repo, consider whether the feature
should/could be implemented in the other OpenTelemetry client
libraries. If so, please open an issue on
opentelemetry-specification
first.
Is your feature request related to a problem?
Instrumentation scope is a valuable field and is present on
ScopeLogs
,ScopeMetrics
, andScopeSpans
proto models. As described in the glossary instrumentation scope is a good place to differentiate logs coming from a particular module, package, or class which is exactly what we are looking to use them for.From what I can tell this field remains untouched by the dotnet implementation when converting log records into open telemetry form, see here. It is used, however, in metrics and activities
Describe the solution you'd like:
Any way to influence this field on logs for a particular scope within an application would be valuable. Tying it in some way to activities or
ILogger.BeginScope
are two ideas that come to mind. Setting it manually at eachILogger.Log
callsite would be undesirable and error prone.LogRecord.CategoryName
Seems to be set automatically based on the class that the log record is for and a similar strategy could be acceptable here as well, though I'm not sure mapping the fields 1:1 is the right approach.Describe alternatives you've considered.
We can (and probably will) make use of attributes to fill this gap for now, but it's unfortunate given that there is a dedicated field for this and we can't make use of it.
Additional Context
None.
The text was updated successfully, but these errors were encountered: