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

Does it work with "mcrouter"? #113

Open
carnei-ro opened this issue May 25, 2021 · 8 comments
Open

Does it work with "mcrouter"? #113

carnei-ro opened this issue May 25, 2021 · 8 comments

Comments

@carnei-ro
Copy link

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

@jsedy7
Copy link

jsedy7 commented Jul 27, 2021

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"

@grobie
Copy link
Member

grobie commented Jul 27, 2021

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.

@SuperQ
Copy link
Member

SuperQ commented Jan 7, 2022

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

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

@SuperQ
Copy link
Member

SuperQ commented Jan 10, 2022

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 added a commit that referenced this issue Jan 10, 2022
In order to support mcrouter, add a flag to disable the collection of
"STATS SETTINGS".

Fixes: #113

Signed-off-by: SuperQ <[email protected]>
@SuperQ
Copy link
Member

SuperQ commented Jan 10, 2022

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 added a commit that referenced this issue Jan 10, 2022
In order to support mcrouter, add a flag to disable the collection of
"STATS SETTINGS".

Fixes: #113

Signed-off-by: SuperQ <[email protected]>
@matthiasr
Copy link
Contributor

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"?

@blkperl
Copy link
Contributor

blkperl commented Feb 13, 2023

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.

@SuperQ
Copy link
Member

SuperQ commented Feb 13, 2023

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.

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

Successfully merging a pull request may close this issue.

6 participants