-
Notifications
You must be signed in to change notification settings - Fork 795
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
feat(opentelemetry-exporter-jaeger): http sender #965
feat(opentelemetry-exporter-jaeger): http sender #965
Conversation
Codecov Report
@@ Coverage Diff @@
## master #965 +/- ##
==========================================
+ Coverage 92.31% 92.39% +0.08%
==========================================
Files 117 118 +1
Lines 3396 3407 +11
Branches 689 694 +5
==========================================
+ Hits 3135 3148 +13
+ Misses 261 259 -2
|
@@ -38,8 +39,21 @@ export class JaegerExporter implements SpanExporter { | |||
typeof config.flushTimeout === 'number' ? config.flushTimeout : 2000; | |||
|
|||
config.host = config.host || process.env.JAEGER_AGENT_HOST; | |||
config.endpoint = config.endpoint || process.env.JAEGER_ENDPOINT; | |||
config.username = config.username || process.env.JAEGER_USER; | |||
config.password = config.password || process.env.JAEGER_PASSWORD; |
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 woud prefer to verify that one of username/password
or endpoint
is defined and valid to avoid runtime errors.
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.
Done in 7e64566
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.
With your commit, i think it's not possible to only use JAEGER_AGENT_ENDPOINT
env var since you check for config.endpoint
which should be undefined in this case. Is that normal ?
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.
If process.env.JAEGER_ENDPOINT
is defined, then config.endpoint
will also be. I don't think i understood what you meant.
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.
lgtm, only need the tests to pass
Sorry for the delay in response. We will include this change in |
Not a blocker. I was looking for a standard way to do this across node and java services. Java auto instrumentation sends it directly to the collector. I couldn't find a way to make use of the agent there, whereas nodejs agent would only send to the agent. |
// to the endpoint via HTTP, making the JAEGER_AGENT_HOST and JAEGER_AGENT_PORT unused. If JAEGER_ENDPOINT is secured, | ||
// HTTP basic authentication can be performed by setting the JAEGER_USER and JAEGER_PASSWORD environment variables. | ||
if (localConfig.endpoint) { | ||
localConfig.endpoint = localConfig.endpoint || process.env.JAEGER_ENDPOINT; |
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.
this will never use the env
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.
This should fix it: 8d51800
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.
lgtm
@dyladan please take a look when you get a chance. @leonardodalcin Please, resolve the conflicts. |
@leonardodalcin looks like this is ready to merge once conflicts are resolved |
Which problem is this PR solving?
Enables the usage of jaeger-client-node HTTPSender in order to send spans over
http
.The behavior implemented complies with the following jaeger-client-node documentation statement:
Extracted from: https://github.com/jaegertracing/jaeger-client-node#environment-variables
Short description of the changes
1. packages/opentelemetry-exporter-jaeger/src/jaeger.ts:
endpoint
,username
andpassword
atJaegerExporter
contruction . codeconfig.endpoint
is setten and instanciatesthis._sender
as a HTTPSender and reffers original documentation in commentaries. code2. packages/opentelemetry-exporter-jaeger/src/types.ts:
endpoint
,username
andpassword
toExporterConfig
interface . codeHTTPSender
as a jaeger type. code