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

[Exporter.Geneva] Add TLDLogExporter #874

Merged
merged 78 commits into from
Jan 11, 2023

Conversation

utpilla
Copy link
Contributor

@utpilla utpilla commented Jan 8, 2023

Changes

  • Add TLDLogExporter
  • GenevaLogExporter to use TLDExporter when the user provides "PrivatePreviewEnableTraceLoggingDynamic=true" in the connectionString

TODOs:

Setup and usage:

using var loggerFactory = LoggerFactory.Create(builder => builder
        .AddOpenTelemetry(loggerOptions =>
        {
            loggerOptions.IncludeScopes = true;
            loggerOptions.AddGenevaLogExporter(exporterOptions =>
            {
                exporterOptions.ConnectionString = "EtwSession=OpenTelemetry;PrivatePreviewEnableTraceLoggingDynamic=true";
                exporterOptions.PrepopulatedFields = new Dictionary<string, object>
                {
                    ["cloud.role"] = "BusyWorker",
                    ["cloud.roleInstance"] = "CY1SCH030021417",
                    ["cloud.roleVer"] = "9.0.15289.2",
                };
            });
        }));

        var logger = loggerFactory.CreateLogger<Program>();

        logger.LogInformation("Hello from {food} {price}.", "artichoke", 3.99);

You could us any ETW collection tools such as WPA, PerfView etc. to view the data:

Example with PerfView:
For the connectionString = "EtwSession=OpenTelemetry;PrivatePreviewEnableTraceLoggingDynamic=true", you can run the following command in Command Prompt:

PerfView.exe collect -MaxCollectSec:3600 -NoGui /onlyProviders=*OpenTelemetry

@utpilla utpilla added the comp:exporter.geneva Things related to OpenTelemetry.Exporter.Geneva label Jan 8, 2023
@utpilla utpilla requested a review from a team as a code owner January 8, 2023 02:48
@codecov
Copy link

codecov bot commented Jan 8, 2023

Codecov Report

Merging #874 (545c6ae) into main (cea38d3) will decrease coverage by 1.13%.
The diff coverage is 40.15%.

❗ Current head 545c6ae differs from pull request most recent head 50b19bd. Consider uploading reports for the commit 50b19bd to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #874      +/-   ##
==========================================
- Coverage   70.01%   68.87%   -1.14%     
==========================================
  Files         187      188       +1     
  Lines        6826     7081     +255     
==========================================
+ Hits         4779     4877      +98     
- Misses       2047     2204     +157     
Impacted Files Coverage Δ
...etry.Exporter.Geneva/TLDExporter/TldLogExporter.cs 36.17% <36.17%> (ø)
...OpenTelemetry.Exporter.Geneva/GenevaLogExporter.cs 77.50% <79.16%> (-2.50%) ⬇️
...orter.Geneva/MsgPackExporter/MsgPackLogExporter.cs 93.36% <0.00%> (-0.83%) ⬇️

@@ -27,6 +27,7 @@
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using OpenTelemetry.Logs;
using OpenTelemetry.Trace;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this (trace) needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not needed. I have removed it.

@utpilla utpilla merged commit 1cc6262 into open-telemetry:main Jan 11, 2023
mmanciop pushed a commit to lumigo-io/opentelemetry-dotnet-contrib that referenced this pull request Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:exporter.geneva Things related to OpenTelemetry.Exporter.Geneva
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants