-
Notifications
You must be signed in to change notification settings - Fork 109
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
Opentelemetry fixes #4966
Opentelemetry fixes #4966
Conversation
import { ClientRequest, ServerResponse } from 'http' | ||
|
||
/** Opentelemetry Instrumentation for Joystream Distributor Node */ | ||
|
||
class CustomSpanProcessor extends BatchSpanProcessor { | ||
onStart(span: Span) { | ||
span.setAttribute('nodeId', process.env.JOYSTREAM_DISTRIBUTOR__ID) |
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.
Question: I see the code in the config parser setting this env variable, but it happens in the distributor code. Do we know that onStart()
is called after the config parser has done it's job?
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.
Good question, the instrument code is loaded & initialized first and then the config parser will do its job, i.e. exporting the env vars. Because of this reason the first few spans when the distributor node starts will have nodeId as undefined (if the config was set through config.yml
file and not as env vars).
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.
Just left a question, otherwise LGTM.
This PR
.env
file in@joystream/opentelemetry
module. Due to this bug theOTEL_APPLICATION
was not exported and hence DefaultInstrumentation was used for Argus, and hence argus related attributes were not exported to ES.maxQueueSize
&maxExportBatchSize
span processor options configurable