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

Bump SentryVersion to 5.0.0-alpha.1 #207

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<SentryVersion>4.12.0</SentryVersion>
<SentryVersion>5.0.0-alpha.1</SentryVersion>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Sentry.Extensions.Logging" Version="$(SentryVersion)" />
Expand Down
7 changes: 1 addition & 6 deletions src/SymbolCollector.Server/BatchFinalizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,20 @@ public Task CloseBatch(
public class SymsorterBatchFinalizer : IBatchFinalizer
{
private readonly SymbolServiceOptions _options;
private readonly IMetricsPublisher _metrics;
private readonly ILogger<SymsorterBatchFinalizer> _logger;
private readonly ISymbolGcsWriter _gcsWriter;
private readonly BundleIdGenerator _bundleIdGenerator;
private readonly IHub _hub;
private readonly string _symsorterOutputPath;

public SymsorterBatchFinalizer(
IMetricsPublisher metrics,
IOptions<SymbolServiceOptions> options,
ISymbolGcsWriter gcsWriter,
BundleIdGenerator bundleIdGenerator,
IHub hub,
ILogger<SymsorterBatchFinalizer> logger)
{
_options = options?.Value ?? throw new ArgumentNullException(nameof(options));
_metrics = metrics;
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
_gcsWriter = gcsWriter ?? throw new ArgumentNullException(nameof(gcsWriter));
_bundleIdGenerator = bundleIdGenerator;
Expand Down Expand Up @@ -89,7 +86,6 @@ traceHeader is not null
? _hub.StartTransaction("CloseBatch", "batch.close", traceHeader)
: _hub.StartTransaction("CloseBatch", "batch.close");

var handle = _metrics.BeginGcsBatchUpload();
_ = Task.Run(async () =>
{
// get logger factory and create a logger for symsorter
Expand Down Expand Up @@ -189,7 +185,6 @@ into fileGroup
{
_logger.LogError(e, "Failed attempting to delete symsorter directory.");
}
handle.Dispose();
}

}, gcsUploadCancellation)
Expand Down Expand Up @@ -292,4 +287,4 @@ private bool SortSymbols(string batchLocation, SymbolUploadBatch batch, string s
_logger.LogInformation("Symsorter processed: {count}", match.Groups["count"].Value);
return false;
}
}
}
92 changes: 0 additions & 92 deletions src/SymbolCollector.Server/ProxyMetricsPublisher.cs

This file was deleted.

82 changes: 0 additions & 82 deletions src/SymbolCollector.Server/SentryMetricsPublisher.cs

This file was deleted.

15 changes: 0 additions & 15 deletions src/SymbolCollector.Server/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,6 @@ public void ConfigureServices(IServiceCollection services)
.AddJsonOptions(options =>
options.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase);

services.AddSingleton<ISymbolServiceMetrics, ProxyMetricsPublisher>();
services.AddSingleton<ISymbolControllerMetrics, ProxyMetricsPublisher>();
services.AddSingleton<IMetricsPublisher, ProxyMetricsPublisher>();

services.AddSingleton<StatsDMetricsPublisher>();
services.AddSingleton<SentryMetricsPublisher>();

services.AddSingleton<ProxyMetricsPublisher>(c => new ProxyMetricsPublisher(
c.GetRequiredService<StatsDMetricsPublisher>(),
c.GetRequiredService<SentryMetricsPublisher>()));

services.AddOptions<StatsDOptions>()
.Configure<IConfiguration>((o, c) => c.Bind("StatsD", o))
.Validate(o => !string.IsNullOrWhiteSpace(o.Host), "StatD host is required.");
Expand Down Expand Up @@ -200,22 +189,18 @@ private string GetSymsorterPath()
private class SymbolServiceEventProcessor : ISentryEventProcessor
{
private readonly IWebHostEnvironment _environment;
private readonly IMetricsPublisher _metrics;
private readonly SymbolServiceOptions _options;
private readonly string _cores = Environment.ProcessorCount.ToString();
public SymbolServiceEventProcessor(
IWebHostEnvironment environment,
IMetricsPublisher metrics,
IOptions<SymbolServiceOptions> options)
{
_environment = environment;
_metrics = metrics;
_options = options.Value;
}

public SentryEvent? Process(SentryEvent @event)
{
_metrics.SentryEventProcessed();
@event.SetTag("server-endpoint", _options.BaseAddress ?? "?");
@event.Contexts["SymbolServiceOptions"] = _options;

Expand Down
78 changes: 0 additions & 78 deletions src/SymbolCollector.Server/StatsDMetricsPublisher.cs

This file was deleted.

7 changes: 1 addition & 6 deletions src/SymbolCollector.Server/SymbolService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ public string BaseWorkingPath

internal class InMemorySymbolService : ISymbolService, IDisposable
{
private readonly ISymbolServiceMetrics _metrics;
private readonly ObjectFileParser _parser;
private readonly IBatchFinalizer _batchFinalizer;
private readonly SymbolServiceOptions _options;
Expand All @@ -87,13 +86,11 @@ internal class InMemorySymbolService : ISymbolService, IDisposable
private readonly string _conflictPath;

public InMemorySymbolService(
ISymbolServiceMetrics metrics,
ObjectFileParser parser,
IBatchFinalizer batchFinalizer,
IOptions<SymbolServiceOptions> options,
ILogger<InMemorySymbolService> logger)
{
_metrics = metrics;
_parser = parser;
_batchFinalizer = batchFinalizer;
_options = options.Value;
Expand Down Expand Up @@ -189,8 +186,6 @@ private async Task<StoreResult> StoreIsolated(
&& symbol.Hash is { }
&& string.CompareOrdinal(fileResult.Hash, symbol.Hash) != 0)
{
_metrics.DebugIdHashConflict();

var conflictDestination = Path.Combine(
_conflictPath,
fileResult.UnifiedId);
Expand Down Expand Up @@ -354,4 +349,4 @@ private async Task<SymbolUploadBatch> GetOpenBatch(Guid batchId, CancellationTok
}

public void Dispose() => (_batchFinalizer as IDisposable)?.Dispose();
}
}
Loading
Loading