Skip to content

Commit

Permalink
twitter-server: Add more information on tracing page
Browse files Browse the repository at this point in the history
Problem/Solution:
Add more information on how to enable/disable tracing from
the Admin tracing page.

JIRA Issues: CSL-11019

Differential Revision: https://phabricator.twitter.biz/D687337
  • Loading branch information
jyanJing authored and jenkins committed Jun 15, 2021
1 parent d8e915d commit d3eb9be
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -12,6 +12,8 @@ Runtime Behavior Changes

* Sort sublinks from Admin UI alphabetically. ``PHAB_ID=D684429``

* Added more information on how to enable/disable tracing in admin/tracing UI.
``PHAB_ID=D687337``

21.5.0
------
Expand Down
Expand Up @@ -54,15 +54,22 @@ class TracingHandler extends Service[Request, Response] {
}

val tracing = FinagleTracing.instance.get
val msg = if (params.getOrElse("enable", "") == "true") {
tracing.enable()
"Enabled Finagle tracing"
} else if (params.getOrElse("disable", "") == "true") {
tracing.disable()
"Disabling Finagle tracing"
} else {
"Could not figure out what you wanted to do with tracing. " +
"Either enable or disable it. This is what we got: " + params

val msg = (params.get("enable"), params.get("disable")) match {
case (Some("true"), Some("true")) =>
"""You set tracing to be enabled and disabled at the same time.
|Either enable (/admin/tracing?enable=true) or disable (/admin/tracing?disable=true) it.
|""".stripMargin
case (Some("true"), _) =>
tracing.enable()
"Enabled Finagle tracing"
case (_, Some("true")) =>
tracing.disable()
"Disabling Finagle tracing"
case _ =>
"""You did not set the parameter for tracing.
|Either enable (/admin/tracing?enable=true) or disable (/admin/tracing?disable=true) it.
|""".stripMargin
}

log.info(msg)
Expand Down

0 comments on commit d3eb9be

Please sign in to comment.