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 autoexport to automatically configure trace exporters #2753

Merged
merged 64 commits into from May 25, 2023

Conversation

MikeGoldsmith
Copy link
Member

@MikeGoldsmith MikeGoldsmith commented Sep 15, 2022

This PR adds an autoexport package similar to autoprop that can detect and configure trace exporters, or use provided ones if none are set in environment variables.

Note: common exporters (eg otlp, jaeger, etc) cannot be pre-populated into the registry during init because they would not take into account environment variables configured before autoexport is called. This is valuable, as it both supports testing and when combined with the proposed generic config launcher (see below).

Known limitations:

  • Only one exporter per type can be configured, eg a single "otlp" exporter can be configured
  • Does not consider metrics exporters yet because they are slightly more complicated because metrics exporters are wrapped by a controller (push / pull)

exporters/autoexport/exporter.go Outdated Show resolved Hide resolved
exporters/autoexport/exporter.go Outdated Show resolved Hide resolved
exporters/autoexport/exporter.go Outdated Show resolved Hide resolved
exporters/autoexport/go.mod Outdated Show resolved Hide resolved
exporters/autoexport/registry.go Outdated Show resolved Hide resolved
MikeGoldsmith and others added 3 commits September 15, 2022 20:10
Co-authored-by: Tyler Yahn <codingalias@gmail.com>
Co-authored-by: Tyler Yahn <codingalias@gmail.com>
@codecov
Copy link

codecov bot commented Sep 15, 2022

Codecov Report

Merging #2753 (d98ccee) into main (e9956ff) will increase coverage by 0.0%.
The diff coverage is 80.4%.

Additional details and impacted files

Impacted file tree graph

@@          Coverage Diff          @@
##            main   #2753   +/-   ##
=====================================
  Coverage   79.3%   79.3%           
=====================================
  Files        163     165    +2     
  Lines      10325   10422   +97     
=====================================
+ Hits        8193    8274   +81     
- Misses      2000    2012   +12     
- Partials     132     136    +4     
Impacted Files Coverage Δ
exporters/autoexport/exporter.go 77.5% <77.5%> (ø)
exporters/autoexport/registry.go 82.4% <82.4%> (ø)

... and 1 file with indirect coverage changes

@MikeGoldsmith
Copy link
Member Author

Hey @MrAlias - could you give this another pass for feedback please? Thanks

@MikeGoldsmith
Copy link
Member Author

@MrAlias @pellared I've addressed your feedback. Please re-review 👍🏻

exporters/autoexport/README.md Show resolved Hide resolved
exporters/autoexport/README.md Outdated Show resolved Hide resolved
exporters/autoexport/README.md Outdated Show resolved Hide resolved
exporters/autoexport/README.md Outdated Show resolved Hide resolved
exporters/autoexport/README.md Outdated Show resolved Hide resolved
exporters/autoexport/README.md Outdated Show resolved Hide resolved
MikeGoldsmith and others added 2 commits May 25, 2023 14:17
Co-authored-by: Robert Pająk <pellared@hotmail.com>
@MikeGoldsmith
Copy link
Member Author

@pellared How's this?

exporters/autoexport/doc.go Outdated Show resolved Hide resolved
exporters/autoexport/doc.go Outdated Show resolved Hide resolved
exporters/autoexport/doc.go Outdated Show resolved Hide resolved
exporters/autoexport/doc.go Outdated Show resolved Hide resolved
Co-authored-by: Robert Pająk <pellared@hotmail.com>
@MrAlias MrAlias merged commit 3e827e3 into open-telemetry:main May 25, 2023
22 checks passed
@MikeGoldsmith MikeGoldsmith deleted the mike/autoexport branch May 25, 2023 15:54
@james-callahan
Copy link

Is there a no-op exporter we can use with autoexport?

@pellared
Copy link
Member

Is there a no-op exporter we can use with autoexport?

I created #4013

@MrAlias MrAlias added this to the v0.43.0 milestone Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: exporter Related to an exporter package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet