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

Broker tracing conventions #2983

Merged
merged 6 commits into from
May 13, 2020

Conversation

ian-mi
Copy link
Contributor

@ian-mi ian-mi commented Apr 14, 2020

Fixes #2958 #1766 #1763

Proposed Changes

  • Define conventions for ingress and trigger spans and for setting messaging span attributes.

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Apr 14, 2020
@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 14, 2020
@knative-prow-robot knative-prow-robot added the area/test-and-release Test infrastructure, tests or release label Apr 14, 2020
Copy link
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Produced via:
prettier --write --prose-wrap=always $(find -name '*.md' | grep -v vendor | grep -v .github | grep -v docs/cmd/)

Copy link
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Produced via:
prettier --write --prose-wrap=always $(find -name '*.md' | grep -v vendor | grep -v .github | grep -v docs/cmd/)

@ian-mi
Copy link
Contributor Author

ian-mi commented Apr 14, 2020

cc @grantr @adamharwayne

Comment on lines +192 to +199
if span.IsRecordingEvents() {
span.AddAttributes(
tracing.MessagingSystemAttribute,
tracing.MessagingProtocolHTTP,
tracing.TriggerMessagingDestinationAttribute(triggerRef.NamespacedName),
tracing.MessagingMessageIDAttribute(event.ID()),
)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to some util? It's like 4times in this PR 🤷‍♂️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure a helper function would improve readability. All of these attributes besides the system attribute would need to be arguments to the helper function anyways and I prefer being explicit about what attributes are being added.

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 3, 2020
@vaikas
Copy link
Contributor

vaikas commented May 4, 2020

@ian-mi would you mind getting this rebased? Also, thoughts on util for the span setting?

@ian-mi ian-mi force-pushed the broker-tracing-conventions branch from 733f364 to c8a24c2 Compare May 8, 2020 21:47
@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 8, 2020
@googlebot
Copy link

All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter.

We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only @googlebot I consent. in this pull request.

Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the cla label to yes (if enabled on your project).

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: no Indicates the PR's author has not signed the CLA. and removed cla: yes Indicates the PR's author has signed the CLA. labels May 8, 2020
@ian-mi
Copy link
Contributor Author

ian-mi commented May 8, 2020

Rebased! Needs consent from @mattmoor

@vaikas
Copy link
Contributor

vaikas commented May 13, 2020

/lgtm
/approve

@knative-prow-robot knative-prow-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels May 13, 2020
@mattmoor
Copy link
Member

@googlebot I consent!

@mattmoor
Copy link
Member

@googlebot I consent.

It is possible to directly test the attribute helpers since attribute fields are unexported.
@ian-mi ian-mi force-pushed the broker-tracing-conventions branch from c8a24c2 to 67b17d7 Compare May 13, 2020 19:15
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label May 13, 2020
@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes Indicates the PR's author has signed the CLA. and removed cla: no Indicates the PR's author has not signed the CLA. labels May 13, 2020
Copy link
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Produced via:
prettier --write --prose-wrap=always $(find -name '*.md' | grep -v vendor | grep -v .github | grep -v docs/cmd/)

Co-authored-by: Matt Moore <mattmoor@vmware.com>
Copy link
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Produced via:
prettier --write --prose-wrap=always $(find -name '*.md' | grep -v vendor | grep -v .github | grep -v docs/cmd/)

docs/spec/broker.md Outdated Show resolved Hide resolved
docs/spec/broker.md Outdated Show resolved Hide resolved
Co-authored-by: Matt Moore <mattmoor@vmware.com>
@knative-metrics-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-knative-eventing-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/broker/filter/filter_handler.go 78.4% 78.3% -0.1
pkg/broker/ingress/ingress_handler.go 82.4% 84.6% 2.3
pkg/mtbroker/filter/filter_handler.go 78.4% 78.3% -0.1
pkg/mtbroker/ingress/ingress_handler.go 83.3% 83.0% -0.4
pkg/tracing/attributes.go Do not exist 50.0%

@ian-mi
Copy link
Contributor Author

ian-mi commented May 13, 2020

Strange that that didn't seem to work... I've just dropped the commits and reapplied the suggestions to workaround the issue. I've also slightly improved test coverage.

@vaikas
Copy link
Contributor

vaikas commented May 13, 2020

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label May 13, 2020
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ian-mi, vaikas

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot merged commit 1689191 into knative:master May 13, 2020
@ian-mi ian-mi deleted the broker-tracing-conventions branch May 13, 2020 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/test-and-release Test infrastructure, tests or release cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define Broker Tracing Conventions
7 participants