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

Add 'debug' exporter #7773

Closed

Conversation

codeboten
Copy link
Contributor

@codeboten codeboten commented May 25, 2023

This PR does the following:

  • make a copy of exporter/loggingexporter -> exporter/debugexporter
  • adds a deprecation notice to loggingexporter
  • updates documentation + examples to use debug instead of logging

I would suggest to move forward w/ this, we could release v0.81.0 w/ both exporters, and then as of v0.82.0, we could only release the debug exporter, but including the logging exporter at v0.81.0 in the release file. Any thoughts?

FIxes #7769

Copy link
Member

@bogdandrutu bogdandrutu left a comment

Choose a reason for hiding this comment

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

Alternative, implement a https://github.com/open-telemetry/opentelemetry-collector/blob/main/confmap/converter.go#L12 that converts the config exporters::logging[/.*]? to exporters::debug[/.*]?. Then we move the code to debug.

@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Jun 10, 2023
@codeboten codeboten removed the Stale label Jun 15, 2023
Copy link
Contributor Author

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

Alternative, implement a https://github.com/open-telemetry/opentelemetry-collector/blob/main/confmap/converter.go#L12 that converts the config exporters::logging[/.]? to exporters::debug[/.]?. Then we move the code to debug.

@bogdandrutu Two questions around this:

  • Would you end up creating a copy of the entire config map to do the replace? I couldn't find a way to delete a key other than by creating another map and omitting it
  • This would also require changing any logging/* in the configured pipelines, would you still want to go this route?

@codeboten codeboten force-pushed the codeboten/debug-exporter branch from 4334d25 to 51cca95 Compare June 21, 2023 20:49
@codecov
Copy link

codecov bot commented Jun 21, 2023

Codecov Report

Patch coverage: 90.15% and project coverage change: +0.26 🎉

Comparison is base (33d8632) 90.79% compared to head (c9cddb8) 91.05%.

❗ Current head c9cddb8 differs from pull request most recent head 65cf09a. Consider uploading reports for the commit 65cf09a to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7773      +/-   ##
==========================================
+ Coverage   90.79%   91.05%   +0.26%     
==========================================
  Files         300      307       +7     
  Lines       14983    15389     +406     
==========================================
+ Hits        13604    14013     +409     
+ Misses       1103     1097       -6     
- Partials      276      279       +3     
Impacted Files Coverage Δ
client/client.go 100.00% <ø> (ø)
exporter/debugexporter/known_sync_error.go 0.00% <0.00%> (ø)
exporter/debugexporter/logging_exporter.go 61.66% <61.66%> (ø)
exporter/debugexporter/config.go 74.19% <74.19%> (ø)
exporter/debugexporter/factory.go 88.73% <88.73%> (ø)
...rter/debugexporter/internal/otlptext/databuffer.go 100.00% <100.00%> (ø)
exporter/debugexporter/internal/otlptext/logs.go 100.00% <100.00%> (ø)
...xporter/debugexporter/internal/otlptext/metrics.go 100.00% <100.00%> (ø)
exporter/debugexporter/internal/otlptext/traces.go 100.00% <100.00%> (ø)
exporter/loggingexporter/factory.go 88.73% <100.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@codeboten codeboten changed the title [wip] prototype 'debug' exporter Add 'debug' exporter Jun 22, 2023
@codeboten codeboten marked this pull request as ready for review June 22, 2023 14:41
@codeboten codeboten requested review from a team and djaglowski June 22, 2023 14:41
@codeboten codeboten force-pushed the codeboten/debug-exporter branch from c9cddb8 to acf68d9 Compare June 22, 2023 21:54
@@ -4,6 +4,7 @@ go 1.19

require (
github.com/stretchr/testify v1.8.4
go.opentelemetry.io/collector v0.80.0
Copy link
Member

Choose a reason for hiding this comment

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

Why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i ran make gotidy and this happened

@@ -161,21 +161,21 @@ $ curl -X POST localhost:9411/api/v2/spans -H'Content-Type: application/json' -d
You should see a log entry like the following from the Collector:

```
2020-11-11T04:12:33.089Z INFO loggingexporter/logging_exporter.go:296 TraceExporter {"#spans": 1}
2020-11-11T04:12:33.089Z INFO debugexporter/debug_exporter.go:296 TraceExporter {"#spans": 1}
Copy link
Member

Choose a reason for hiding this comment

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

Call me paranoid, but can you bump the date to a date closer to today? It might be just me, but I would be really confused seeing this timestamp and no versions of the collector around that date having this component.

exporter.WithTraces(createTracesExporter, component.StabilityLevelDevelopment),
exporter.WithMetrics(createMetricsExporter, component.StabilityLevelDevelopment),
exporter.WithLogs(createLogsExporter, component.StabilityLevelDevelopment),
exporter.WithTraces(createTracesExporter, component.StabilityLevelDeprecated),
Copy link
Member

Choose a reason for hiding this comment

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

I think the logging exporter will live on for quite a while, right? Would it make sense to get rid of the code for this exporter and embed the new exporter here? You could probably just return the debug exporter's outcome to NewFactory here, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We'll need to release a new version of the exporter to mark it as "deprecated", so i figured i would remove the code on the next release.

I would remove the code completely and continue to include the module in the built distros, WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

I would remove the code completely and continue to include the module in the built distros, WDYT?

Can you expand on that? Are you going to keep including the same version of the logging exporter? I don't think that's what you meant, but it's not clear to me what the plan is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

keep including the same version of the logging exporter?
This would be one option.

Another would be to go w/ the wrapper approach, i originally proposed this. A third option would be to do what @bogdandrutu suggested here and implement a converter.

I could go with any of those, but either ways we'll need both modules published for at least one version to deprecate the logging exporter

Copy link
Member

Choose a reason for hiding this comment

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

Another would be to go w/ the wrapper approach

That's what I also had in mind as well, I think it's the cleanest. The new exporter gets the code, the old exporter wraps the new exporter, so that it's code base is minimal and can continue to exist with almost no maintenance for a year before we delete it from the code base.

we'll need both modules published for at least one version to deprecate the logging exporter

If the cut off date is July 2024, we should continue publishing new versions of the logging exporter until then. Wrapping the debug exporter within the logging exporter allows that with minimal overhead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Finally getting back to this PR. Updated it to follow your suggestion, PTAL

Alex Boten added 7 commits June 26, 2023 14:18
Signed-off-by: Alex Boten <[email protected]>
Signed-off-by: Alex Boten <[email protected]>
Signed-off-by: Alex Boten <[email protected]>
Signed-off-by: Alex Boten <[email protected]>
@codeboten codeboten force-pushed the codeboten/debug-exporter branch from f8563c6 to fe15c5c Compare June 26, 2023 21:19
Signed-off-by: Alex Boten <[email protected]>
@github-actions
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Jul 11, 2023
@github-actions
Copy link
Contributor

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Jul 26, 2023
@codeboten
Copy link
Contributor Author

Reopening this PR. Followed the suggestion from @jpkrohling on aliasing the logging exporter as a debug exporter

@codeboten
Copy link
Contributor Author

Well apparently github didn't like me trying to re-open this PR so i opened a new one here: #8375

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should the logging exporter be renamed?
4 participants