Skip to content
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

Added SubstringOrPatternMatcher #3566

Merged
merged 9 commits into from
Sep 3, 2024

Conversation

jamescrosswell
Copy link
Collaborator

@jamescrosswell jamescrosswell commented Aug 26, 2024

Resolves #3560

Summary

Previously we had a SubstringOrRegexPattern class that could store either a string or a regular expression and contained some logic to test either whether that string was a substring or whether the regular expression matched against some other target string.

Instead we now have a StringOrRegex class that takes care of holding the string or regular expression, the ability to bind those values to configuration storage and provides various extensions.

The logic to test that string or regex against a target has been refactored into a SubstringOrPatternMatcher class implementing IStringOrRegexMatcher.

@jamescrosswell jamescrosswell added this to the 5.0.0 milestone Aug 26, 2024
@jamescrosswell jamescrosswell linked an issue Aug 26, 2024 that may be closed by this pull request
Copy link
Contributor

@bitsandfoxes bitsandfoxes left a comment

Choose a reason for hiding this comment

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

We don't have anything on the samples using this?

@jamescrosswell
Copy link
Collaborator Author

We don't have anything on the samples using this?

It would be used indirectly via various properties on the SentryOptions (TagFilters, InAppExclude, FailedRequestTargets and TracePropagationTargets). We don't seem to demo how to use any of those in the Samples.

It's also used in the ExperimentalMetricsOptions, which we do have some samples for - e.g .here:

options.ExperimentalMetrics = new ExperimentalMetricsOptions()
{
// Here we're telling Sentry to capture all built-in metrics. This includes all the metrics we configured
// OpenTelemetry to emit when we called `builder.Services.AddOpenTelemetry()` above:
// - "OpenTelemetry.Instrumentation.Runtime"
// - "Microsoft.AspNetCore.Hosting",
// - "Microsoft.AspNetCore.Server.Kestrel",
// - "System.Net.Http"
CaptureSystemDiagnosticsMeters = BuiltInSystemDiagnosticsMeters.All
};

But nothing showing how people can define their own string or regex to assign to any of those options.

@jamescrosswell jamescrosswell merged commit 708c2e9 into version-5.0.0 Sep 3, 2024
19 checks passed
@jamescrosswell jamescrosswell deleted the substring-or-pattern-matcher branch September 3, 2024 21:29
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.

Replace SubstringOrRegexPattern with an IStringOrRegexMatcher
3 participants