-
Notifications
You must be signed in to change notification settings - Fork 20
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
feat: Add job creator CLI run trace #418
Conversation
ea152fb
to
5e757b8
Compare
pkg/jobcreator/controller.go
Outdated
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.
The changes in this file are from the temporary pending: Add download and accept result error handling
commit. They will be dropped and replaced by the changes from #416.
attribute.String("job_offer.job_creator", offer.JobCreator), | ||
attribute.String("job_offer.module.repo", offer.Module.Repo), | ||
attribute.String("job_offer.module.hash", offer.Module.Hash), | ||
attribute.String("job_offer.mode", string(offer.Mode)), |
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.
We will likely want to add more fields around pricing when we continue our work here.
span.SetAttributes(attribute.String("job_offer.id", jobOfferContainer.JobOffer.ID), | ||
attribute.String("deal.id", jobOfferContainer.DealID)) |
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.
Setting span attributes this far into a span is discouraged, but we need to submit the job offer before we can establish a deal ID. We want the deal ID to query on and associate with traces from other services.
@@ -46,20 +49,42 @@ func RunJob( | |||
// wait a short period because we've just started the job creator service | |||
time.Sleep(100 * time.Millisecond) | |||
|
|||
// Start run job trace | |||
c, span := jobCreatorService.controller.tracer.Start(ctx.Ctx, "run_job", |
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.
Note that this span shares the same name as the resource provider run_job
span. A TraceQL query like {name="run_job"}
will include spans from both the job creator and resource provider.
This behavior is considered acceptable because one can narrow their search by adding the service name. For example {resource.service.name="job_creator" && name="run_job"}
.
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.
LGTM, thanks for breaking this up into smaller PRs!
Tested locally
df1be79
to
70db13d
Compare
* feat: Add job creator run trace * chore: Remove commented code
Summary
This pull request makes the following changes:
This pull requests implements a trace over jobs initiated with the CLI run command.
Task/Issue reference
Closes: #407
Test plan
Start the observability stack (https://github.com/Lilypad-Tech/observability) with:
Run a CLI job. Open the observability dashboard at
localhost:3000
and run the following TraceQL query:Details
We would also like to implement traces over jobs received onchain, but we will take on this work in a future PR.
Related issues or PRs (optional)
Depends on #416. This PR has a temporary
pending: Add download and accept result error handling
commit that will be dropped when the dependency is fulfilled.