Open
Conversation
* Local monitoring files cleanup
balis
reviewed
Jun 27, 2024
handler.js
Outdated
|
|
||
| // 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; |
Member
There was a problem hiding this comment.
This is 1ms! Is this necessary? It might have negative impact on performance.
handler.js
Outdated
| let ioInfo = procfs.processIo(pid); | ||
| ioInfo.pid = pid; | ||
| ioInfo.name = jm["name"]; | ||
| if (process.env.HF_VAR_ENABLE_TRACING === "1") { |
Member
There was a problem hiding this comment.
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; |
Member
There was a problem hiding this comment.
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
| // elapsed: 6650000, // ms since the start of the process | ||
| // timestamp: 864000000 // ms since epoch | ||
| // } | ||
| if (process.env.HF_VAR_ENABLE_TRACING === "1") { |
Member
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added metrics and logs support for OpenTelemetry and created monitoring local setup