I plan on publishing the technicals of this next (hopefully over the holiday).
Right now I have two components:
- the root span (trace) — This is a github issue or jira issue
- children spans that can reference the root.
For the POC the github issue is generates its trace id as:
“vstrace-github-%s-%d”, issueEvent.Repo.Name, issueEvet.Issue.Number
And then each event needs to look in predefined spots to see if a trace is present. For the POC github pull requests look at the branch name:
func (pr PullRequestEvent) TraceID() (string, bool) { r, _ := regexp.Compile(“vstrace-[0–9A-Za-z]+-[0–9A-Za-z]+-[0–9]+”) matches := r.FindStringSubmatch(pre.PullRequest.Head.Ref) if len(matches) == 0 { return “”, false } return matches[0], true}
But also plan to support the pull request body (like the github->jira integration supports).
For the jenkins integration I’m propagating the trace id using build parameters:
func (be BuildEvent) TraceID() (string, bool) { id, found := be.Parameters[“vstrace-trace-id”] return id, found}
Managing the root span (trace) and determining how each integration will propagate the trace has def been the most time intensive part so far. But because I leveraged your amazing work the total project took ~8–10 hours, because all I had to focus on was the github/jira connector. The datamodel infrastructure, go opentracing/jaeger clients did all the heavy lifting for me :)