1
- //-----------------------------------------------------------------------------
2
- // <copyright file="AWSXRayMiddlewareExtensions.cs" company="Amazon.com">
3
- // Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
- //
5
- // Licensed under the Apache License, Version 2.0 (the "License").
6
- // You may not use this file except in compliance with the License.
7
- // A copy of the License is located at
8
- //
9
- // http://aws.amazon.com/apache2.0
10
- //
11
- // or in the "license" file accompanying this file. This file is distributed
12
- // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13
- // express or implied. See the License for the specific language governing
14
- // permissions and limitations under the License.
15
- // </copyright>
16
- //-----------------------------------------------------------------------------
17
- using Amazon . XRay . Recorder . Core . Strategies ;
1
+ //-----------------------------------------------------------------------------
2
+ // <copyright file="AWSXRayMiddlewareExtensions.cs" company="Amazon.com">
3
+ // Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 (the "License").
6
+ // You may not use this file except in compliance with the License.
7
+ // A copy of the License is located at
8
+ //
9
+ // http://aws.amazon.com/apache2.0
10
+ //
11
+ // or in the "license" file accompanying this file. This file is distributed
12
+ // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13
+ // express or implied. See the License for the specific language governing
14
+ // permissions and limitations under the License.
15
+ // </copyright>
16
+ //-----------------------------------------------------------------------------
17
+ using Amazon . XRay . Recorder . Core . Strategies ;
18
18
using Amazon . XRay . Recorder . Handlers . AspNetCore . Internal ;
19
- using Microsoft . Extensions . Configuration ;
20
-
21
- namespace Microsoft . AspNetCore . Builder
22
- {
23
- /// <summary>
24
- /// The Middleware Extension to intercept HTTP request for ASP.NET Core.
25
- /// For each request, <see cref="AWSXRayMiddleware"/> will try to parse trace header
26
- /// from HTTP request header, and determine if tracing is enabled. If enabled, it will
27
- /// start a new segment before invoking inner handler. And end the segment before it returns
28
- /// the response to outer handler.
29
- /// </summary>
30
- public static class AWSXRayMiddlewareExtensions
31
- {
19
+ using Microsoft . Extensions . Configuration ;
20
+
21
+ namespace Microsoft . AspNetCore . Builder
22
+ {
23
+ /// <summary>
24
+ /// The Middleware Extension to intercept HTTP request for ASP.NET Core.
25
+ /// For each request, <see cref="AWSXRayMiddleware"/> will try to parse trace header
26
+ /// from HTTP request header, and determine if tracing is enabled. If enabled, it will
27
+ /// start a new segment before invoking inner handler. And end the segment before it returns
28
+ /// the response to outer handler.
29
+ /// </summary>
30
+ public static class AWSXRayMiddlewareExtensions
31
+ {
32
32
/// <summary>
33
- /// Adds <see cref="AWSXRayMiddleware"/> to the applicaion 's request pipeline.
33
+ /// Adds <see cref="AWSXRayMiddleware"/> to the application 's request pipeline.
34
34
/// </summary>
35
35
/// <param name="builder">Instance of <see cref="IApplicationBuilder"/>.</param>
36
36
/// <param name="segmentName">Segment name.</param>
37
- /// <returns>Instance of <see cref="IApplicationBuilder"/> instrumented with X-Ray middleware.</returns>
38
- public static IApplicationBuilder UseXRay ( this IApplicationBuilder builder , string segmentName )
39
- {
40
- return builder . UseMiddleware < AWSXRayMiddleware > ( segmentName ) ;
41
- }
42
-
37
+ /// <returns>Instance of <see cref="IApplicationBuilder"/> instrumented with X-Ray middleware.</returns>
38
+ public static IApplicationBuilder UseXRay ( this IApplicationBuilder builder , string segmentName )
39
+ {
40
+ return builder . UseMiddleware < AWSXRayMiddleware > ( segmentName ) ;
41
+ }
42
+
43
43
/// <summary>
44
- /// Adds <see cref="AWSXRayMiddleware"/> to the applicaion 's request pipeline.
44
+ /// Adds <see cref="AWSXRayMiddleware"/> to the application 's request pipeline.
45
45
/// </summary>
46
46
/// <param name="builder">Instance of <see cref="IApplicationBuilder"/></param>
47
47
/// <param name="segmentName">Segment name.</param>
48
48
/// <param name="configuration"></param>
49
- /// <returns>Instance of <see cref="IApplicationBuilder"/> instrumented with X-Ray middleware.</returns>
50
- public static IApplicationBuilder UseXRay ( this IApplicationBuilder builder , string segmentName , IConfiguration configuration )
51
- {
52
- return builder . UseMiddleware < AWSXRayMiddleware > ( segmentName , configuration ) ;
53
- }
54
-
49
+ /// <returns>Instance of <see cref="IApplicationBuilder"/> instrumented with X-Ray middleware.</returns>
50
+ public static IApplicationBuilder UseXRay ( this IApplicationBuilder builder , string segmentName , IConfiguration configuration )
51
+ {
52
+ return builder . UseMiddleware < AWSXRayMiddleware > ( segmentName , configuration ) ;
53
+ }
54
+
55
55
/// <summary>
56
- /// Adds <see cref="AWSXRayMiddleware"/> to the applicaion 's request pipeline.
56
+ /// Adds <see cref="AWSXRayMiddleware"/> to the application 's request pipeline.
57
57
/// </summary>
58
58
/// <param name="builder">Instance of <see cref="IApplicationBuilder"/>.</param>
59
59
/// <param name="segmentNamingStrategy"></param>
60
- /// <returns>Instance of <see cref="IApplicationBuilder"/> instrumented with X-Ray middleware.</returns>
61
- public static IApplicationBuilder UseXRay ( this IApplicationBuilder builder , SegmentNamingStrategy segmentNamingStrategy )
62
- {
63
- return builder . UseMiddleware < AWSXRayMiddleware > ( segmentNamingStrategy ) ;
64
- }
65
-
60
+ /// <returns>Instance of <see cref="IApplicationBuilder"/> instrumented with X-Ray middleware.</returns>
61
+ public static IApplicationBuilder UseXRay ( this IApplicationBuilder builder , SegmentNamingStrategy segmentNamingStrategy )
62
+ {
63
+ return builder . UseMiddleware < AWSXRayMiddleware > ( segmentNamingStrategy ) ;
64
+ }
65
+
66
66
/// <summary>
67
- /// Adds <see cref="AWSXRayMiddleware"/> to the applicaion 's request pipeline.
67
+ /// Adds <see cref="AWSXRayMiddleware"/> to the application 's request pipeline.
68
68
/// </summary>
69
69
/// <param name="builder">Instance of <see cref="IApplicationBuilder"/>.</param>
70
70
/// <param name="segmentNamingStrategy"></param>
71
71
/// <param name="configuration"></param>
72
- /// <returns>Instance of <see cref="IApplicationBuilder"/> instrumented with X-Ray middleware.</returns>
73
- public static IApplicationBuilder UseXRay ( this IApplicationBuilder builder , SegmentNamingStrategy segmentNamingStrategy , IConfiguration configuration )
74
- {
75
- return builder . UseMiddleware < AWSXRayMiddleware > ( segmentNamingStrategy , configuration ) ;
76
- }
77
- }
78
- }
72
+ /// <returns>Instance of <see cref="IApplicationBuilder"/> instrumented with X-Ray middleware.</returns>
73
+ public static IApplicationBuilder UseXRay ( this IApplicationBuilder builder , SegmentNamingStrategy segmentNamingStrategy , IConfiguration configuration )
74
+ {
75
+ return builder . UseMiddleware < AWSXRayMiddleware > ( segmentNamingStrategy , configuration ) ;
76
+ }
77
+ }
78
+ }
0 commit comments