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

Add opencensus library #2258

Closed
wants to merge 3 commits into from

Conversation

bianpengyuan
Copy link
Contributor

This will be used by stackdriver extension. It is a copy of opencensus-library (https://github.com/census-instrumentation/opencensus-cpp) with modification to make it fit with envoy's silo thread model and wasm API. Test is not included in this PR since code is mostly unchanged and should remain unchanged. Exporter is not included in this PR and will be added in following PR with tests.

@istio-testing
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: bianpengyuan
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: kyessenov

If they are not already assigned, you can assign the PR to them by writing /assign @kyessenov in a comment when ready.

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

@googlebot googlebot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Jun 3, 2019
@lambdai
Copy link
Contributor

lambdai commented Jun 7, 2019

It's a pain to introduce the code text. You may want to explain

  1. what the changes you made to the original code
  2. why we cannot import opencensus-cpp project as it support native bazel build
  3. How to update opencensus-cpp in the future

@lambdai
Copy link
Contributor

lambdai commented Jun 7, 2019

Maybe you don't need this PR any more: envoyproxy/envoy#5387

@kyessenov
Copy link
Contributor

@bianpengyuan can you delineate the upstream vs your changes in some straightforward fashion?
We don't need to review the upstream code, just the changes you made.

@silentdai The native extension could be used once it is exposed through WASM API. Right now it is not, so we can't access its capabilities from WASM extensions.

@lambdai
Copy link
Contributor

lambdai commented Jun 7, 2019

@kyessenov @bianpengyuan I am not arguing that there is no reference to the opencensus code. It's common pattern that introduce first and use in the future :)

I am more interested in the changes @bianpengyuan made to opencensus.

@PiotrSikora
Copy link
Contributor

@bianpengyuan are you going to upstream your changes or are we going to maintain this in-tree fork going forward?

I'm not sure how big are your changes, but perhaps you could import this library as Bazel external with patches applied locally?

@bianpengyuan
Copy link
Contributor Author

@PiotrSikora I think we are going to maintain this in-tree fork. Change is not trivial and touch whole bunch of files because opencensus library built to support multi-thread process with singleton objects, so patching is not quite ideally. In fact the whole stackdriver exporter needs to be customized to use WASM API.

The code within this PR should just remain unchanged over time unless we found bug or performance bottleneck in it. The stats part of opencensus library is pretty stable and change very little. The logic there is not very complicated so it is feasible to maintain our own fork. If one day opencensus integrates with envoy's stats system, for sure we switch from this in tree fork to that.

@bianpengyuan
Copy link
Contributor Author

@silentdai @kyessenov Sorry for the delay!

@silentdai I added a bit more text to read me about changes made to the library. As I said in the last comment it should be fine to maintain our own fork. It is like implementing our own adapter like the one in mixer.

@kyessenov Code change that needs review are

@bianpengyuan
Copy link
Contributor Author

/test proxy-presubmit-asan

1 similar comment
@bianpengyuan
Copy link
Contributor Author

/test proxy-presubmit-asan

@kyessenov
Copy link
Contributor

I find it hard to review this. I suggest to follow @PiotrSikora and structure it as a bazel fetch plus patch application.

  1. You don't really have to use envoy rules to build envoy stuff. It might be worth filing an issue in opencensus to define a macro instead of using bazel rules directly, to accommodate cases when there is a need to customize build environment.

  2. This should be another issue to provide macros in opencensus to stub out clock system calls, or provide alternative macro definitions. That's a reasonable request I think.

  3. Bazel patch should be fairly simple for changing visibility.

@bianpengyuan
Copy link
Contributor Author

@kyessenov Ack, let me try it out and see if it is feasible.

@istio-testing istio-testing added the needs-rebase Indicates a PR needs to be rebased before being merged label Jul 18, 2019
@istio-testing
Copy link
Collaborator

@bianpengyuan: PR needs rebase.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. needs-rebase Indicates a PR needs to be rebased before being merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants