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

Make OtlpLogExporter public #4971

Closed
AB027PS opened this issue Oct 20, 2023 · 6 comments · Fixed by #4979
Closed

Make OtlpLogExporter public #4971

AB027PS opened this issue Oct 20, 2023 · 6 comments · Fixed by #4979
Labels
enhancement New feature or request

Comments

@AB027PS
Copy link
Contributor

AB027PS commented Oct 20, 2023

Feature Request

I'm trying to create an NLog target which would export logs using the OpenTelemetry protocol. Having access to this class would allow me to create a sort of an internal logger, which would export incoming logs using the existing infrastructure from the OpenTelemetry.Exporter.OpenTelemetryProtocol library.

Describe the solution you'd like:

I'd like the OtlpLogExporter class to be made public.

Describe alternatives you've considered.

An alternative is instantiating the class using reflection or reimplementing much of the OpenTelemetry.Exporter.OpenTelemetryProtocol library, neither of which is ideal. As far as I know, there isn't a public way to create an instance of OtlpLogExporter .

@AB027PS AB027PS added the enhancement New feature or request label Oct 20, 2023
@vishweshbankwar
Copy link
Member

@AB027PS Thanks for raising this. Would you be interested in sending the PR for change?

@open-telemetry/dotnet-maintainers FYI

@cijothomas
Copy link
Member

Even if the Exporter is made public, how do you intend to use this? If your goal is to nlog -> Otel, then this is probably what you want?

@snakefoot
Copy link

According to OpenTelemetry own documentation, then one is encouraged to use a Collector, instead of sending directly.

In general we recommend using a collector alongside your service, since it allows your service to offload data quickly and the collector can take care of additional handling like retries, batching, encryption or even sensitive data filtering.

Thus the application is not affected by OpenTelemetry-connectivity-downtime, and application doesn't have to know about OpenTelemetry-connection-details.

Could be nice if the FileLog-Receiver had an official Json-Schema, that required minimum parsing. Then it would "just" be a matter of configuring NLog to write to a JSON-file.

@juliuskoval
Copy link
Contributor

@cijothomas I am the same person as AB027PS, only I don't currently have access to that account, so I'll answer this way.

The repo with the target is work in progress, so I'm not going to make it public yet, but here is a text file with the target, since I couldn't upload a .cs file.
OtlpTarget.txt

I'm making use of the bridge API, but the only missing piece is OtlpLogExporter. I also encountered #4970, but that is a separate issue.

@cijothomas
Copy link
Member

According to OpenTelemetry own documentation, then one is encouraged to use a Collector, instead of sending directly.

In general we recommend using a collector alongside your service, since it allows your service to offload data quickly and the collector can take care of additional handling like retries, batching, encryption or even sensitive data filtering.

Thus the application is not affected by OpenTelemetry-connectivity-downtime, and application doesn't have to know about OpenTelemetry-connection-details.

Could be nice if the FileLog-Receiver had an official Json-Schema, that required minimum parsing. Then it would "just" be a matter of configuring NLog to write to a JSON-file.

Not sure how is this related to this issue?

@snakefoot
Copy link

snakefoot commented Oct 21, 2023

@cijothomas Not sure how is this related to this issue?

Only to mention alternative with using Collector, instead of sending directly using exporter. Thus details about OpenTelemetry-connectivity-details are decoupled from the the application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
5 participants