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 methods to create wrapped executor with new span #71

Merged
merged 5 commits into from
Feb 21, 2019
Merged

Add methods to create wrapped executor with new span #71

merged 5 commits into from
Feb 21, 2019

Conversation

pkoenig10
Copy link
Member

@pkoenig10 pkoenig10 commented Feb 8, 2019

Fixes #63

This PR preserves the existing executor wrapping methods and their behavior. So users must explicitly opt-in to the new span-creating behavior.

This is no longer true. The existing executor methods will now create a new span for tasks they run.

@pkoenig10 pkoenig10 requested a review from a team as a code owner February 8, 2019 23:37
@pkoenig10 pkoenig10 changed the title Spans Add methods to create wrapped executor with new span Feb 8, 2019
@diogoholanda
Copy link
Contributor

What's the concern around making this the default behavior if it is generally useful? Are there any potential concerns?

@pkoenig10
Copy link
Member Author

Making it the default behavior would require changing the API to also take an operation.

I would prefer to deprecate the old methods. I just wanted to get some agreement that this is the desired outcome.

@pkoenig10
Copy link
Member Author

@dansanduleac how do you feel about deprecating the old methods?

@pkoenig10
Copy link
Member Author

An alternative is to keep the old methods but use the default "root" span operation. However this probably isn't very useful since seeing a "root" span operation can be confusing.

@diogoholanda
Copy link
Contributor

I would actually challenge that. I would suggest making the operation not configurable, and simply something like "executor-wrapped-task". If someone wants to have an operation name, they can always create a new span themselves.

In the end, what we are trying to get from this feature is the knowledge of when the task actually run, so the operation name does not really matter and it is better to everyone to have the better behaviour by default.

Does that make sense?

@pkoenig10
Copy link
Member Author

I disagree. I think having a default span name that will be used for all executors will quickly become confusing when you have more than one executor.

Ideally users will want to identify these spans. Requiring them to wrap a task twice just to get useful names (with no way to remove the unhelpful default name) does not seems like the right solution here.

@diogoholanda
Copy link
Contributor

diogoholanda commented Feb 18, 2019

Why do you need to identify the executor that wrapped a task?
Is the assumption that a single task can be wrapped by multiple different executors and you want to know which one wrapped a given execution of the task?
That seems somewhat contrived.

Can you give me an explicit workflow in which a constant operation is not enough?

All that said, if you really feel strongly, we could allow the operation name to be configurable, but allowing for a default constant one in case you did not opt-in for overriding it seems much more beneficial than giving you no span at all until you sign in for it.

@diogoholanda
Copy link
Contributor

I don't mind making the operation name configurable. I guess it can be useful if you want to search for spans of a specific wrap.
Just arguing here for a different behavior in case the operation name is not provided

this(Optional.empty());
}

public DeferredTracer(@CompileTimeConstant String operation) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove CompileTimeConstant

Copy link
Contributor

Choose a reason for hiding this comment

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

(because it's reasonable for this to not be a compiletimeconstant, and it is overly onerous for downstream developers)

@pkoenig10
Copy link
Member Author

Thoughts on adding a default span operation for the existing executor methods? It seems like a reasonable approach to me I just want to make sure we're willing to make that behavior change.

@diogoholanda
Copy link
Contributor

I would welcome that

@dansanduleac
Copy link
Contributor

👍

@bulldozer-bot bulldozer-bot bot merged commit b75b467 into palantir:develop Feb 21, 2019
@pkoenig10 pkoenig10 deleted the spans branch February 21, 2019 19:44
bulldozer-bot bot pushed a commit that referenced this pull request Mar 7, 2019
## Before this PR
In #71, all wrapped executor tasks had spans added by default. This was pretty noisy for tasks that were already doing their own wrapping.

## After this PR
If wrapping is not explicitly requested, it is not done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants