diff --git a/CHANGELOG.rst b/CHANGELOG.rst index aa34be62..fd5eabb2 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -7,6 +7,9 @@ Note that ``PHAB_ID=#`` and ``RB_ID=#`` correspond to associated messages in com Unreleased ---------- +* Add separator_char field to the top level of the Metrics Metadata endpoint and bump the + endpoints version number to 2.1. ``PHAB_ID=D591106`` + 20.12.0 ------- diff --git a/server/src/main/scala/com/twitter/server/handler/MetricMetadataQueryHandler.scala b/server/src/main/scala/com/twitter/server/handler/MetricMetadataQueryHandler.scala index 76907717..713774cb 100644 --- a/server/src/main/scala/com/twitter/server/handler/MetricMetadataQueryHandler.scala +++ b/server/src/main/scala/com/twitter/server/handler/MetricMetadataQueryHandler.scala @@ -2,6 +2,7 @@ package com.twitter.server.handler import com.twitter.finagle.Service import com.twitter.finagle.http.{MediaType, Request, Response, Uri} +import com.twitter.finagle.stats.metadataScopeSeparator import com.twitter.io.Buf import com.twitter.server.util.HttpUtils.newResponse import com.twitter.server.util.{JsonConverter, MetricSchemaSource} @@ -95,8 +96,9 @@ class MetricMetadataQueryHandler(source: MetricSchemaSource = new MetricSchemaSo content = Buf.Utf8( JsonConverter.writeToString( Map( - "@version" -> 2.0, + "@version" -> 2.1, "counters_latched" -> latched, + "separator_char" -> metadataScopeSeparator(), "metrics" -> metrics ))) ) diff --git a/server/src/test/scala/com/twitter/server/handler/MetricMetadataQueryHandlerTest.scala b/server/src/test/scala/com/twitter/server/handler/MetricMetadataQueryHandlerTest.scala index 722fe6a3..362def8e 100644 --- a/server/src/test/scala/com/twitter/server/handler/MetricMetadataQueryHandlerTest.scala +++ b/server/src/test/scala/com/twitter/server/handler/MetricMetadataQueryHandlerTest.scala @@ -307,8 +307,9 @@ class MetricMetadataQueryHandlerTest extends FunSuite { val responseStart = """ | { - | "@version" : 2.0, + | "@version" : 2.1, | "counters_latched" : true, + | "separator_char" : "/", """.stripMargin test(testName + " when using latched counters") { assertJsonResponse( @@ -320,8 +321,9 @@ class MetricMetadataQueryHandlerTest extends FunSuite { val responseStart = """ | { - | "@version" : 2.0, + | "@version" : 2.1, | "counters_latched" : false, + | "separator_char" : "/", """.stripMargin test(testName + " when using unlatched counters") { assertJsonResponse(