memcached_exporter icon indicating copy to clipboard operation
memcached_exporter copied to clipboard

Does it work with "mcrouter"?

Open carnei-ro opened this issue 4 years ago • 8 comments
trafficstars

Does "memcached_exporter" work with "mcrouter"?

I am using the following config to mcrouter:

{
  "pools": {
    "A": {
      "servers": [
        "memcached-node1:11211",
        "memcached-node2:11211"
      ]
    }
  },
  "route": "PoolRoute|A"
}

Metric memcached_up is always 0

carnei-ro avatar May 25 '21 21:05 carnei-ro

I have the same problem. In my log is:

level=error ts=2021-07-27T07:00:39.319Z caller=exporter.go:577 msg="Failed to collect stats from memcached" err="memcache: client error: bad stats command"
level=error ts=2021-07-27T07:00:39.320Z caller=exporter.go:582 msg="Could not query stats settings" err="memcache: client error: bad stats command"

jsedy7 avatar Jul 27 '21 07:07 jsedy7

Do you know which stats commands are supported by mcrouter? I haven't been using it for years, if it only requires simple changes to be supported I'm happy to provide some guidance on making these changes.

grobie avatar Jul 27 '21 20:07 grobie

It should be simple enough to support, some details are on the mcrouter wiki:

https://github.com/facebook/mcrouter/wiki/Stats-list

SuperQ avatar Jan 07 '22 14:01 SuperQ

I did some digging, it looks like mcrouter doesn't support stats settings, so we'll have to add an option to skip it for mcrouter.

SuperQ avatar Jan 10 '22 10:01 SuperQ

It also turns out that mcrouter doesn't support stats slabs and stats items. Currently grobie/gomemcache tries to fetch all stats in a single stats method call. We'll need to split this up in order to make it mcrouter compatible.

SuperQ avatar Jan 10 '22 11:01 SuperQ

Presumably you would still want metrics from the individual memcached instances. Is there a way for the exporter to tell whether it's talking to mcrouter or memcached proper? How would you tell from metrics? A simple thing I can imagine would be "router mode" for the exporter (--router or so) where it changes the metric namespace and only asks for the stats that make sense. What I don't know is how that should work with multi-target mode (#143). Would it be acceptable to say "you can target multiple routers, or multiple caches, but not both"?

matthiasr avatar Feb 13 '23 11:02 matthiasr

What is the use case for using the memached exporter via mcrouter?

There is a mcrouter exporter that can be used https://github.com/Dev25/mcrouter_exporter or you can run the memcached exporter on each memcached server and connect directly rather than going through mcrouter.

blkperl avatar Feb 13 '23 21:02 blkperl

The idea is that we could have one exporter that does both. I looked at the mcrouter_exporter, it has a bit of a manual implementation of the protocol.

SuperQ avatar Feb 13 '23 21:02 SuperQ