-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #134 from gregkalapos/ExposeContextV2
Expose Transaction.Context.Request and Transaction.Context.Response
- Loading branch information
Showing
9 changed files
with
194 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Elastic.Apm.Api | ||
{ | ||
public class Context | ||
{ | ||
private readonly Lazy<Dictionary<string, string>> tags = new Lazy<Dictionary<string, string>>(); | ||
|
||
/// <summary> | ||
/// If a log record was generated as a result of a http request, the http interface can be used to collect this | ||
/// information. | ||
/// This property is by default null! You have to assign a <see cref="Request" /> instance to this property in order to use | ||
/// it. | ||
/// </summary> | ||
public Request Request { get; set; } | ||
|
||
/// <summary> | ||
/// If a log record was generated as a result of a http request, the http interface can be used to collect this | ||
/// information. | ||
/// This property is by default null! You have to assign a <see cref="Response" /> instance to this property in order to use | ||
/// it. | ||
/// </summary> | ||
public Response Response { get; set; } | ||
|
||
public Dictionary<string, string> Tags => tags.Value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 12 additions & 4 deletions
16
src/Elastic.Apm/Model/Payload/Request.cs → src/Elastic.Apm/Api/Request.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Newtonsoft.Json; | ||
|
||
namespace Elastic.Apm.Api | ||
{ | ||
/// <summary> | ||
/// Encapsulates Response related information that can be attached to an <see cref="ITransaction" /> through <see cref="ITransaction.Context" /> | ||
/// See <see cref="Context.Response" /> | ||
/// </summary> | ||
public class Response | ||
{ | ||
public bool Finished { get; set; } | ||
|
||
/// <summary> | ||
/// The HTTP status code of the response. | ||
/// </summary> | ||
[JsonProperty("Status_code")] | ||
public int StatusCode { get; set; } | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters