Skip to content

Wait for spans to become available before we run getThread/getSpans#1670

Draft
Alex Z (CLowbrow) wants to merge 10 commits intomainfrom
alex/test-polling-for-spans
Draft

Wait for spans to become available before we run getThread/getSpans#1670
Alex Z (CLowbrow) wants to merge 10 commits intomainfrom
alex/test-polling-for-spans

Conversation

@CLowbrow
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

@j13huang john (j13huang) left a comment

Choose a reason for hiding this comment

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

quick thoughts, glad it seems to be not crazy

js/src/logger.ts Outdated
}
const lastXactId = extractLastXactIdFromLogs3Response(response);
if (lastXactId) {
this._lastFlushedXactId = lastXactId;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

prob want to take the max id. There's a strMax function somewhere

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can't find the shared function but did change this behavior


const callback = async (rootSpan: Span) => {
const state = evaluator.state ?? _internalGetGlobalState();
const state =
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

probably want to verify this work for playgrounds also

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Works in playgrounds locally, we probably want to push this to staging to check though

const parentComponents = parentStr
? SpanComponentsV3.fromStr(parentStr)
: null;
const xactId = state?.bgLogger().lastFlushedXactId();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

want to double check this works in otel land

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It does not :(

const callback = async (rootSpan: Span) => {
const state = evaluator.state ?? _internalGetGlobalState();
const state =
experiment?.loggingState ??
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this now modifies the state variable so we should make sure that it works properly in the downstream callsites for state = experiment?.loggingState

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