-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[receiver/github] add workflow job trace events #38016
base: main
Are you sure you want to change the base?
Conversation
attrs := resource.Attributes() | ||
var err error | ||
|
||
svc, err := gtr.getServiceName(e.GetRepo().CustomProperties["service_name"], e.GetRepo().GetName()) |
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.
I see this is following the logic of existing methods, so I apologize for potentially rehashing this: Is there any possibility that e
is nil here? Or any sub-call from it? If so, should we be checking?
} | ||
|
||
// newUniqueSteps creates a new slice of step names from the provided GitHub | ||
// event steps. Each step name, if duplicated, is appended with `_n` where n is |
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.
// event steps. Each step name, if duplicated, is appended with `_n` where n is | |
// event steps. Each step name, if duplicated, is appended with `-n` where n is |
Nit, looks like it's actually a dash rather than underscore. (I don't have a strong preference which it should be.)
attrs.PutStr(AttributeCICDPipelineTaskRunStatus, AttributeCICDPipelineTaskRunStatusFailure) | ||
span.Status().SetCode(ptrace.StatusCodeError) | ||
case "skipped": | ||
attrs.PutStr(AttributeCICDPipelineTaskRunStatus, AttributeCICDPipelineTaskRunStatusFailure) |
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.
attrs.PutStr(AttributeCICDPipelineTaskRunStatus, AttributeCICDPipelineTaskRunStatusFailure) | |
attrs.PutStr(AttributeCICDPipelineTaskRunStatus, AttributeCICDPipelineTaskRunStatusSkip) |
Unless I'm missing something
attrs.PutStr(AttributeCICDPipelineTaskRunSenderLogin, e.GetSender().GetLogin()) | ||
attrs.PutStr(semconv.AttributeCicdPipelineTaskRunURLFull, e.GetWorkflowJob().GetHTMLURL()) | ||
attrs.PutInt(semconv.AttributeCicdPipelineTaskRunID, e.GetWorkflowJob().GetID()) | ||
switch status := strings.ToLower(e.GetWorkflowJob().GetConclusion()); status { |
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.
Sanity check: We have an attribute declared as AttributeCICDPipelineTaskRunStatusError
, that currently isn't used. Is it relevant in this switch?
Same question for the other switch in createStepSpan
If it's not relevant, when would it be? As you point out in the list of valid values, error
isn't listed. Is it necessary?
Description
Adds workflow job trace event support, creating deterministic Span IDs throughout.
Link to tracking issue
Fixes
Testing
Unit tests & examining behavior against in prod running version.
Documentation
Updated README which contains additional information on resources and deterministic IDs.