-
Notifications
You must be signed in to change notification settings - Fork 304
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-30405 Jtrace CNullSpan Implementation #17904
HPCC-30405 Jtrace CNullSpan Implementation #17904
Conversation
@ghalliday I think this is what you asked for. I'm not sure about the behavior in the second commit. |
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.
Looks good. A few minor comments
system/jlib/jtrace.hpp
Outdated
@@ -58,8 +58,9 @@ extern jlib_decl IProperties * getClientHeaders(const ISpan * span); | |||
|
|||
interface ITraceManager : extends IInterface | |||
{ | |||
virtual ISpan * createServerSpan(const char * name, StringArray & httpHeaders, SpanFlags flags = SpanFlags::None) = 0; | |||
virtual ISpan * createServerSpan(const char * name, const IProperties * httpHeaders, SpanFlags flags = SpanFlags::None) = 0; | |||
virtual ISpan * createNullSpan() const = 0; |
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.
Minor. This can be a global function rather than a member if the ITraceManager interface.
system/jlib/jtrace.cpp
Outdated
|
||
static ISpan * getNullSpan() | ||
{ | ||
if(!nullSpan) |
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.
Not thread safe - probably simplest to create at startup. getNullSpan() can be a global function rather than a static member to avoid the cicular dependency that might result.
system/jlib/jtrace.cpp
Outdated
class CNullSpan : public CInterfaceOf<ISpan> | ||
{ | ||
public: | ||
virtual void setSpanAttribute(const char * key, const char * val) override {}; |
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.
trivial: the trailing ; are not needed on the function definitions.
04e5bf5
to
8f27049
Compare
@ghalliday please review. |
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.
@rpastrana please squash (and remove change left in by mistake?)
helm/hpcc/values.yaml
Outdated
@@ -25,6 +25,10 @@ global: | |||
logging: | |||
detail: 80 | |||
|
|||
# |
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.
@rpastrana I think left in by mistake.
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.
@ghalliday yep, removing. But do we care to keep it as enabled in the default values file?
9d2e47e
to
2a5853f
Compare
@@ -25,6 +25,10 @@ global: | |||
logging: | |||
detail: 80 | |||
|
|||
# tracing sets the default tracing information for all components. Can be overridden locally |
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.
@ghalliday Added the comment I initially had intended to expose here
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.
@rpastrana I can merge as is, or you can include a change to rename the option. The option should also be in the schema - with a description, because I am not quite sure of its effect.
helm/hpcc/values.yaml
Outdated
@@ -25,6 +25,10 @@ global: | |||
logging: | |||
detail: 80 | |||
|
|||
# tracing sets the default tracing information for all components. Can be overridden locally | |||
tracing: | |||
disable: false |
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.
Picky. This option should be "disabled" for consistency for all the other uses.
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.
@rpastrana please squash (and remove 1 space)
system/jlib/jtrace.cpp
Outdated
@@ -814,7 +841,7 @@ class CTraceManager : implements ITraceManager, public CInterface | |||
Expected Configuration format: | |||
global: | |||
tracing: #optional - tracing enabled by default | |||
disable: true #optional - disable OTel tracing | |||
disabled: true #optional - disable OTel tracing |
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.
trivial: extra space
- Defines CNullSpan - Adds cppunits - Defaults activespans to CnullSpan - Removes activespan nullptr checks - Adds default global.tracing.disable - Exposes getNullSpan jlib function - Utilizes getNullSpan jlib function - Renames disable config to disabled Signed-off-by: Rodrigo Pastrana <[email protected]>
46be75a
to
ad9a996
Compare
@ghalliday squashed |
4ae09b1
into
hpcc-systems:candidate-9.4.x
Type of change:
Checklist:
Smoketest:
Testing: