Service configuration with wildcards

Hello everybody.

I’m trying to create a service configuration in my Linkerd because I have a need for different timeouts for different services. Running on DC/OS.
My prefix looks something like this: /svc/*.actions.micro-gateways.api-gateway.dcos-internal-test.*-dc-cluster.domain.com. I also have a prefix for the rest of the services - /svc. So most of the services should have shorter timeouts, but any service that matches the long prefix should be able to operate longer:

  service:
    kind: io.l5d.static
    configs:
    - prefix: /svc
      totalTimeoutMs: 15000
    - prefix: /svc/*.actions.micro-gateways.api-gateway.dcos-internal-test.*-dc-cluster.domain.com
      totalTimeoutMs: 60000

Though I certainly have a service running in this path, I don’t see the different timeout setting taking effect. The full name is delay.actions.micro-gateways.api-gateway.dcos-internal-test.env-dc-cluster.domain.com.
Seems Linkerd doesn’t recognise it. Not using a transformer from any sort.

Hi @jacobgo!

Path patterns currently only support wildcards for the whole segment (e.g. /foo/*/bar) and not wildcards for partial segments (e.g. /foo/*-bar). However, based on some recent work on the path pattern matcher, it probably wouldn’t be too hard to add support for this.

In the meantime, you may be able to work around this by using the io.buoyant.http.domainToPathPfx namer to rewrite paths like /svc/foo.actions.blah to /pfx/blah/actions/foo and use a pattern like /pfx/*/actions/foo.

Thanks for the reply @Alex.

If I understand you correctly, what you’re suggesting is a switch from using a service totalTimeoutMs setting to a client requestAttemptTimeoutMs setting. From your documentation I read that it’s not exactly the same thing, since the client timeout is per every request and/or retry, while the service timeout is for an entire request, including all retries. Am I wrong? So if I have already a certain service timeout configured for all services in my cluster, switching to client timeouts will require quite a major change in my timeouts strategy.

Ah, sorry, I didn’t notice at first that this is a service config and not a client config. Your understanding is correct.

Given this, I think you have a few different options for your config to be able to differentiate between these different types of services:

  • Explicitly list out a timeout config for each service instead of using wildcards
  • Create an identifier plugin that produces service names which are divided into segments so that they can be more easily matched against
  • Update Linker’s path pattern matching to allow sub-segment wildcards