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

[eventhubs] - Upgrade Event Hubs to core-tracing preview.14 #20240

Merged
merged 2 commits into from
Feb 15, 2022

Conversation

maorleger
Copy link
Member

@maorleger maorleger commented Feb 7, 2022

Packages impacted by this PR

@azure/event-hubs
@azure/test-utils

Issues associated with this PR

#20213

Describe the problem that is addressed by this PR

Now that @azure/core-tracing@preview.14 is out, and hopefully the last version before GA, we need to upgrade a few packages in order to dogfood both the upgrade experience and the usage of these packages with the new instrumentation package.

My goal was to upgrade one AMQP package and a few HTTP packages in addition to core-rest-pipeline to collect feedback.

Upgrading EventHubs now allows us to start using the new APIs in a client package.

What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?

Haven't decided if this should be merged or if we should just publish to NPM under a custom tag in order to allow customers to dogfood. I know there's an internal IoT Hub engineer that is interested in helping out so we just need something for them to try.

Right now though I am leaning towards merging this in.

I also decided to dump all the parentSpan legacy stuff - there really isn't a need to maintain tracing backwards compat with an option that has not been used in over 6 months.

Are there test cases added in this PR? (If not, why?)

Lots and lots

Provide a list of related PRs (if any)

Command used to generate this PR:**(Applicable only to SDK release request PRs)

Checklists

  • Added impacted package name to the issue description
  • Does this PR needs any fixes in the SDK Generator?** (If so, create an Issue in the Autorest/typescript repository and link it here)
  • Added a changelog (if necessary)
  • Create a follow-up issue with additional validations (ignoreDuplicateSpanNames, expectedSpanAttributes, expectedSpanKind, etc)

@ghost ghost added the Event Hubs label Feb 7, 2022
@check-enforcer
Copy link

check-enforcer bot commented Feb 7, 2022

This pull request is protected by Check Enforcer.

What is Check Enforcer?

Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass.

Why am I getting this message?

You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged.

What should I do now?

If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows:
/check-enforcer evaluate
Typically evaulation only takes a few seconds. If you know that your pull request is not covered by a pipeline and this is expected you can override Check Enforcer using the following command:
/check-enforcer override
Note that using the override command triggers alerts so that follow-up investigations can occur (PRs still need to be approved as normal).

What if I am onboarding a new service?

Often, new services do not have validation pipelines associated with them, in order to bootstrap pipelines for a new service, you can issue the following command as a pull request comment:
/azp run prepare-pipelines
This will run a pipeline that analyzes the source tree and creates the pipelines necessary to build and validate your pull request. Once the pipeline has been created you can trigger the pipeline using the following comment:
/azp run js - [service] - ci

@azure-sdk
Copy link
Collaborator

API changes have been detected in @azure/event-hubs. You can review API changes here

API changes

-     parentSpan?: Span | SpanContext;

@azure-sdk
Copy link
Collaborator

API changes have been detected in @azure/core-amqp. You can review API changes here

API changes

+     readonly messageState: "x-opt-message-state";

@azure-sdk
Copy link
Collaborator

API changes have been detected in @azure/core-auth. You can review API changes here

@azure-sdk
Copy link
Collaborator

API changes have been detected in @azure/core-client. You can review API changes here

API changes

+ export interface AdditionalPolicyConfig {
+     policy: PipelinePolicy;
+     position: "perCall" | "perRetry";
+ }
+ export declare function authorizeRequestOnClaimChallenge(onChallengeOptions: AuthorizeRequestOnChallengeOptions): Promise<boolean>;
+     additionalPolicies?: AdditionalPolicyConfig[];
- export declare type RawResponseCallback = (rawResponse: FullOperationResponse, flatResponse: unknown) => void;
+ export declare type RawResponseCallback = (rawResponse: FullOperationResponse, flatResponse: unknown, error?: unknown) => void;

@azure-sdk
Copy link
Collaborator

API changes have been detected in @azure/core-http. You can review API changes here

@azure-sdk
Copy link
Collaborator

API changes have been detected in @azure/core-rest-pipeline. You can review API changes here

@azure-sdk
Copy link
Collaborator

API changes have been detected in @azure/core-lro. You can review API changes here

@maorleger maorleger marked this pull request as ready for review February 9, 2022 00:38
@maorleger maorleger changed the title Upgrade eventhubs [eventhubs] - Upgrade Event Hubs to core-tracing preview.14 Feb 9, 2022
@maorleger
Copy link
Member Author

maorleger commented Feb 9, 2022

@maorleger
Copy link
Member Author

/azp run js - event-hubs - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

*
* @internal
*/
export function convertTryAddOptionsForCompatibility(tryAddOptions: TryAddOptions): TryAddOptions {
Copy link
Member Author

@maorleger maorleger Feb 9, 2022

Choose a reason for hiding this comment

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

What this does if I understand it correctly is that it supports a few obsolete span parenting options.

In general our policy has been that it's unnecessary to keep backwards compat for tracing options, which is what this function does, at least while tracing is in preview. parentSpan hasn't been a thing in quite some time, neither has spanOptions, and we rely exclusively on tracingContext throughout our code. I think it's safe to file this away but if you strongly disagree let me know

sdk/eventhub/event-hubs/src/eventDataBatch.ts Show resolved Hide resolved
Copy link
Member

@xirzec xirzec left a comment

Choose a reason for hiding this comment

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

I like the changes here! My only dream (if it's not too messy) is a way to trim the Spans off the public shape of batch so we don't need to enforce them.

Copy link
Member

@xirzec xirzec left a comment

Choose a reason for hiding this comment

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

Whoops I didn't see that _messageSpanContexts got removed here: 6b7e478

So I'm good now!

Copy link
Member

@HarshaNalluru HarshaNalluru left a comment

Choose a reason for hiding this comment

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

Looks good overall. 🎉
Just asking a few questions/doubts, might be dumb, asking anyway. 😎

@ramya-rao-a
Copy link
Contributor

Can we have a changelog entry please?

Copy link
Member

@jeremymeng jeremymeng left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for the simplified testing!

@maorleger
Copy link
Member Author

Can we have a changelog entry please?

Added - would love some feedback if there's changes I should make

@maorleger maorleger merged commit af70569 into Azure:main Feb 15, 2022
maorleger added a commit that referenced this pull request Feb 17, 2022
### Packages impacted by this PR
@azure/data-tables

### Issues associated with this PR
- #20213
- #5607 

### Describe the problem that is addressed by this PR
Now that @azure/core-tracing@preview.14 is out, and hopefully the last version
before GA, we need to upgrade a few packages in order to dogfood both the
upgrade experience and the usage of these packages with the new instrumentation package.

My goal was to upgrade one AMQP package and a few HTTP packages in addition to 
core-rest-pipeline to collect feedback.

Upgrading Data Tables now allows us to start using the new APIs in a client package.

### Provide a list of related PRs _(if any)_
- #20240
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.

6 participants