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

[Core] - Move core-tracing to @opentelemetry/api 0.20.0 #15672

Merged
merged 8 commits into from
Jun 18, 2021

Conversation

maorleger
Copy link
Member

@maorleger maorleger commented Jun 10, 2021

What

  • Bump @opentelemetry/api to 0.20.0 in @azure/core-tracing
  • Move all packages that are on core-http to the next core-tracing version
  • Remove version collision check from the tracer cache

Why

This is part of our effort to move everyone to OTel 0.20.0 - but we have to stage it due to a transitive dependency and a breaking change in OTel. This PR updates core-tracing to use the latest OTel, fixes any breaking changes, and moves packages that we can move to the latest version of core-tracing.

Once core-rest-pipeline 1.1.0 is GA'd we'll be able to move the rest of the packages over to the latest core-tracing as well.

Removing the version collision came out of an offline discussion after these changes were reviewed - since it's a common source of pain and hasn't added much benefit (tracer conflicts incompatibility was never a problem) we decided to remove that logic
and always grab a unique symbol per OT compatibility.

Callouts

The packages that are already on core-v2 will not be upgraded at this time - we'll coordinate that with the GA of core-rest-pipeline 1.1.0

@ghost ghost added Azure.Core App Configuration Azure.ApplicationModel.Configuration Azure.Identity KeyVault Monitor Monitor, Monitor Ingestion, Monitor Query labels Jun 10, 2021
@check-enforcer
Copy link

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

@maorleger
Copy link
Member Author

/check-enforcer evaluate

@richardpark-msft
Copy link
Member

richardpark-msft commented Jun 11, 2021

Looks good (and thankfully the source level changes are minimal, unlike last time).

One other thing is to update for the core-tracing/cache.ts.

You probably want to do this sooner, rather than later, so it'll be in place when you run some of the live test pipelines.

CC: @xirzec

@maorleger
Copy link
Member Author

maorleger commented Jun 11, 2021

@xirzec @richardpark-msft thanks Richard for the reminder!

I made a few changes there to make it easier to catch early:

  • match the GLOBAL_TRACER_VERSION to @opentelemetry/api version (made it a string, assuming it can be as long as it's unique but let me know if otherwise!).
  • Inferred the GLOBAL_TRACER_SYMBOL from GLOBAL_TRACER_VERSION just to keep to one place to change.
  • added a test to ensure we can catch this in the future.

I'm hoping these changes are ok to make, but please let me know if that's not quite right or if you have suggestions

@maorleger maorleger force-pushed the core-tracing-0-20-partial branch 2 times, most recently from ff81d06 to c73087e Compare June 11, 2021 23:23
@maorleger maorleger changed the title WIP [Core] - Move core-tracing to @opentelemetry/api 0.20.0 Jun 11, 2021
@maorleger maorleger marked this pull request as ready for review June 11, 2021 23:53
@maorleger maorleger requested review from XiaoningLiu, xirzec and a team as code owners June 11, 2021 23:53
Copy link
Member

@deyaaeldeen deyaaeldeen left a comment

Choose a reason for hiding this comment

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

I reviewed the PR and it looks good to me, thanks for upgrading us!

I will defer to @richardpark-msft for approval.

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'm glad the actual changes are pretty minor!

This also reminded me to file #15732

sdk/core/core-tracing/src/utils/cache.ts Outdated Show resolved Hide resolved
sdk/core/core-tracing/test/cache.spec.ts Outdated 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.

Left a code change comment, but also just made an interesting discovery...

import * as fs from "fs";
import * as path from "path";

const validOpenTelemetryVersions = ["1.0.0-rc1", "0.20.0"];
Copy link
Member

Choose a reason for hiding this comment

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

I just noticed that it looks like 1.0 has shipped: https://www.npmjs.com/package/@opentelemetry/api/v/1.0.0

Should we just update to that and GA this package instead? :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh wow! Oh wow! Oh wow!

Copy link
Contributor

Choose a reason for hiding this comment

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

But 1.0.0 has the next tag... and 0.20.0 has the latest tag

@maorleger maorleger requested a review from xirzec June 17, 2021 16:22
@maorleger maorleger force-pushed the core-tracing-0-20-partial branch 3 times, most recently from 0389954 to 6a29b3a Compare June 17, 2021 23:32
@maorleger
Copy link
Member Author

@xirzec I addressed the feedback and implemented the changes we discussed offline (removal of the version collision runtime check and adding a sanity check in test to ensure future us remembers to think about compatibility) - any concerns with the latest changes? If not, should we merge this in?

Especially wanted to call out the cache.ts changes which, while simplifying the code, could use some extra scrutiny 😄

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.

Bravo! 👏

} from "@azure/core-tracing";
import { tracingPolicy } from "../../src/policies/tracingPolicy";

class MockSpan extends NoOpSpan {
class MockSpan implements Span {
Copy link
Member

Choose a reason for hiding this comment

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

much simpler! Good discovery here

@maorleger maorleger merged commit d023204 into Azure:main Jun 18, 2021
@maorleger maorleger deleted the core-tracing-0-20-partial branch June 18, 2021 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App Configuration Azure.ApplicationModel.Configuration Azure.Core Azure.Identity KeyVault Monitor Monitor, Monitor Ingestion, Monitor Query
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants