Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
class System.​Net.​Http.​Metrics.​HttpMetricsEnrichmentContext
Assembly: System.Net.Http
Inheritance: object → HttpMetricsEnrichmentContext
Provides functionality for enriching the <c>http.client.request.duration</c> metric.
Properties
public
Exception
Exception
Gets the exception that occurred, or <see langword="null" /> if there was no error.
public
HttpRequestMessage
Request
Gets the <see cref="T:System.Net.Http.HttpRequestMessage" /> that has been sent.
public
HttpResponseMessage
Response
Gets the <see cref="T:System.Net.Http.HttpRequestMessage" /> received from the server, or <see langword="null" /> if the request failed.
Methods
public static
void
AddCallback​(HttpRequestMessage request,
Action<​HttpMetricsEnrichmentContext> callback)
Adds a callback to register custom tags for the <c>http.client.request.duration</c> metric.
request
The <see cref="T:System.Net.Http.HttpRequestMessage" /> to apply enrichment to.
callback
The callback responsible for adding custom tags via <see cref="M:System.Net.Http.Metrics.HttpMetricsEnrichmentContext.AddCustomTag(System.String,System.Object)" /> .
public
void
AddCustomTag​(string name,
object value)
Appends a custom tag to the list of tags to be recorded with the <c>http.client.request.duration</c> metric.
name
The name of the tag.
value
The value of the tag.
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object