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

Initial Prototype Code - Do NOT Merge #4506

Closed
wants to merge 25 commits into from

Conversation

sarangan12
Copy link
Contributor

No description provided.

Copy link
Contributor

@ramya-rao-a ramya-rao-a left a comment

Choose a reason for hiding this comment

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

Few top level observations

  • The d.ts files shouldn't be committed into the repo. Use the tsconfig.json file from either the folder sdk/template or the core-auth package. This will make the d.ts files to be generated under types folder which is ignored by git in our repo.
  • Please use the rollup config files and package.json in the sdk/template folder or the core-auth package as reference for the new core-tracing package for consistency
  • A link in the PR description to the gist that Brian had initially proposed will help

@ramya-rao-a ramya-rao-a requested review from bterlson and removed request for sadasant and sophiajt July 30, 2019 06:06
? options.parent.getSpan()
: options.parent
: undefined
: undefined;
Copy link
Contributor

@ramya-rao-a ramya-rao-a Aug 1, 2019

Choose a reason for hiding this comment

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

What do we have to gain by doing a deep check like this vs
const parent = options && options.parent

I would imagine that the very fact that this OpenCensusTracePlugin has been instantiated would mean that the parent we are getting would be the right one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is because OpenCensus does not confirm to the OpenTelemetry Standards. So, you cannot pass options.parent (which is of type OpenCensusSpanPlugin which implements Span) It needs the specific span object created by OpenCensus Library

Copy link
Contributor

Choose a reason for hiding this comment

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

If I understand this correctly, then you are saying that we need options.parent.getSpan() and not options.parent

The parent constant in the above code still points to only options.parent though...

type: {
name: "Object"
}
}
Copy link
Contributor

@ramya-rao-a ramya-rao-a Aug 1, 2019

Choose a reason for hiding this comment

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

When do we use the spanOptionsV2 instead of spanOptions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me give you an example in getKey method, when you are calling this.client.getKey, you are passing the options value as parameter. But in getDeletedKey method, when you are calling this.client.getDeletedKey, you are passing options.requestOptions. In order to handle this difference we have spanOptions & spanOptionsV2. Essentially they are the same. Only the path value where to find the spanOptions is different.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe that is a bug with the getKey method. It should be passing request options as well.
I have created a PR to fix this issue #4656
and updated the keyvault tracing PR #4654 to not have these 2 different versions of "span options" in parameters.ts file

@@ -276,12 +278,21 @@ export class KeysClient {
delete unflattenedOptions.expires;
delete unflattenedOptions.requestOptions;

const spanOptions = this.getSpanOptions(unflattenedOptions);
Copy link
Contributor

Choose a reason for hiding this comment

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

This won't get the span options because requestOptions has been deleted from the unflattenedOptions in the line before this line

return options;
}

return { ...options };
Copy link
Contributor

Choose a reason for hiding this comment

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

... only does the needful at the top most level. This will not help us we will still be using the spanOptions object set by the user

I have updated #4654 such that we use the spread operator at the right level

@ramya-rao-a
Copy link
Contributor

Closing this PR in favor of #4649 and #4654

@ramya-rao-a ramya-rao-a closed this Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants