Skip to content

Commit

Permalink
Merge pull request #4796 from gamblen/fix-prometheus-sample
Browse files Browse the repository at this point in the history
Correct prometheus sample for summary with v3.*
  • Loading branch information
danielmarbach committed Apr 27, 2020
2 parents 2b83de9 + c84d89f commit ac65303
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
<Reference Include="System.Windows" />
<PackageReference Include="NServiceBus" Version="7.*" />
<PackageReference Include="NServiceBus.Metrics" Version="3.*" />
<PackageReference Include="prometheus-net" Version="2.*" />
<PackageReference Include="prometheus-net" Version="3.*" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,17 @@ public void RegisterProbes(ProbeContext context, string[] labelValues)
continue;
}
var prometheusName = nameMapping[duration.Name];
var summary = Metrics.CreateSummary(prometheusName, duration.Description, Labels);
var summary = Metrics.CreateSummary(prometheusName, duration.Description,
new SummaryConfiguration
{
Objectives = new[]
{
new QuantileEpsilonPair(0.5, 0.05),
new QuantileEpsilonPair(0.9, 0.01),
new QuantileEpsilonPair(0.99, 0.001)
},
LabelNames = Labels
});
duration.Register((ref DurationEvent @event) => summary.Labels(labelValues).Observe(@event.Duration.TotalSeconds));
}

Expand Down

0 comments on commit ac65303

Please sign in to comment.