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 Jaeger exporter factory #136

Closed
wants to merge 7 commits into from
Closed

Add Jaeger exporter factory #136

wants to merge 7 commits into from

Conversation

MohamedElqdusy
Copy link
Contributor

@MohamedElqdusy MohamedElqdusy commented Jul 6, 2019

#36

@bogdandrutu
Copy link
Member

Please sign the CLA

@MohamedElqdusy
Copy link
Contributor Author

I signed it

@codecov-io
Copy link

codecov-io commented Jul 8, 2019

Codecov Report

Merging #136 into master will decrease coverage by 0.05%.
The diff coverage is 61.7%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #136      +/-   ##
==========================================
- Coverage   69.78%   69.72%   -0.06%     
==========================================
  Files         101      102       +1     
  Lines        6391     6438      +47     
==========================================
+ Hits         4460     4489      +29     
- Misses       1696     1709      +13     
- Partials      235      240       +5
Impacted Files Coverage Δ
exporter/jaegerexporter/jaeger.go 0% <0%> (ø) ⬆️
exporter/jaegerexporter/factory.go 64.44% <64.44%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ea50ba4...8e822e0. Read the comment docs.

@@ -0,0 +1,12 @@
package jaegerexporter
Copy link
Member

Choose a reason for hiding this comment

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

Make sure all files have the copyright and license notice.

Copy link
Member

Choose a reason for hiding this comment

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

Can we have this automated? We do have it in the java repo.

"path"
"testing"

"github.com/open-telemetry/opentelemetry-service/config"
Copy link
Member

Choose a reason for hiding this comment

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

We normally list imports in the following order:

  1. Standard library packages.
  2. 3rd party packages.
  3. Our own packages.

The 3 sections should be separated by a blank lines. Each section should be sorted alphabetically.

if jc.CollectorEndpoint == "" {
return nil, nil, &jTraceExporterError{
code: errCollectorEndpointRequired,
msg: "Jaeger exporter config requires an Endpoint",
Copy link
Member

Choose a reason for hiding this comment

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

Let's refer to config options exactly as they are supposed to be specified in yaml. That will make user's life easier.

Suggested change
msg: "Jaeger exporter config requires an Endpoint",
msg: "Jaeger exporter config requires an endpoint",

// ConfigV2 defines configuration for Jaeger exporter.
type ConfigV2 struct {
configmodels.ExporterSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
CollectorEndpoint string `mapstructure:"collector-endpoint,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

All other exporters use "endpoint" key. Any special reason to use "collector-endpoint" for this one? If not let's use "endpoint" for uniformity.

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 had the same opinion to use "endpoint" until I have found it with the name "collector-endpoint" in "Jaeger.Options", so I wanted to make it explicit.

if jc.Username == "" {
return nil, nil, &jTraceExporterError{
code: errUsernameRequired,
msg: "Jaeger exporter config requires a Username",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
msg: "Jaeger exporter config requires a Username",
msg: "Jaeger exporter config requires a username",


exporter, serr := jaeger.NewExporter(jOptions)
if serr != nil {
return nil, nil, fmt.Errorf("cannot configure jaeger Trace exporter: %v", serr)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return nil, nil, fmt.Errorf("cannot configure jaeger Trace exporter: %v", serr)
return nil, nil, fmt.Errorf("cannot create Jaeger trace exporter: %v", serr)

// errCollectorEndpointRequired indicates that this exporter was not provided with a collector endpoint in its config.
errCollectorEndpointRequired

// errUsernameRequired indicates that this exporter was not provided with a user name in its config.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// errUsernameRequired indicates that this exporter was not provided with a user name in its config.
// errUsernameRequired indicates that this exporter was not provided with a username in its config.

return nil, nil, err
}

return jexp, noopStopFunc, nil
Copy link
Member

Choose a reason for hiding this comment

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

Stop function is needed for Jaeger. It should not be noop. It needs to call exporter.Flush(). See current implementation in jaeger.go/JaegerExportersFromViper.

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 attempted the same implementation je.stop in a previous commit following "exporter.Flush()" but I thought maybe I would try to do nothing and It will be reviewed anyway.

@pjanotti
Copy link
Contributor

pjanotti commented Jul 8, 2019

Hi @MohamedElqdusy thanks for your PR! We do appreciate it! However, I don't think that we should be enabling OC exporters from client libraries at this stage of OTel Service project: the reason is that those exporters typically have a few issues that we plan to address on our roadmap to OTel service. For now the only exporter from OC client libraries that we should use is the OC agent one. That said we need to rectify the situation rather soon so people can start to experiment with the service.

Sorry for not making that more visible and having you going to the trouble of creating this PR.

@MohamedElqdusy
Copy link
Contributor Author

Hi @pjanotti Thank you for letting me know, It's understood, I enjoyed my time anyway.

@MohamedElqdusy MohamedElqdusy marked this pull request as ready for review July 8, 2019 21:52
@pjanotti
Copy link
Contributor

pjanotti commented Jul 8, 2019

Thanks for understanding @MohamedElqdusy

@pjanotti
Copy link
Contributor

Closing PR per conversation.

@pjanotti pjanotti closed this Jul 10, 2019
Troels51 pushed a commit to Troels51/opentelemetry-collector that referenced this pull request Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants