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

core: Add new OpenCensus tags for method names #5601

Closed
wants to merge 3 commits into from

Conversation

TheMarex
Copy link

@TheMarex TheMarex commented Apr 16, 2019

This PR fixes #5593 by adding support for the new gRPC method to the CensusModule.

I think it will be necessary to have this overlap for at least one versions to give clients a chance to upgrade without breaking changes. Since gRPC already assumes OpenCensus >0.17, the required migration steps for a client would be:

  1. Upgrade gRPC to a new version >0.19 (with this change).
  2. Update applications to report the new OpenCensus gRPC Views provided by opencensus-java that use these new tags
  3. Update the frontend/dashboard to the new views
  4. Update applications to stop reporting metrics using the old OpenCensus gRPC Views

@thelinuxfoundation
Copy link

Thank you for your pull request. Before we can look at your contribution, we need to ensure all contributors are covered by a Contributor License Agreement.

After the following items are addressed, please respond with a new comment here, and the automated system will re-verify.

Regards,
CLA GitHub bot

@TheMarex TheMarex force-pushed the fix/deprecated_oc_tag_method branch from 960f3df to 232ef58 Compare April 16, 2019 16:37
@thelinuxfoundation
Copy link

Thank you for your pull request. Before we can look at your contribution, we need to ensure all contributors are covered by a Contributor License Agreement.

After the following items are addressed, please respond with a new comment here, and the automated system will re-verify.

Regards,
CLA GitHub bot

@TheMarex TheMarex changed the title Add new OpenCensus tags for method names core: Add new OpenCensus tags for method names Apr 16, 2019
@ejona86 ejona86 requested a review from zhangkun83 April 19, 2019 16:07
@ejona86
Copy link
Member

ejona86 commented Apr 19, 2019

CC @songy23, @sebright

Copy link
Contributor

@songy23 songy23 left a comment

Choose a reason for hiding this comment

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

LGTM assuming this doesn't cause performance issue.

Otherwise, consider just removing put(DeprecatedCensusConstants.RPC_METHOD, methodTag) like I mentioned in #5593 (comment).

@zhangkun83
Copy link
Contributor

@carl-mastrangelo has been profiling gRPC with Census. Unless there has been performance optimization in Census tagging, I don't expect the performance overhead to be different from the previous results. It may be better to first do the mapping mentinoed in #5593 (comment) under the hood, then migrate gRPC to the new tags.

@songy23
Copy link
Contributor

songy23 commented Apr 19, 2019

It may be better to first do the mapping mentinoed in #5593 (comment) under the hood, then migrate gRPC to the new tags.

Make sense to me, added the mapping in census-instrumentation/opencensus-java#1854. With that those who use the deprecated constants will continue getting the correct metrics.

@TheMarex
Copy link
Author

@songy23 with the change in census-instrumentation/opencensus-java#1854 in mind, should I adapt this PR to only set the non-deprecated constant?

My understanding then would be that this would mean all following gRPC versions would depend on a OpenCensus version > 0.19 - is that correct?

Thank you for looking at this so fast. 👍 Sorry about the CLA noise, figuring this out with my org.

@songy23
Copy link
Contributor

songy23 commented Apr 24, 2019

should I adapt this PR to only set the non-deprecated constant?

If there's no performance regression, I would still like to set both the deprecated and new tags. That way we can ensure both old and new RPC metrics work for all OpenCensus versions.

On the other hand if only the new tags are set, users who depend on a lower version of OpenCensus (<0.21) and use the old RPC metrics will lose data of the old "method"/"status" tag. They'll have to either migrate to the new RPC metrics, or upgrade OpenCensus to 0.21.

My understanding then would be that this would mean all following gRPC versions would depend on a OpenCensus version > 0.19 - is that correct?

That's right, census-instrumentation/opencensus-java#1854 will be released in OpenCensus 0.21.0. After the release I'll update gRPC to use the newer version.

@ejona86
Copy link
Member

ejona86 commented Apr 24, 2019

On the other hand if only the new tags are set, users who depend on a lower version of OpenCensus (<0.21) and use the old RPC metrics will lose data of the old "method"/"status" tag. They'll have to either migrate to the new RPC metrics, or upgrade OpenCensus to 0.21.

gRPC does not support users downgrading versions of our dependencies. If we require opencensus 0.21, the user can use opencensus 0.21 or newer.

@songy23
Copy link
Contributor

songy23 commented Apr 24, 2019

gRPC does not support users downgrading versions of our dependencies. If we require opencensus 0.21, the user can use opencensus 0.21 or newer.

That's great, then please hold off this PR a bit until I upgraded the OC version.

Copy link
Contributor

@songy23 songy23 left a comment

Choose a reason for hiding this comment

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

OpenCensus version is updated. Please rebase against master.

This fixes issue grpc#5593 by adding the tag `grpc_{server,client}_method`
to all default measurements. It restores compatibility with OpenCensus >=0.13
without using deprecated views.
@TheMarex TheMarex force-pushed the fix/deprecated_oc_tag_method branch from 9df7146 to e1b476a Compare May 10, 2019 17:37
@thelinuxfoundation
Copy link

Thank you for your pull request. Before we can look at your contribution, we need to ensure all contributors are covered by a Contributor License Agreement.

After the following items are addressed, please respond with a new comment here, and the automated system will re-verify.

Regards,
CLA GitHub bot

@dapengzhang0
Copy link
Member

@TheMarex please fix build failures.

igorbernstein2 added a commit to igorbernstein2/grpc-java that referenced this pull request Jul 21, 2019
Fixes grpc#5593 and supersedes grpc#5601

Now that census-instrumentation/opencensus-java#1854 has been merged & released as 0.21.0. We can start using the method & status tags.

Background:
Opencensus introduced new tags for status and method (census-instrumentation/opencensus-java#1115). The old views that used those tags were deprecated and new views were created that used the new tags. However grpc-java wasn't updated to use the new tags due to concern of breaking existing metrics. This resulted in the old views being deprecated while the new views were broken (goomics grpc#50).

census-instrumentation/opencensus-java#1854 added a compatibility layer to opencensus that would remap new tags to old tags for old views. This should unblock grpc to switching to the new tags while allowing old views to still be populated. That commit was released as part of opencensus 0.21, which grpc currently uses
@igorbernstein2
Copy link
Contributor

I propose to close this PR in favor of #5996

@TheMarex
Copy link
Author

@igorbernstein2 thanks for picking this up again. I agree, please use #5996 in favor of this.

FYI I wasn't able to figure out the CLA thing and Linux Foundation is unresponsive.

@TheMarex TheMarex closed this Jul 22, 2019
zhangkun83 pushed a commit that referenced this pull request Aug 1, 2019
Fixes #5593 and supersedes #5601

Now that census-instrumentation/opencensus-java#1854 has been merged & released as 0.21.0. We can start using the method & status tags.

Background:
Opencensus introduced new tags for status and method (census-instrumentation/opencensus-java#1115). The old views that used those tags were deprecated and new views were created that used the new tags. However grpc-java wasn't updated to use the new tags due to concern of breaking existing metrics. This resulted in the old views being deprecated while the new views were broken (goomics #50).

census-instrumentation/opencensus-java#1854 added a compatibility layer to opencensus that would remap new tags to old tags for old views. This should unblock grpc to switching to the new tags while allowing old views to still be populated. That commit was released as part of opencensus 0.21, which grpc currently uses
@lock lock bot locked as resolved and limited conversation to collaborators Oct 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenCensus grpc method is not set
7 participants