-
Notifications
You must be signed in to change notification settings - Fork 734
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
Add Console Activity Json Exporter #4548
Conversation
src/OpenTelemetry.Exporter.Console/OpenTelemetry.Exporter.Console.csproj
Outdated
Show resolved
Hide resolved
Directory.Packages.props
Outdated
<PackageVersion Include="System.Text.Encodings.Web" Version="4.7.2" /> | ||
<PackageVersion Include="System.Text.Json" Version="4.7.2" /> | ||
<PackageVersion Include="System.Text.Encodings.Web" Version="7.0.0" /> | ||
<PackageVersion Include="System.Text.Json" Version="7.0.2" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why? We should support the lowest possible version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that version did not support ReferenceHandler = ReferenceHandler.IgnoreCycles, should i remove it in favor of the version 4.7.2?
What type of JSON do we use? I suggest that we start from https://github.com/open-telemetry/opentelemetry-proto/blob/main/docs/specification.md#json-protobuf-encoding (at least I want us to avoid inventing our own JSON format). |
|
||
namespace OpenTelemetry.Exporter | ||
{ | ||
public class ConsoleActivityJsonExporter : ConsoleExporter<Activity> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brunomartinspro What's the motivation behind adding this new exporter to the repo? ConsoleExporter
is a simple lightweight exporter meant for quick and naive testing/ troubleshooting for the developers. It was designed to be simple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we just need an option to existing exporter to write json output
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cijothomas Why do we want to add this to the existing exporter though? Users are allowed to create their own custom exporters and use them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its good to support a more standard/predictable output in the consoleexporter, without forcing everyone to author their own exporter.
The predictable/standard output could be the https://github.com/open-telemetry/opentelemetry-proto/blob/main/docs/specification.md#json-protobuf-encoding OR could be the Prometheus exposition format for Metrics (there were issues asking for these earlier (this capability existed long back, but got removed), can't find it with my quick search)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its good to support a more standard/predictable output in the consoleexporter, without forcing everyone to author their own exporter.
I definitely see value in standardizing the ConsoleExporter output. If we decide to go forward with this though, I think the implementation should meet certain requirements:
- We want to keep ConsoleExporter simple, so I don't think we should make this an optional feature. Instead, we should simply update the existing behavior to output data in the standardized format
- ConsoleExporter should not take any additional dependencies or bump the version of existing dependencies that might cause the user to run into version conflict issues with their application code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with this.
It would also be good to add disclaimer that the output format could change (it has changed many times in the past) and people should not take dependency on it. (i.e use it for learning purposes, but not for production purposes to have telemetry output to stdout, and have some agent parse it to store telemetry)
<PackageVersion Include="System.Text.Encodings.Web" Version="4.7.2" /> | ||
<PackageVersion Include="System.Text.Json" Version="4.7.2" /> | ||
<PackageVersion Include="System.Text.Encodings.Web" Version="7.0.0" /> | ||
<PackageVersion Include="System.Text.Json" Version="7.0.2" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the impact of this version bump? How many breaking changes would this introduce?
E.g. https://blog.georgekosmidis.net/net-6-a-guide-for-the-high-impact-breaking-changes.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -26,11 +25,10 @@ | |||
<PackageVersion Include="StyleCop.Analyzers" Version="[1.2.0-beta.435,2.0)" /> | |||
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="7.0.0" /> | |||
<PackageVersion Include="System.Reflection.Emit.Lightweight" Version="4.7.0" /> | |||
<PackageVersion Include="System.Text.Encodings.Web" Version="4.7.2" /> | |||
<PackageVersion Include="System.Text.Json" Version="4.7.2" /> | |||
<PackageVersion Include="System.Text.Encodings.Web" Version="7.0.0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, indent
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
Changes
Added a Console Activity Json Exporter to output logs in JSON.
Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes