Skip to content
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System;
using System.Runtime.InteropServices;
using System.Threading;
using CodingWithCalvin.Otel4Vsix;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using Task = System.Threading.Tasks.Task;
Expand All @@ -20,7 +21,31 @@ IProgress<ServiceProgressData> progress
{
await JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);

var builder = VsixTelemetry.Configure()
.WithServiceName(VsixInfo.DisplayName)
.WithServiceVersion(VsixInfo.Version)
.WithVisualStudioAttributes(this)
.WithEnvironmentAttributes();

#if !DEBUG
builder
.WithOtlpHttp("https://api.honeycomb.io")
.WithHeader("x-honeycomb-team", HoneycombConfig.ApiKey);
#endif

builder.Initialize();

DebuggerEvents.Initialize();
}

protected override void Dispose(bool disposing)
{
if (disposing)
{
VsixTelemetry.Shutdown();
}

base.Dispose(disposing);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@
<OutputPath>bin/$(Configuration)/</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DeployExtension>True</DeployExtension>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CodingWithCalvin.Otel4Vsix" Version="0.2.2" />
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.14.40265" />
</ItemGroup>

Expand Down
23 changes: 19 additions & 4 deletions src/CodingWithCalvin.BreakpointNotifier/DebuggerEvents.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using CodingWithCalvin.Otel4Vsix;
using Microsoft;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Debugger.Interop;
Expand Down Expand Up @@ -28,8 +30,7 @@ public static DebuggerEvents Initialize()

public int OnModeChange(DBGMODE dbgmodeNew)
{
// No longer showing message here - we use IDebugEventCallback2 instead
// to specifically detect breakpoint hits vs. step operations
VsixTelemetry.LogInformation("Debugger mode changed to {Mode}", dbgmodeNew.ToString());
return VSConstants.S_OK;
}

Expand All @@ -44,7 +45,21 @@ public int Event(
{
if (pEvent is IDebugBreakpointEvent2)
{
MessageBox.Show("Breakpoint Hit!");
using var activity = VsixTelemetry.StartCommandActivity("BreakpointNotifier.BreakpointHit");

try
{
VsixTelemetry.LogInformation("Breakpoint hit detected");
MessageBox.Show("Breakpoint Hit!");
}
catch (Exception ex)
{
activity?.RecordError(ex);
VsixTelemetry.TrackException(ex, new Dictionary<string, object>
{
{ "operation.name", "BreakpointHit" }
});
}
}

return VSConstants.S_OK;
Expand Down
7 changes: 7 additions & 0 deletions src/CodingWithCalvin.BreakpointNotifier/HoneycombConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace CodingWithCalvin.BreakpointNotifier
{
internal static class HoneycombConfig
{
public const string ApiKey = "PLACEHOLDER";
}
}