-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
Support performance #633
Merged
Merged
Support performance #633
Changes from 54 commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
f31adac
wip
Tyrrrz 79d2397
wip
Tyrrrz d7c9974
wip
Tyrrrz 51783e8
wip
Tyrrrz c99635d
wip
Tyrrrz 7ad5ab5
wip
Tyrrrz 96c443e
wip
Tyrrrz 98e567d
wip
Tyrrrz e0eb730
wip
Tyrrrz 748670c
wip
Tyrrrz dfdec31
wip
Tyrrrz fa64053
wip
Tyrrrz 8338381
wip
Tyrrrz 8fc5c2b
wip
Tyrrrz 6a05871
wip
Tyrrrz 6c0b928
wip
Tyrrrz 5a47bd9
wip
Tyrrrz e67597e
wip
Tyrrrz 52ec0a5
wip
Tyrrrz 15d7001
wip
Tyrrrz 3a705f0
wip
Tyrrrz c4f9371
wip
Tyrrrz 00ef2b5
wip
Tyrrrz b0487cf
wip
Tyrrrz 0a713f3
wip
Tyrrrz c314a66
wip
Tyrrrz 9e2b7e1
Merge remote-tracking branch 'origin/main' into performance
Tyrrrz d0c5358
wip
Tyrrrz a4e01d8
wip
Tyrrrz d960d7f
wip
Tyrrrz a0fb93e
wip
Tyrrrz 6c1b413
wip
Tyrrrz 258ed5c
wip
Tyrrrz f2e5a8b
wip
Tyrrrz 41bcb99
wip
Tyrrrz da7ee94
wip
Tyrrrz 1371006
wip
Tyrrrz bafe82a
wip
Tyrrrz 7abdb4f
wip
Tyrrrz a1e48f8
wip
Tyrrrz fd13150
wip
Tyrrrz 134d0ec
wip
Tyrrrz 6b92788
wip
Tyrrrz b6f3ee2
wip
Tyrrrz 0e91066
wip
Tyrrrz ea06cfb
wip
Tyrrrz 2cb49ef
wip
Tyrrrz e908cee
wip
Tyrrrz e8aa3cc
wip
Tyrrrz 71c87ca
wip
Tyrrrz 0c512b1
wip
Tyrrrz fbd6f17
wip
Tyrrrz 13b88db
wip
Tyrrrz eb37814
wip
Tyrrrz 61085a4
wip
Tyrrrz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
6 changes: 1 addition & 5 deletions
6
samples/Sentry.Samples.AspNetCore.Basic/Sentry.Samples.AspNetCore.Basic.csproj
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,43 @@ | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Routing; | ||
|
||
#if !NETSTANDARD2_0 | ||
using Microsoft.AspNetCore.Http.Features; | ||
#endif | ||
|
||
namespace Sentry.AspNetCore.Extensions | ||
{ | ||
internal static class HttpContextExtensions | ||
{ | ||
public static string? TryGetRouteTemplate(this HttpContext context) | ||
{ | ||
#if !NETSTANDARD2_0 | ||
// Requires .UseRouting()/.UseEndpoints() | ||
var endpoint = context.Features.Get<IEndpointFeature?>()?.Endpoint as RouteEndpoint; | ||
var routePattern = endpoint?.RoutePattern.RawText; | ||
|
||
if (!string.IsNullOrWhiteSpace(routePattern)) | ||
{ | ||
return routePattern; | ||
} | ||
#endif | ||
|
||
// Requires legacy .UseMvc() | ||
var routeData = context.Features.Get<IRoutingFeature?>()?.RouteData; | ||
var controller = routeData?.Values["controller"]?.ToString(); | ||
var action = routeData?.Values["action"]?.ToString(); | ||
var area = routeData?.Values["area"]?.ToString(); | ||
|
||
if (!string.IsNullOrWhiteSpace(action)) | ||
{ | ||
return !string.IsNullOrWhiteSpace(area) | ||
? $"{area}.{controller}.{action}" | ||
: $"{controller}.{action}"; | ||
} | ||
|
||
// If the handler doesn't use routing (i.e. it checks `context.Request.Path` directly), | ||
// then there is no way for us to extract anything that resembles a route template. | ||
return null; | ||
} | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Sentry.Protocol; | ||
|
||
namespace Sentry.Extensibility | ||
{ | ||
|
@@ -51,6 +52,17 @@ public void WithScope(Action<Scope> scopeCallback) | |
{ | ||
} | ||
|
||
/// <summary> | ||
/// Returns a dummy transaction. | ||
/// </summary> | ||
public Transaction CreateTransaction(string name, string operation) => | ||
new Transaction(this, null); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should have a singleton NoOp instance here instead. |
||
|
||
/// <summary> | ||
/// Returns null. | ||
/// </summary> | ||
public SentryTraceHeader? GetSentryTrace() => null; | ||
|
||
/// <summary> | ||
/// No-Op. | ||
/// </summary> | ||
|
@@ -63,6 +75,13 @@ public void BindClient(ISentryClient client) | |
/// </summary> | ||
public SentryId CaptureEvent(SentryEvent evt, Scope? scope = null) => SentryId.Empty; | ||
|
||
/// <summary> | ||
/// No-Op. | ||
/// </summary> | ||
public void CaptureTransaction(Transaction transaction) | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// No-Op. | ||
/// </summary> | ||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's on the line below (it got some ` on another PR)