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

Support step.waitForEvent in trace runs #1358

Merged
merged 3 commits into from
May 15, 2024
Merged

Support step.waitForEvent in trace runs #1358

merged 3 commits into from
May 15, 2024

Conversation

darwin67
Copy link
Collaborator

Description

Add span for showing the step is waiting for an event.

Type of change (choose one)

  • Chore (refactors, upgrades, etc.)
  • Bug fix (non-breaking change that fixes an issue)
  • Security fix (non-breaking change that fixes a potential vulnerability)
  • Docs
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality not to work as expected)

Checklist

  • I've linked any associated issues to this PR.
  • I've tested my own changes.

Check our Pull Request Guidelines

Copy link

linear bot commented May 14, 2024

Copy link

vercel bot commented May 14, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
ui ⬜️ Ignored (Inspect) Visit Preview May 14, 2024 11:03pm

pkg/consts/otel.go Dismissed Show dismissed Hide dismissed
pkg/consts/otel.go Dismissed Show dismissed Hide dismissed
@darwin67 darwin67 changed the title Move shared attributes out and construct span for step.waitForEvent Support step.waitForEvent in trace runs May 14, 2024
@tonyhb tonyhb merged commit 1e9c9f2 into main May 15, 2024
12 checks passed
@tonyhb tonyhb deleted the darwin/INN-3032 branch May 15, 2024 15:16
Copy link
Member

@jpwilliams jpwilliams left a comment

Choose a reason for hiding this comment

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

This was the span reconstruction that wasn't seeming to work last week, though was probably just something silly. Worth checking they're coming through correctly.

Comment on lines +1723 to +1725
span.Send()
defer span.End()
span.SetAttributes(commonAttrs...)
Copy link
Member

Choose a reason for hiding this comment

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

Could we be intensely unlucky here and export the span before the second call to SetAttributes()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

addressed in #1360

@@ -2200,6 +2227,7 @@ func (e *executor) handleGeneratorInvokeFunction(ctx context.Context, gen state.
),
)
span.Send()
defer span.End()
Copy link
Member

Choose a reason for hiding this comment

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

Any reason to do this? span.Send() calls span.End() anyway and we don't add any details to the span later on.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

addressed in #1360

Comment on lines +2379 to +2382
telemetry.WithName(consts.OtelSpanWaitForEvent),
telemetry.WithTimestamp(now),
telemetry.WithSpanAttributes(
attribute.Bool(consts.OtelUserTraceFilterKey, true),
Copy link
Member

Choose a reason for hiding this comment

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

This will need some attributes adding to fulfil the resolvers, namely:

  • Event name
  • Expression
  • Expiry time

Comment on lines +1744 to +1748
telemetry.WithSpanAttributes(
attribute.String(consts.OtelSysStepOpcode, enums.OpcodeWaitForEvent.String()),
attribute.Int64(consts.OtelSysStepWaitExpires, pause.Expires.Time().UnixMilli()),
attribute.Bool(consts.OtelSysStepWaitExpired, r.EventID == nil),
),
Copy link
Member

Choose a reason for hiding this comment

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

We'll also need to add some more info for the resolvers, namely:

  • Event name
  • Expression
  • ID of the found event (if any)

darwin67 added a commit that referenced this pull request May 15, 2024
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.

None yet

3 participants