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

Plugin API: Add createChildSpan #373

Merged
merged 5 commits into from
Feb 8, 2017
Merged

Plugin API: Add createChildSpan #373

merged 5 commits into from
Feb 8, 2017

Conversation

kjin
Copy link
Contributor

@kjin kjin commented Feb 7, 2017

Introduces Transaction.prototype.createChildSpan (and api.prototype.createChildSpan). Would like to rip out runInChildSpan if possible, it no longer has a reason to be used.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 7, 2017
* span is created and propogated. @see Transaction.prototype.createChildSpan
* @returns A new ChildSpan object, or null if there is no active root span.
*/
PluginAPI.prototype.createChildSpan = function(options, fn) {

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

var transaction = this.getTransaction();
if (transaction) {
options = options || {};
var childContext = transaction.agent_.startSpan(options.name, {},
options.skipFrames ? options.skipFrames + 1 : 1);
return fn(new ChildSpan(transaction.agent_, childContext));
return new ChildSpan(transaction.agent_, childContext);

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

*/
PluginAPI.prototype.runInChildSpan = function(options, fn) {
PluginAPI.prototype.createChildSpan = function(options, fn) {

This comment was marked as spam.

This comment was marked as spam.

*/
Transaction.prototype.runInChildSpan = function(options, fn) {
Transaction.prototype.createChildSpan = function(options, fn) {

This comment was marked as spam.

This comment was marked as spam.

@kjin kjin merged commit 8d34ed4 into googleapis:master Feb 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants