[LiveMetrics] add support for collecting logs#43112
[LiveMetrics] add support for collecting logs#43112TimothyMothra wants to merge 2 commits intotilee/livemetrics_refactor_documentfrom
Conversation
| <PackageReference Include="Azure.Core" /> | ||
| <PackageReference Include="OpenTelemetry" /> | ||
| <PackageReference Include="OpenTelemetry.Exporter.Console" VersionOverride="1.6.0" /> | ||
| <PackageReference Include="OpenTelemetry.Extensions.Hosting" /> |
There was a problem hiding this comment.
Can't we achieve this feature without this reference?
There was a problem hiding this comment.
It could, but I don't think we want to.
This PR delivers a single extension method that configures LiveMetrics for both signals.
This extension method uses OpenTelemetryBuilder which comes from OpenTelemetry.Extensions.Hosting.
Without this package, a user would need to configure our Manager singleton to the ServiceCollection and set LiveMetrics on both signals. I don't think we should take this approach.
Second, as we're preparing to shift our implementation to the Distro, it makes sense to take common dependencies now. This will make that shift easier.
rajkumar-rangaraj
left a comment
There was a problem hiding this comment.
The direction of this PR, which involves exposing a new API, is not the correct approach.
…rics_log2_withServiceCollection
We should sync offline, I think a new API is unavoidable until this code moves to the Distro project. The way I see it we have two options. For context, as of today we have one public extension method for
Without either of these, our Distro project cannot setup LiveMetrics. |
I'm working on this foundation, will send a PR shortly. |
Supersedes #42889
Follow up to #43081. (MUST wait for 43081 to merge before we can merge THIS pr)
This PR adds functionality to collect logs and send to LiveMetrics as TraceDocuments.
Changes
LiveMetricsLogProcessorthat collects OpenTelemetryLogRecordLiveMetricsExtensionsprivateOpenTelemetryBuilder. This depends onIServiceCollectionto manage internal singletons.