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

HPCC-30432 Add options to control if span start/finish are logged #18028

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

ghalliday
Copy link
Member

@ghalliday ghalliday commented Nov 14, 2023

Type of change:

  • This change is a bug fix (non-breaking change which fixes an issue).
  • This change is a new feature (non-breaking change which adds functionality).
  • This change improves the code (refactor or other change that does not change the functionality)
  • This change fixes warnings (the fix does not alter the functionality or the generated code)
  • This change is a breaking change (fix or feature that will cause existing behavior to change).
  • This change alters the query API (existing queries will have to be recompiled)

Checklist:

  • My code follows the code style of this project.
    • My code does not create any new warnings from compiler, build system, or lint.
  • The commit message is properly formatted and free of typos.
    • The commit message title makes sense in a changelog, by itself.
    • The commit is signed.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly, or...
    • I have created a JIRA ticket to update the documentation.
    • Any new interfaces or exported functions are appropriately commented.
  • I have read the CONTRIBUTORS document.
  • The change has been fully tested:
    • I have added tests to cover my changes.
    • All new and existing tests passed.
    • I have checked that this change does not introduce memory leaks.
    • I have used Valgrind or similar tools to check for potential issues.
  • I have given due consideration to all of the following potential concerns:
    • Scalability
    • Performance
    • Security
    • Thread-safety
    • Cloud-compatibility
    • Premature optimization
    • Existing deployed queries will not be broken
    • This change fixes the problem, not just the symptom
    • The target branch of this pull request is appropriate for such a change.
  • There are no similar instances of the same problem that should be addressed
    • I have addressed them here
    • I have raised JIRA issues to address them separately
  • This is a user interface / front-end modification
    • I have tested my changes in multiple modern browsers
    • The component(s) render as expected

Smoketest:

  • Send notifications about my Pull Request position in Smoketest queue.
  • Test my draft Pull Request.

Testing:

Copy link

@ghalliday ghalliday requested a review from rpastrana November 14, 2023 17:04
Copy link
Member

@rpastrana rpastrana left a comment

Choose a reason for hiding this comment

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

@ghalliday seems fine as is, but I'd like to discuss the long term impact based on my in-line comments.

@@ -1111,6 +1111,16 @@
"disabled": {
"type": "boolean",
"description": "If true, disable OTel based trace/span generation"
},
"logSpanStart": {
Copy link
Member

Choose a reason for hiding this comment

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

I'm not inclined to add more options than necessary and would encourage us to avoid these maybe condense into a single "logSpan"

With that said, if we keep both of these, I wonder how useful logging only one is w/out adding timing info into the payload (I still contend a single log output at end w/ all pertinent info is most useful)

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we should default logSpanStart to off now (and I will amend the PR). I agree that a single log entry at then end is most useful, and I was going to disable tracing at the start when I create a PR to improve the finish logging. Given the amount of tracing in esp I think it would be better to disable now.

StringBuffer out;
toLog(out);
LOG(MCmonitorEvent, "Span end: {%s}", out.str());
if (queryTraceManager().logSpanFinish())
Copy link
Member

Choose a reason for hiding this comment

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

If we decide to only log once per span, I wonder if we could filter all MCmonitorEvent directly at the jlog level.

Copy link
Member Author

Choose a reason for hiding this comment

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

We could, but it is more efficient to not generate it at all.

@@ -1111,6 +1111,16 @@
"disabled": {
"type": "boolean",
"description": "If true, disable OTel based trace/span generation"
},
"logSpanStart": {
"type": "boolean",
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@rpastrana rpastrana left a comment

Choose a reason for hiding this comment

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

I'm in favor of the single log output, but we lose timing information which is critical for tracing.
I don't think logging outputs are the future, so not inclined to dedicate too much time/effort, but this change should include tracking of, and reporting of start/duration attributes.

@ghalliday
Copy link
Member Author

I'm in favor of the single log output, but we lose timing information which is critical for tracing. I don't think logging outputs are the future, so not inclined to dedicate too much time/effort, but this change should include tracking of, and reporting of start/duration attributes.

That would be covered by HPCC-30404 to revisit the text logged for Start/finish span and include the attributes etc.. You can leave off approving if you want HPCC-30404 to be ready first. No one is relying on this functionality, so I would be inclined to merge anyway.

Copy link
Member

@rpastrana rpastrana left a comment

Choose a reason for hiding this comment

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

@ghalliday let's go forward w/ this one now.

@ghalliday ghalliday merged commit a646f30 into hpcc-systems:candidate-9.4.x Nov 21, 2023
44 of 45 checks passed
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.

2 participants