-
Notifications
You must be signed in to change notification settings - Fork 4
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
Otel demo #25
base: master
Are you sure you want to change the base?
Otel demo #25
Conversation
* Local monitoring files cleanup
handler.js
Outdated
@@ -34,17 +41,19 @@ async function handleJob(taskId, rcl, message) { | |||
let connector = new RemoteJobConnector(rcl, wfId); | |||
|
|||
// time interval (ms) at which to probe and log metrics | |||
const probeInterval = process.env.HF_VAR_PROBE_INTERVAL || 2000; | |||
const probeInterval = process.env.HF_VAR_PROBE_INTERVAL || 1; |
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 is 1ms! Is this necessary? It might have negative impact on performance.
handler.js
Outdated
// periodically log process IO | ||
logProcIO = function (pid) { | ||
try { | ||
let ioInfo = procfs.processIo(pid); | ||
ioInfo.pid = pid; | ||
ioInfo.name = jm["name"]; | ||
if (process.env.HF_VAR_ENABLE_TRACING === "1") { |
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 (otelLogger) { ... }
should be sufficient. That way we avoid too many places where env is tested. The same occurs in other places where otelLogger is used.
handler.js
Outdated
const tracer = process.env.HF_VAR_ENABLE_TRACING === "1" ? require("./tracing.js")("hyperflow-job-executor"): undefined; | ||
const { spawn } = require('child_process'); | ||
const tracer = process.env.HF_VAR_ENABLE_TRACING === "1" ? require("./tracing.js")("hyperflow-job-executor") : undefined; | ||
const otelLogger = process.env.HF_VAR_ENABLE_TRACING === "1" ? require("./logs.js")("hyperflow-job-executor") : undefined; |
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.
Here test a different env, e.g. "HF_VAR_ENABLE_OTEL".
TRACING should be enabled separately because it requires proper context propagation.
handler.js
Outdated
@@ -140,6 +176,29 @@ async function handleJob(taskId, rcl, message) { | |||
// elapsed: 6650000, // ms since the start of the process | |||
// timestamp: 864000000 // ms since epoch | |||
// } | |||
if (process.env.HF_VAR_ENABLE_TRACING === "1") { |
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.
Here (for sending metrics) let's use another guard, e.g. "If (otelEnabled)"
. Evaluate it at the beginning using the HF_VAR_ENABLE_OTEL env. (That way we evaluate all envs only at the beginning)
Fix job-executor with disabled otel-monitoring
2aa63f6
to
8bfab68
Compare
Added metrics and logs support for OpenTelemetry and created monitoring local setup