Skip to content

Commit

Permalink
Populate MetricsDeclarationBuilder.Version
Browse files Browse the repository at this point in the history
I realised that the Version property wasn't being populated on either the model object or the serialization object. I've removed it from the model object since it isn't versioned.

I've also updated the v1 ConfigurationSerializer to just set the version to `v1` since it only handles the v1 format.
  • Loading branch information
adamconnelly committed Aug 15, 2019
1 parent b4ceab3 commit 5d0dc75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ namespace Promitor.Core.Scraping.Configuration.Model
{
public class MetricsDeclaration
{
public string Version { get; set; }
public AzureMetadata AzureMetadata { get; set; }
public MetricDefaults MetricDefaults { get; set; } = new MetricDefaults();
public List<MetricDefinition> Metrics { get; set; } = new List<MetricDefinition>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using Microsoft.Extensions.Logging;
using Promitor.Core.Scraping.Configuration.Serialization.Enum;
using Promitor.Core.Scraping.Configuration.Serialization.v1.Model;
using Promitor.Core.Scraping.Configuration.Serialization.v1.Model.Metrics;
using YamlDotNet.RepresentationModel;
Expand Down Expand Up @@ -43,6 +44,7 @@ public MetricsDeclarationV1 InterpretYamlStream(YamlMappingNode rootNode)

var metricsDeclaration = new MetricsDeclarationV1
{
Version = SpecVersion.v1.ToString(),
AzureMetadata = azureMetadata,
MetricDefaults = metricDefaults,
Metrics = metrics
Expand Down

0 comments on commit 5d0dc75

Please sign in to comment.