Skip to content

Commit

Permalink
twitter-server: Add filtering to /admin/registry.json
Browse files Browse the repository at this point in the history
Problem

There are times you are interested in a very specific subsection of
the registry and you don't feel like using `jq` or parsing the output.

Solution

Introduce an optional HTTP request parameter `filter` allows for
simple filtering of the returned data.  The value takes the form
"path/to/data" and returns registry entries whose prefix matches the
parameter. A glob, `*`, can be used to match any component of the
path. For example, using "filter=registry/server/http" will output all
Finagle Http servers.  Using "filter=registry/client/\*/user_service"
would output all Finagle clients with a label of "user_service"
regardless of protocol.

RB_ID=842784
  • Loading branch information
kevinoliver authored and jenkins committed Jun 20, 2016
1 parent 0f78141 commit 90a146b
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import scala.util.control.NoStackTrace
object Formatter {
private[this] val log = Logger.getLogger(getClass.getName)

/**
* The top-level key in the `Map` returned by [[asMap]].
*/
val RegistryKey = "registry"

private[registry] val Eponymous = "__eponymous"

/**
Expand Down Expand Up @@ -60,7 +65,7 @@ object Formatter {
log.severe(s"incorrectly found an empty seq on $returnString")
}
}
Map("registry" -> map)
Map(RegistryKey -> map)
}

private[registry] val Collision = new Exception() with NoStackTrace
Expand Down

0 comments on commit 90a146b

Please sign in to comment.