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

Activity integration #1498

Merged
merged 11 commits into from
Dec 1, 2021
Merged

Activity integration #1498

merged 11 commits into from
Dec 1, 2021

Conversation

gregkalapos
Copy link
Contributor

@gregkalapos gregkalapos commented Sep 22, 2021

Solves: #1521

Integration with System.Diagnostics.Activity - aka OpenTelemetry bridge.

With this, the agent will automatically listen for Activitys and turn those into Spans.

@gregkalapos gregkalapos self-assigned this Sep 22, 2021
@gregkalapos gregkalapos marked this pull request as draft September 22, 2021 11:13
@AlexanderWert AlexanderWert linked an issue Oct 14, 2021 that may be closed by this pull request
@gregkalapos gregkalapos marked this pull request as ready for review November 10, 2021 20:19
@apmmachine
Copy link
Contributor

apmmachine commented Nov 10, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2021-12-01T18:56:57.054+0000

  • Duration: 86 min 47 sec

  • Commit: de2eb40

Test stats 🧪

Test Results
Failed 0
Passed 20135
Skipped 134
Total 20269

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run benchmark tests : Run the benchmark test.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Contributor

@russcam russcam left a comment

Choose a reason for hiding this comment

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

I've gone through the PR and left some comments

@@ -10,6 +10,10 @@
using Elastic.Apm;
using Elastic.Apm.Api;

#if NET5_0
using OpenTelemetry.Trace;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we keep all of the OpenTelemetry samples in the OpenTelemetrySample project?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed - removed from here.

static void Main(string[] args)
{
Agent.Setup(new AgentComponents());
new OTSamples().Sample1();
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like these can all be static methods?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think this matters - changed it.


namespace Elastic.Apm.OpenTelemetry
{
public class ElasticActivityListener
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this implement IDisposable, to dispose the listener on disposal?

Comment on lines 68 to +73
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="4.5.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="4.5.0" />
</ItemGroup>
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe combine into <ItemGroup Condition="'$(TargetFramework)' != 'net461'"> ?

@gregkalapos
Copy link
Contributor Author

Most points are addressed from the review - in the last weekly we discussed this and agreed that we'll merge, so we can have this out as beta.

@gregkalapos gregkalapos merged commit 2471a10 into elastic:master Dec 1, 2021
@gregkalapos gregkalapos deleted the ActivityListener branch December 1, 2021 20:24
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.

[META 524] OpenTelemetry Bridge
3 participants