Skip to content

Commit

Permalink
[release/6.x] Update Diagnostics shipped version (#5991)
Browse files Browse the repository at this point in the history
* Update Diagnostics shipped version

* Fixup api
  • Loading branch information
wiktork authored Feb 6, 2024
1 parent 836c15e commit f2038e1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion eng/dependabot/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@

<!-- Release-branch specific reference -->
<!-- dotnet/diagnostics references -->
<MicrosoftDiagnosticsMonitoringVersion>8.0.452401</MicrosoftDiagnosticsMonitoringVersion>
<MicrosoftDiagnosticsMonitoringVersion>8.0.510501</MicrosoftDiagnosticsMonitoringVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ protected override void SerializeCounter(Stream stream, ICounterPayload counter)
{
writer.WriteStartObject();
writer.WriteString("timestamp", counter.Timestamp);
writer.WriteString("provider", counter.Provider);
writer.WriteString("name", counter.Name);
writer.WriteString("provider", counter.CounterMetadata.ProviderName);
writer.WriteString("name", counter.CounterMetadata.CounterName);
writer.WriteString("displayName", counter.DisplayName);
writer.WriteString("unit", counter.Unit);
writer.WriteString("counterType", counter.CounterType.ToString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public MetricKey(ICounterPayload metric)
public override int GetHashCode()
{
HashCode code = new HashCode();
code.Add(_metric.Provider);
code.Add(_metric.Name);
code.Add(_metric.CounterMetadata.ProviderName);
code.Add(_metric.CounterMetadata.CounterName);
return code.ToHashCode();
}

Expand Down Expand Up @@ -91,7 +91,7 @@ public async Task SnapshotMetrics(Stream outputStream, CancellationToken token)
foreach (var metricGroup in copy)
{
ICounterPayload metricInfo = metricGroup.Value.First();
string metricName = PrometheusDataModel.GetPrometheusNormalizedName(metricInfo.Provider, metricInfo.Name, metricInfo.Unit);
string metricName = PrometheusDataModel.GetPrometheusNormalizedName(metricInfo.CounterMetadata.ProviderName, metricInfo.CounterMetadata.CounterName, metricInfo.Unit);
string metricType = "gauge";

//TODO Some clr metrics claim to be incrementing, but are really gauges.
Expand Down Expand Up @@ -119,7 +119,7 @@ private static async Task WriteMetricDetails(

private static bool CompareMetrics(ICounterPayload first, ICounterPayload second)
{
return string.Equals(first.Name, second.Name);
return string.Equals(first.CounterMetadata.CounterName, second.CounterMetadata.CounterName);
}

public void Clear()
Expand Down

0 comments on commit f2038e1

Please sign in to comment.