dm03514
1 min readJul 2, 2019

--

Yuri Shkuro

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 :)

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Responses (1)

Write a response