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

Refactor tracing implements #312

Closed
wants to merge 4 commits into from
Closed

Conversation

XSAM
Copy link
Contributor

@XSAM XSAM commented Jun 30, 2020

Split from #275

  • Add tracing interceptor.
  • Add opentracing provider.
  • Add opentelemetry provider.

@codecov-commenter
Copy link

codecov-commenter commented Jun 30, 2020

Codecov Report

Merging #312 into v2 will decrease coverage by 6.54%.
The diff coverage is 69.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##               v2     #312      +/-   ##
==========================================
- Coverage   83.58%   77.03%   -6.55%     
==========================================
  Files          30       30              
  Lines         932      932              
==========================================
- Hits          779      718      -61     
- Misses        114      168      +54     
- Partials       39       46       +7     
Impacted Files Coverage Δ
chain.go 0.00% <ø> (-90.91%) ⬇️
interceptors/tags/fieldextractor.go 84.84% <ø> (-0.45%) ⬇️
interceptors/logging/payload.go 83.07% <50.00%> (+0.46%) ⬆️
interceptors/retry/retry.go 67.74% <72.72%> (-8.51%) ⬇️
wrappers.go 66.66% <0.00%> (-33.34%) ⬇️
interceptors/retry/options.go 73.17% <0.00%> (-7.32%) ⬇️

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 880c174...0c87891. Read the comment docs.

@XSAM
Copy link
Contributor Author

XSAM commented Jun 30, 2020

@bwplotka I need some review to confirm the tracing interface since it implements parts of interceptors.Reporter. 😁

Copy link
Collaborator

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

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

Hey, can we mention what is high lvl plan here? If I understand correctly it is required to have both opentelemetry and opentracing, right?

TBH in this case I would first add opentelemetry package and check if have anything to reuse between those two or not.

Problem with this is that opentracing and opentelemetry are actually interfaces. So creating an interface that fits both might be an overkill. What do you think? (:

interceptors/tracing2/interceptors.go Outdated Show resolved Hide resolved
@XSAM
Copy link
Contributor Author

XSAM commented Jul 3, 2020

Well, opentracing and OTEL (opentelemtry) do have a familiar interface of span to record events.

opentracing: LogFields, OTEL: AddEvent.

But the problem is the behavior from two libs are not the same while handling PostMsgSend and PostMsgReceive.

For instance, when invoking PostMsgSend, opentracing will do nothing with LogFields since it doesn't require to record gRPC message info, but OTEL will record that info via AddEvent.

Furthermore, attributes which been using in the event are different.

OTEL:

span.AddEvent(ctx, "message",
	kv.Key("message.type").String("SENT"),
	kv.Key("message.id").Int(id),
	kv.Key("message.uncompressed_size").Int(proto.Size(body)),
)

So, I think there are two solutions to this.

  1. Add AddEvent function for span interface. But it will force opentracing to add the same key and attributes to events like OTEL, or opentracing have to do some weird mapping to drop these non-standard events.

  2. Add PostMsgSend and PostMsgReceive for span interface. Weird but more flexible.


@bwplotka
Copy link
Collaborator

Hi @XSAM Let's get back to this!

I feel like option number 2 is too similar too reporter, so kind of no point in having separate span interface, no? (:

That's why we have two options I think

  1. as your 1, we could try that.

  2. Actually have no common interface among those, just have 2 different providers/opentelemetryandproviders/opentracing` ^^

@XSAM XSAM force-pushed the feature/tracing branch 2 times, most recently from 0ddf726 to 0590b70 Compare August 3, 2020 09:32
@XSAM XSAM changed the title [WIP] Add tracing interface and move opentracing to provides Add tracing interface and move opentracing to provides Aug 3, 2020
@XSAM
Copy link
Contributor Author

XSAM commented Aug 3, 2020

You're right, option 2 is too similar with interceptors.Reporter.

Now, I use option 1 as a solution.

@yashrsharma44
Copy link
Collaborator

Seems like this PR would address #277 . @XSAM can you let us know if you are interested in working on rebasing this PR and meeting the acceptance criteria? Would be happy to take over this PR, otherwise 😄

Related Issue - #277

@XSAM
Copy link
Contributor Author

XSAM commented Apr 24, 2021

@yashrsharma44 I will continue to work on this PR. Thanks for the reminder. 😄

@XSAM XSAM changed the title Add tracing interface and move opentracing to provides Refactor tracing implements May 6, 2021
@XSAM XSAM force-pushed the feature/tracing branch from 0590b70 to 92da0ba Compare May 6, 2021 09:14
@XSAM
Copy link
Contributor Author

XSAM commented May 6, 2021

I updated this PR. @yashrsharma44 @bwplotka PTAL ;)

This PR seems huge and not easy to review. I can split this if you prefer.

@XSAM
Copy link
Contributor Author

XSAM commented May 25, 2021

Any updates on this one?

@yashrsharma44
Copy link
Collaborator

yashrsharma44 commented Jul 14, 2021

Hi @XSAM!
Extremely sorry for the late review, I was busy with my internship requirements, so wasn't able to take a look at the PR.

  • Can you split the changes for -
    • Add tracing interceptor.
    • Add opentracing provider.
    • Add opentelemetry provider.

in a separate PR? Would be easy to review the changes.

I would be happy to review the changes and help you out in finishing up a subpart, in case you don't have time to address all 😄

@bwplotka
Copy link
Collaborator

bwplotka commented Aug 6, 2021

I think it's actually reviewable, in one place as those are new things mostly. But it will take time.

Still, I think we should do it before v2?

@bwplotka
Copy link
Collaborator

bwplotka commented Aug 7, 2021

Are you around @XSAM to work on it (rebase etc)?

Also I am removing tracing here, to avoid modifications there that will have to be there as part of this Pr anyway (#394 (comment))

@XSAM
Copy link
Contributor Author

XSAM commented Aug 7, 2021

Are you around @XSAM to work on it (rebase etc)?

Also I am removing tracing here, to avoid modifications there that will have to be there as part of this Pr anyway (#394 (comment))

Sorry for the late response, I was busy recently.

I'm still working on it; will try to split these changes for clarity.

@XSAM XSAM mentioned this pull request Aug 8, 2021
@XSAM XSAM mentioned this pull request May 5, 2022
@XSAM XSAM mentioned this pull request Jun 8, 2022
@XSAM XSAM closed this Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants