Skip to content

Expose Db and Http on Span.Context via the Public Agent API#149

Merged
gregkalapos merged 3 commits intoelastic:masterfrom
gregkalapos:ExposeSpanContext
Mar 20, 2019
Merged

Expose Db and Http on Span.Context via the Public Agent API#149
gregkalapos merged 3 commits intoelastic:masterfrom
gregkalapos:ExposeSpanContext

Conversation

@gregkalapos
Copy link
Copy Markdown
Contributor

@gregkalapos gregkalapos commented Mar 18, 2019

Finishing #124.

We already expose Transaction.Context (and stuff on Context), that was done in #134.

In this PR we expose Span.Context (and stuff on `Context).

The approach is the same: as agreed in #124 we simply expose the API defined by the APM Server. No intermediate layer, just a 1-1 mapping of the server json schema to .NET.

@gregkalapos gregkalapos self-assigned this Mar 18, 2019
@codecov-io
Copy link
Copy Markdown

codecov-io commented Mar 18, 2019

Codecov Report

Merging #149 into master will increase coverage by 0.74%.
The diff coverage is 97.36%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #149      +/-   ##
==========================================
+ Coverage   83.99%   84.74%   +0.74%     
==========================================
  Files          41       45       +4     
  Lines        1281     1324      +43     
  Branches      210      216       +6     
==========================================
+ Hits         1076     1122      +46     
+ Misses        124      121       -3     
  Partials       81       81
Impacted Files Coverage Δ
...astic.Apm/Config/EnvironmentConfigurationReader.cs 100% <100%> (ø)
src/Elastic.Apm/Config/ConfigConsts.cs 100% <100%> (ø) ⬆️
src/Elastic.Apm/Api/Request.cs 100% <100%> (ø) ⬆️
...c/Elastic.Apm.AspNetCore/ApmMiddlewareExtension.cs 45.16% <100%> (ø) ⬆️
src/Elastic.Apm.AspNetCore/ApmMiddleware.cs 87.14% <100%> (+3.8%) ⬆️
src/Elastic.Apm/Api/Response.cs 100% <100%> (ø) ⬆️
...Apm.AspNetCore/Config/MicrosoftExtensionsConfig.cs 77.5% <100%> (+1.18%) ⬆️
.../Elastic.Apm/Config/AbstractConfigurationReader.cs 65.48% <80%> (+1.59%) ⬆️
src/Elastic.Apm/Api/Database.cs 100% <0%> (ø)
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1c51410...5d63208. Read the comment docs.

[Fact]
public void FillSpanContext()
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Redundant new line :) ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

👍 fixed

@gregkalapos
Copy link
Copy Markdown
Contributor Author

Retriggering build.

Sometimes on Windows the installation of the .net tools seems to fail and our builds fail with

[2019-03-20T14:52:21.830Z] C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-149\src\github.com\elastic\apm-agent-dotnet>dotnet build 
[2019-03-20T14:52:21.830Z] 'dotnet' is not recognized as an internal or external command,
[2019-03-20T14:52:21.830Z] operable program or batch file.

cc @kuisathaverat

@gregkalapos gregkalapos merged commit 9fad583 into elastic:master Mar 20, 2019
@kuisathaverat
Copy link
Copy Markdown
Contributor

It fails to download the dotnet zip file, I'll change the wait it is installed because I found another better, I'd make it when I implemented the upload to NuGet.

[2019-03-20T14:52:19.521Z] powershell.exe : Invoke-WebRequest : Unable to read data from the transport connection: An existing connection was forcibly closed by 
[2019-03-20T14:52:19.521Z] At C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-149\dotnet@tmp\durable-2b201a5c\powershellWrapper.ps1:3 char:1
[2019-03-20T14:52:19.521Z] + & powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Comm ...
[2019-03-20T14:52:19.521Z] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2019-03-20T14:52:19.521Z]     + CategoryInfo          : NotSpecified: (Invoke-WebReque...ibly closed by :String) [], RemoteException
[2019-03-20T14:52:19.521Z]     + FullyQualifiedErrorId : NativeCommandError
[2019-03-20T14:52:19.521Z]  
[2019-03-20T14:52:19.521Z] the remote host.
[2019-03-20T14:52:19.521Z] At C:\Users\jenkins\workspace\tnet_apm-agent-dotnet-mbp_PR-149\dotnet@tmp\durable-2b201a5c\powershellScript.ps1:2 
[2019-03-20T14:52:19.521Z] char:25
[2019-03-20T14:52:19.521Z] + ...             Invoke-WebRequest https://download.visualstudio.microsoft ...
[2019-03-20T14:52:19.521Z] +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[2019-03-20T14:52:19.521Z]     + CategoryInfo          : NotSpecified: (:) [Invoke-WebRequest], IOException
[2019-03-20T14:52:19.521Z]     + FullyQualifiedErrorId : System.IO.IOException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

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.

4 participants