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

Support Datadog sample rate with global trace sampling from configmap #4897

Merged

Conversation

sungmincs
Copy link
Contributor

What this PR does / why we need it:
I have been looking for a way to do a Datadog trace sampling in a global level, and ended up filing a PR.

Currently dd-opentracing-cpp has a capability to disable priority sampling (client-side sampling) and use global sampling rate, however there is no native way for ingress-nginx to support this.
Please see the Annotated Datadog config JSON section.
https://github.com/DataDog/dd-opentracing-cpp/blob/7d58654a41a4fa4589988d105f953049f9eeee3c/README.md#guide

In this PR, I added the following:

  • support datadog-priority-sampling and datadog-sample-rate in configmap
  • Added missing documentations about datadog configuration options
  • Added the docs to third-party-addons

I tested the change in my local development.

  • Hit an endpoint every 2~3 seconds
  • Disable datadog-priority-sampling in configmap
  • Change the values of datadog-sample-rate from configmap and observe the difference
    2020-01-07_11-51-51

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged):
No known open issues that I know of

Special notes for your reviewer:
Probably useful to get some eyes of dd-opentracing-cpp maintainer, so cc-ing @cgilmour here as this issue was my starting point of this PR.

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please sign in with your organization's credentials at https://identity.linuxfoundation.org/projects/cncf to be authorized.
  • If you have done the above and are still having issues with the CLA being reported as unsigned, please log a ticket with the Linux Foundation Helpdesk: https://support.linuxfoundation.org/
  • Should you encounter any issues with the Linux Foundation Helpdesk, send a message to the backup e-mail support address at: [email protected]

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 8, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @dmxlsj. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 8, 2020
@sungmincs sungmincs force-pushed the feature/datadog-sample-rate branch from e1bec67 to be6a6c3 Compare January 8, 2020 00:04
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jan 8, 2020
@aledbf
Copy link
Member

aledbf commented Jan 8, 2020

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 8, 2020
@aledbf
Copy link
Member

aledbf commented Jan 8, 2020

@dmxlsj please squash the commits

@codecov-io
Copy link

codecov-io commented Jan 8, 2020

Codecov Report

Merging #4897 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #4897   +/-   ##
======================================
  Coverage    58.5%   58.5%           
======================================
  Files          88      88           
  Lines        6719    6719           
======================================
  Hits         3931    3931           
  Misses       2359    2359           
  Partials      429     429
Impacted Files Coverage Δ
internal/ingress/controller/nginx.go 29.69% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e093130...d7be5db. Read the comment docs.

@sungmincs sungmincs force-pushed the feature/datadog-sample-rate branch from c01aceb to f9413f2 Compare January 8, 2020 00:32
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 8, 2020
@sungmincs
Copy link
Contributor Author

sorry messed up the rebase as I was originally working out of on 0.25 release.
will fix this soon.

@sungmincs sungmincs force-pushed the feature/datadog-sample-rate branch from f9413f2 to d7be5db Compare January 8, 2020 01:02
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 8, 2020
@sungmincs
Copy link
Contributor Author

/retest

1 similar comment
@sungmincs
Copy link
Contributor Author

/retest

Copy link
Contributor

@cgilmour cgilmour left a comment

Choose a reason for hiding this comment

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

My feedback (dd-opentracing-cpp maintainer) is that it looks correct (code, docs and comments) and the graph from testing show it clearly working as intended.

@aledbf
Copy link
Member

aledbf commented Jan 8, 2020

@cgilmour thank you for the review!

@aledbf
Copy link
Member

aledbf commented Jan 8, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 8, 2020
@aledbf
Copy link
Member

aledbf commented Jan 8, 2020

@dmxlsj thanks!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aledbf, dmxlsj

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 8, 2020
@k8s-ci-robot k8s-ci-robot merged commit c2d6dcd into kubernetes:master Jan 8, 2020
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants