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

remove metrics #201

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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.9.0</SentryVersion>
<SentryVersion>4.12.0</SentryVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
6 changes: 0 additions & 6 deletions src/SymbolCollector.Android.Library/Host.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ public static IHost Init(Context context, string dsn)
o.TracesSampleRate = 1.0;
o.Debug = true;

o.ExperimentalMetrics = new ExperimentalMetricsOptions
{
EnableCodeLocations = true,
CaptureSystemDiagnosticsMeters = BuiltInSystemDiagnosticsMeters.All
};

#if ANDROID
o.Android.LogCatIntegration = Sentry.Android.LogCatIntegrationType.All;
// Bindings to the native SDK
Expand Down
9 changes: 3 additions & 6 deletions src/SymbolCollector.Android/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,10 @@ async void OnUploadButtonOnClick(object? sender, EventArgs args)
uploadButton.Enabled = false;
source = new CancellationTokenSource();

using (SentrySdk.Metrics.StartTimer("upload-duration"))
{
var uploadTask = uploader.StartUpload(_friendlyName, source.Token);
var updateUiTask = StartUiUpdater(source.Token, metrics);
var uploadTask = uploader.StartUpload(_friendlyName, source.Token);
var updateUiTask = StartUiUpdater(source.Token, metrics);

await UploadAsync(uploadTask, updateUiTask, metrics, cancelButton, uploadButton, uploadTransaction, source);
}
await UploadAsync(uploadTask, updateUiTask, metrics, cancelButton, uploadButton, uploadTransaction, source);
}
catch (Exception e)
{
Expand Down
6 changes: 0 additions & 6 deletions src/SymbolCollector.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,6 @@ private static void Bootstrap(Args args)
o.TracesSampleRate = 1.0;
o.ProfilesSampleRate = 0.0;

o.ExperimentalMetrics = new ExperimentalMetricsOptions
{
EnableCodeLocations = true,
CaptureSystemDiagnosticsMeters = BuiltInSystemDiagnosticsMeters.All
};

o.AddExceptionFilterForType<OperationCanceledException>();
});
{
Expand Down
14 changes: 0 additions & 14 deletions src/SymbolCollector.Core/ClientMetrics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,85 +46,71 @@ public class ClientMetrics : IClientMetrics
public void FileProcessed()
{
Interlocked.Increment(ref _filesProcessedCount);
SentrySdk.Metrics.Increment("files_processed");
}

public void MachOFileFound()
{
Interlocked.Increment(ref _machOFileFoundCount);
SentrySdk.Metrics.Increment("debug_image_found", tags: new Dictionary<string, string> { {"type", "mach-o"} } );
}

public void ElfFileFound()
{
Interlocked.Increment(ref _elfFileFoundCount);
SentrySdk.Metrics.Increment("debug_image_found", tags: new Dictionary<string, string> { {"type", "elf" } } );
}

public void FatMachOFileFound()
{
Interlocked.Increment(ref _fatMachOFileFoundCount);
SentrySdk.Metrics.Increment("debug_image_found", tags: new Dictionary<string, string> { {"type", "fat-mach-o" } } );
}

public void FailedToUpload()
{
Interlocked.Increment(ref _failedToUploadCount);
SentrySdk.Metrics.Increment("upload", tags: new Dictionary<string, string> { {"type", "failed" } } );
}

public void FailedToParse()
{
Interlocked.Increment(ref _failedToParse);
SentrySdk.Metrics.Increment("parse_failed");
}

public void SuccessfulUpload()
{
Interlocked.Increment(ref _successfullyUploadCount);
SentrySdk.Metrics.Increment("upload", tags: new Dictionary<string, string> { {"type", "successful" } } );
}

public void AlreadyExisted()
{
Interlocked.Increment(ref _alreadyExistedCount);
SentrySdk.Metrics.Increment("already_existed");
}

public void JobsInFlightRemove(int tasksCount)
{
Interlocked.Add(ref _jobsInFlightCount, -tasksCount);
SentrySdk.Metrics.Increment("jobs_in_flight", -tasksCount);
}

public void JobsInFlightAdd(int tasksCount)
{
Interlocked.Add(ref _jobsInFlightCount, tasksCount);
SentrySdk.Metrics.Increment("jobs_in_flight", tasksCount);
}

public void UploadedBytesAdd(long bytes)
{
Interlocked.Add(ref _uploadedBytesCount, bytes);
SentrySdk.Metrics.Increment("uploaded_bytes", bytes, MeasurementUnit.Information.Byte);
}

public void FileOrDirectoryUnauthorizedAccess()
{
Interlocked.Increment(ref _fileOrDirectoryUnauthorizedAccessCount);
SentrySdk.Metrics.Increment("file_or_directory_unauthorized");
}

public void DirectoryDoesNotExist()
{
Interlocked.Increment(ref _directoryDoesNotExistCount);
SentrySdk.Metrics.Increment("directory_does_not_exist");
}

public void FileDoesNotExist()
{
Interlocked.Increment(ref _fileDoesNotExistCount);
SentrySdk.Metrics.Increment("file_does_not_exist");
}

public TimeSpan RanFor => DateTimeOffset.Now - StartedTime;
Expand Down
5 changes: 0 additions & 5 deletions src/SymbolCollector.Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,6 @@ private static IHostBuilder CreateHostBuilder(string[] args) =>
{
o.Dsn = "https://2262a4fa0a6d409c848908ec90c3c5b4@sentry.io/1886021";

o.ExperimentalMetrics = new ExperimentalMetricsOptions
{
EnableCodeLocations = true,
CaptureSystemDiagnosticsMeters = BuiltInSystemDiagnosticsMeters.All
};
o.AddExceptionFilterForType<OperationCanceledException>();
o.MinimumBreadcrumbLevel = LogLevel.Debug;
o.CaptureFailedRequests = true;
Expand Down
Loading