Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable plugins to emit stat into L5D stat trees for Identifier #1963

Closed
1 task
leozc opened this issue May 26, 2018 · 5 comments
Closed
1 task

Enable plugins to emit stat into L5D stat trees for Identifier #1963

leozc opened this issue May 26, 2018 · 5 comments

Comments

@leozc
Copy link
Contributor

leozc commented May 26, 2018

Issue Type:

  • Bug report
  • [ X] Feature request

This is the alternative code path for feature request similar to #1922

  1. Enable plugins to emit stat into L5D stat trees for Announcer #1922 is done for Announcer
  2. this bug is to track for Identifier

Here are the comments copied from #1922
We are writing multiple plugins for our L5D mesh, there are needs to initialize a finagle client to perform RPC, however there is no way to submit the stat into L5D metrics system.

Suggestion: Is it possible to enable this user scenario?

def getClient(withRequestTimeoutMS: Int =  1000 , addr: InetSocketAddress, path:Path): Service[http.Request, http.Response]  = {
    val monitor: Monitor = new Monitor {
      def handle(t: Throwable): Boolean = {
        logger.error(t, t.getMessage, t.getStackTrace)
        true
      }
    }
    val metrics = MetricsTree() // possible to get the metrics tree from global 
    val stats = new MetricsTreeStatsReceiver(metrics) // register this stat object to be collected?
    Http.client
      .withStatsReceiver(stats)
      .withHttpStats
      .withRequestTimeout(Duration.fromMilliseconds(withRequestTimeoutMS))
      .withMonitor(monitor)
      .newService(s"${addr.getHostName()}:${addr.getPort()}", "hc_client")

  }
@leozc
Copy link
Contributor Author

leozc commented May 27, 2018

https://github.com/linkerd/linkerd/blob/fe822302d38f249533d1af326ea06efd842bf9b4/linkerd/protocol/http/src/main/scala/io/buoyant/linkerd/protocol/HttpConfig.scala#L247

Here should be where the identifier being construed

@leozc
Copy link
Contributor Author

leozc commented May 27, 2018

PR: #1964

leozc added a commit to leozc/linkerd that referenced this issue Jun 2, 2018
leozc added a commit to leozc/linkerd that referenced this issue Jun 5, 2018
leozc pushed a commit to leozc/linkerd that referenced this issue Jun 11, 2018
@leozc
Copy link
Contributor Author

leozc commented Jul 4, 2018

Reenable - pull the latest linkerd and debug through and found out the statReceiveer is NullStatReceiver:

Here is the corresponding section from https://linkerd:9990/admin/registry.json

            "NackAdmissionFilter" : {
              "statsReceiver" : "NullStatsReceiver/common_auth/l5d_authIdentifier",
              "window" : "2.minutes",
              "nackRateThreshold" : "0.5"
            },

@adleong
Copy link
Member

adleong commented Jul 10, 2018

@leozc Please take a look at master...alex/params and let me know if that fixes it for you

@leozc
Copy link
Contributor Author

leozc commented Jul 11, 2018

Thanks @adleong , this seems to be a right fix - now I can also see adminhttp/* metrics in additional to private metrics.

adleong added a commit that referenced this issue Jul 13, 2018
Stack params are passed to identifier plugins to configure them.  However, only params from the router config are passed to the identifier.  In particular, this means that the stats receiver is not available to the identifier because it is not a router config param.

Pass stack params as input to the router params.  This allows the stats receiver to be passed into the router params.

Fixes #1963 

Signed-off-by: Alex Leong <[email protected]>
Tim-Brooks pushed a commit to Tim-Brooks/linkerd that referenced this issue Dec 20, 2018
* Renames UNKNOWN in the tables to (default) which is less scary (linkerd#1946)
* adds a tooltip explaining what (default) is
* adds url props to the Top Routes page, so that they query can be populated by a url
* fixes a js error that occurs when switching pages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants