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

When using task wrap you have no way to access the ID of the step #53

Open
ChrisHampel opened this issue Oct 14, 2021 · 1 comment
Open

Comments

@ChrisHampel
Copy link

When using custom macros that return a Proc/Lambda, you have no access to the id when applying a task wrap. Because of this, the only way you can try and derive a name/id of that step is to inspect the Proc, which is neither convenient nor produces a good name. In contrast, the custom macro would usually know a name to begin with. As such, it would be more convenient if the wrap context also contained the id so that you could use it. I want this feature so that I can have a name to log for each set for instrumentation purposes.

Thank you for your time in reading and considering this.

@apotonick
Copy link
Member

Sorry for the late official response, you probably dropped TRB already 😅
Here's an example how you can get the ID: https://github.com/trailblazer/trailblazer-developer/blob/c8ff6f68e6c4d9b2fcf99a7ad9877d3e1f511bd4/lib/trailblazer/developer/trace.rb#L66

def my_task_wrap_task(wrap_config, ((ctx, flow), circuit_options))
  task = wrap_config[:task]
  activity = circuit_options[:activity]
 
  id = Trailblazer::Activity::Introspect::TaskMap(activity)[task].id
end  

Is that what you mean, @ChrisHampel ?

Note that this is per trailblazer-activity 0.15.0.

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

No branches or pull requests

2 participants