tracing: update opencensus and googleapis, use SetName for operation name#7622
tracing: update opencensus and googleapis, use SetName for operation name#7622lizan merged 17 commits intoenvoyproxy:masterfrom
Conversation
Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
Signed-off-by: Kuat Yessenov <kuat@google.com>
|
How do we update envoy-filter-example repo in lock-step? I need to update the WORKSPACE, since I can't load googleapis rules in the existing bazel/repositories.bzl (since it loads the googleapis). |
|
Prepared envoyproxy/envoy-filter-example#94. I'm not sure how this can be done step-by-step since the two builds are coupled. |
| http_archive( | ||
| name = "io_opencensus_cpp", | ||
| patch_args = ["-p0"], | ||
| patches = ["@envoy//bazel/foreign_cc:io_opencensus_cpp.patch"], |
lizan
left a comment
There was a problem hiding this comment.
Thanks this is great, just one comment.
WORKSPACE
Outdated
|
|
||
| go_register_toolchains(go_version = GO_VERSION) | ||
|
|
||
| load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language") |
There was a problem hiding this comment.
You should be able to roll this into api_dependencies in bazel/repositories.bzl (not api/bazel/repositories.bzl).
There was a problem hiding this comment.
api_dependencies has http_archive for com_google_googleapis, so that won't work. We can't load from a repo before it's http_archive.
There was a problem hiding this comment.
and the naming is confusing. bazel/api_repositories.bzl does not actually load API repositories, so I get why one might get confused (I did).
There was a problem hiding this comment.
Hey Lizan, do you still think it's possible to add a load from googleapis without WORKSPACE change? I don't see a way, since googleapis is loaded as one of the last calls in there.
There was a problem hiding this comment.
Hmm I see what you're saying, I think we want to somehow roll this into a bzl file, @htuch do you have any idea? Just roll additional dependencies (those WORKSPACE rules after envoy_dependencies) in an additional bzl file should work but still somewhat ugly.
There was a problem hiding this comment.
Yeah I think that would work, do you mind take a stab?
There was a problem hiding this comment.
I don't understand the envoy_api hack well, I'd hope @htuch can help there. Either way, this is going to cause churn in importing repositories, even if we change from 2 calls to 3 calls.
There was a problem hiding this comment.
Yes but less churning in in the future :)
| void Span::setOperation(absl::string_view operation) { | ||
| span_.AddAnnotation("setOperation", {{"operation", operation}}); | ||
| } | ||
| void Span::setOperation(absl::string_view operation) { span_.SetName(operation); } |
There was a problem hiding this comment.
Nice!
Took a lot of Bazel magic to get this change through !
lizan
left a comment
There was a problem hiding this comment.
fix ci/WORKSPACE.filter.example to pass CI.
WORKSPACE
Outdated
|
|
||
| go_register_toolchains(go_version = GO_VERSION) | ||
|
|
||
| load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language") |
There was a problem hiding this comment.
Hmm I see what you're saying, I think we want to somehow roll this into a bzl file, @htuch do you have any idea? Just roll additional dependencies (those WORKSPACE rules after envoy_dependencies) in an additional bzl file should work but still somewhat ugly.
Signed-off-by: Kuat Yessenov <kuat@google.com>
|
Thanks for the pointer. I've updated the example filter workspace. |
|
/retest |
|
🔨 rebuilding |
Signed-off-by: Kuat Yessenov <kuat@google.com>
|
Is there any concern with this PR? We'd really benefit from this being in the upstream, since it simplifies bazel hacking in downstream projects. |
htuch
left a comment
There was a problem hiding this comment.
Thanks for the upgrade, I have a few questions.
| if "envoy_api" not in native.existing_rules().keys(): | ||
| _default_envoy_api(name = "envoy_api") | ||
|
|
||
| native.bind( |
There was a problem hiding this comment.
Do we need to still do this bind? Can we replace the bind uses inside the API tree with the canonical @com_google_apis//... labels? Same below.
There was a problem hiding this comment.
This would be fine as long as none of downstream envoy repositories refer to the bind. I don't have confidence that is the case, so I left it as-is for backwards compatibility reasons.
There was a problem hiding this comment.
I'm happy to say "go ahead" on this, we don't provide stability guarantees around WORKSPACE and you're moving towards the long-term stable canonical naming convention in Bazel.
This is where recursive workspaces would be great.
There was a problem hiding this comment.
Unfortunately, grpc_json_transcoder depends on this binding, so I can't remove it without making changes to that repository. Can this be done later since we'll have to make changes to other repositories first?
There was a problem hiding this comment.
Ack, can you file an issue for cleanup here and tag the site with TODO?
|
@lizan I still don't get what you are trying to suggest. Bazel requires |
Signed-off-by: Kuat Yessenov <kuat@google.com>
|
/retest |
|
🔨 rebuilding |
Signed-off-by: Kuat Yessenov <kuat@google.com>
|
My intention was rolling everything after Line 11 in e0cae9c .bzl file where you can load bzl from repositories which are already loaded by envoy_dependencies, thus we have smaller WORKSPACE` and future changes can just made there.
|
|
@lizan @kyessenov I would be in favor of shrinking down to the smallest possible WORKSPACE. The question is how few lines can we get away with. @kyessenov is correct that to I.e. can we arbitrarily reorder the |
load("//bazel:api_binding.bzl", "envoy_api_binding")
load("//bazel:api_repositories.bzl", "envoy_api_dependencies")
envoy_api_binding()
envoy_api_dependencies()gives an error: I guess the answer is no, the order of |
|
Crap, I see the issue. We have @lizan I don't think we can do this in a @dslomov this seems to be a pretty big limitation without recursive workspaces. I recall that recurisve workspaces had issues, do you have the latest best practice here? |
|
@htuch @kyessenov this is what I meant (and it works): e45ad99 so we only have 3 load + function calls, and the WORKSPACE shouldn't grow more... |
|
@lizan What happens when we need to import from something loaded in |
|
Yeah it is theoretically possible, but I think this is best we can have before recursive workspace. I don't think we should or want to have an external dependency with that complexity (i.e. 3-level dependency from) by then. |
Signed-off-by: Kuat Yessenov <kuat@google.com>
|
@lizan updated to make workspaces smaller. |
|
Do we still need the api_binding / api_dependencies split? I'm fine with the renaming original api_dependencies -> api_binding, but the split seems unnecessary. |
|
I'd prefer to keep api_dependencies distinct from dependencies since I want to be able to build just APIs. The binding trick should also be kept separate since I may not want to do the local bind that envoy does. Since any two of the three things cannot be placed into one bzl file, I think it's fair to keep them separate. |
lizan
left a comment
There was a problem hiding this comment.
I'd prefer to keep api_dependencies distinct from dependencies since I want to be able to build just APIs. The binding trick should also be kept separate since I may not want to do the local bind that envoy does. Since any two of the three things cannot be placed into one bzl file, I think it's fair to keep them separate.
OK that's fair.
bazel/dependency_imports.bzl
Outdated
| load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") | ||
| load("@envoy//bazel/toolchains:rbe_toolchains_config.bzl", "rbe_toolchains_config") | ||
|
|
||
| def envoy_dependency_imports(go_version = "1.12.5"): |
There was a problem hiding this comment.
just move GO_VERSION from bazel/repositories.bzl to here? It is not used anywhere else.
Signed-off-by: Kuat Yessenov <kuat@google.com>
|
I believe these changes broke envoy-filter-example (as well as our internal projects that use a similar workspace to envoy-filter-example). As of this PR being out envoy-filter-example & others now fail with: Even with applying the PR: envoyproxy/envoy-filter-example#94 locally, it still fails to build. |
|
Please take a look at the diff in ci/WORKSPACE.filter.example for the change required in the workspace. You can read the discussion above about why it is hard to keep it backwards compatible. |
|
Yeah, I missed that originally, but it was mentioned in slack. There’s now a PR to the filter example that fixed it, and we’ve fixed internally. Sorry for missing that! |
Description:
Un-pin opencensus and googleapis to use master versions
Use SetName span method to set route operation names (aligning with other tracers).
Risk Level: low
Testing: Unit tests
Docs Changes: None
Release Notes: None