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

Updated MassTransit instrumentation to OpenTelemetry 1.0 #85

Merged
merged 5 commits into from
Mar 15, 2021

Conversation

alexvaluyskiy
Copy link
Contributor

@alexvaluyskiy alexvaluyskiy commented Mar 10, 2021

This PR upgrades the MassTransit instrumentation to OTel version 1.0.2

@alexvaluyskiy alexvaluyskiy requested a review from a team March 10, 2021 19:48
@alexvaluyskiy
Copy link
Contributor Author

One test, related to trace filtering is failing (I will investigate why). But the rest of the PR is ready to review

Copy link
Member

@cijothomas cijothomas 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 from the perspective of removing ActivitySourceAdapter and leveraging AddLegacySource feature.

Not MT expert to offer deeper review :)

@codecov
Copy link

codecov bot commented Mar 10, 2021

Codecov Report

Merging #85 (21e1739) into main (8323c83) will decrease coverage by 0.02%.
The diff coverage is 80.48%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #85      +/-   ##
==========================================
- Coverage   77.55%   77.52%   -0.03%     
==========================================
  Files          51       52       +1     
  Lines        1430     1455      +25     
==========================================
+ Hits         1109     1128      +19     
- Misses        321      327       +6     
Impacted Files Coverage Δ
...mentation/MassTransitInstrumentationEventSource.cs 37.50% <37.50%> (ø)
...it/Implementation/MassTransitDiagnosticListener.cs 93.97% <85.71%> (-3.25%) ⬇️
...entation.MassTransit/MassTransitInstrumentation.cs 100.00% <100.00%> (+22.22%) ⬆️
...ion.MassTransit/TracerProviderBuilderExtensions.cs 90.90% <100.00%> (+10.90%) ⬆️

@alexvaluyskiy
Copy link
Contributor Author

@cijothomas any blockers for this PR?

@cijothomas
Copy link
Member

@cijothomas any blockers for this PR?

Would you update codeowners file to list yourself as an approver for the MassTransit instrumentation? Similar to this https://github.com/open-telemetry/opentelemetry-dotnet-contrib/blob/main/CODEOWNERS#L12

@alexvaluyskiy
Copy link
Contributor Author

@cijothomas done

}

public override void OnStopActivity(Activity activity, object payload)
{
if (this.options.TracedOperations != null && !this.options.TracedOperations.Contains(activity.OperationName))
{
MassTransitInstrumentationEventSource.Log.RequestIsFilteredOut(activity.OperationName);
Copy link
Member

Choose a reason for hiding this comment

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

nit: RequestIsFilteredOut doesn't sound the apt name here.

}
catch (Exception ex)
{
MassTransitInstrumentationEventSource.Log.EnrichmentException(ex);
Copy link
Member

Choose a reason for hiding this comment

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

nit: This error message seem to indicate an error occuring in some user defined Enrich function. Given this is an internal transformation error, please rename the method and log message accordingly.

Copy link
Member

@cijothomas cijothomas left a comment

Choose a reason for hiding this comment

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

Left some non-blocking comments, please try to address them in a future PR.
Also it'd be good to get a changelog.md file initiated for this project.

@cijothomas cijothomas merged commit 3bac8e7 into open-telemetry:main Mar 15, 2021
@alexvaluyskiy alexvaluyskiy deleted the feature/masstransit_1_0 branch March 15, 2021 19:51
@alexvaluyskiy
Copy link
Contributor Author

@cijothomas thank you. I will fix remaining comments in the next pull requests.
What actions should be performed to release this instrumentation to nuget?

@cijothomas
Copy link
Member

@alexvaluyskiy The release is manual, and one of the maintainers have to do it now.
@srprash Did you get a chance to document the process for releasing from this repo?

(@CodeBlanch did a manual release for wcf last week, but we need to list the process and (then automate))

@alexvaluyskiy
Copy link
Contributor Author

But I think, we have to wait for OpenTelemetry 1.0.2 release first

@cijothomas
Copy link
Member

But I think, we have to wait for OpenTelemetry 1.0.2 release first

yea. we'll likely name it (OpenTelemetry .SDK)1.1.0-beta1 before pushing to nuget.org.

@CodeBlanch
Copy link
Member

The release process I used for WCF...

Setup

  • Pick your favorite workflow from .github/workflows and copy/rename for your project. Update the workflow name, project name, and tag prefix. I wish we didn't have to copy/paste like this, but I looked around and github workflows don't support templates yet (from what I could tell).

  • In your csproj add <MinVerTagPrefix>Instrumentation.Wcf-</MinVerTagPrefix> except with the tag prefix you picked. The tag prefix here needs to match what's in the workflow (minus wildcard).

Release

  • Push a tag to opentelemetry-dotnet-contrib using the tag prefix you selected and the version you want to release. It is a good idea to check with @cijothomas for the version to use because if you make a mistake you have to unlist the package and we can never use that version again.

    $ git tag -a Instrumentation.Wcf-1.0.0-rc1 -m Instrumentation.Wcf-1.0.0-rc1
    $ git push origin Instrumentation.Wcf-1.0.0-rc1

    I usually work on a fork of opentelemetry-dotnet-contrib but I ran those commands directly against a clone of the main repo. I'm sure there is a way to add tag on the fork origin and push to upstream, but I'm kind of git CLI newb so I went this route.

  • The tag should kick off an automatic run of the workflow you configured. Check the "Actions" tab on GitHub. Wait for it to complete.

  • The output of the workflow will be attached automatically to the run. Download it right from the GitHub UI.

  • Upload the .nupkg and .snupkg from the downloaded zip to NuGet. For me NuGet automatically populated everything correctly. You need to have access on NuGet to do this.

@cijothomas
Copy link
Member

thanks @CodeBlanch
@srprash Please take a look at the steps Mikel followed above, when you writing releasing doc. This is missing the Github release, so we need to add that too.

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.

5 participants