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

statPrefix field in VirtualService doesn't work as the requiredEnvoyStatsMatcherInclusionRegexes doesn't match it #51639

Closed
2 tasks done
spacewander opened this issue Jun 20, 2024 · 0 comments · Fixed by #51640

Comments

@spacewander
Copy link
Contributor

spacewander commented Jun 20, 2024

Is this the right place to submit this?

  • This is not a security vulnerability or a crashing bug
  • This is not a question about how to use Istio

Bug Description

Istio allows people to collect route statistics via VirtualService's statPrefix field.
The statistics are rooted at vhost.<virtual host name>.route.<stat_prefix> .
The virtual host name is the combination of host and port.

However, the regex which is used to filter out metrics in stats_matcher doesn't match the prefix:

// required for metrics based on stat_prefix in virtual service.
requiredEnvoyStatsMatcherInclusionRegexes = `vhost\.*\.route\.*`

Here is the example:

package main

import (
	"fmt"
	"regexp"
)

const (
	requiredEnvoyStatsMatcherInclusionRegexes = `vhost\.*\.route\.*`
)

func main() {
        // virtual host name's host is default.local
	ok, _ := regexp.MatchString(requiredEnvoyStatsMatcherInclusionRegexes, "vhost.default.local:18000.route.routev1.upstream_rq_200")
	fmt.Printf("%+v\n", ok) // false
}

Version

$ istioctl version
client version: 1.21.0
control plane version: unknown
data plane version: unknown (4 proxies)

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"27", GitVersion:"v1.27.3", GitCommit:"25b4e43193bcda6c7328a6d147b1fb73a33f1598", GitTreeState:"clean", BuildDate:"2023-06-14T09:53:42Z", GoVersion:"go1.20.5", Compiler:"gc", Platform:"darwin/amd64"}
Kustomize Version: v5.0.1
Server Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.0", GitCommit:"b46a3f887ca979b1a5d14fd39cb1af43e7e5d12d", GitTreeState:"clean", BuildDate:"2022-12-20T03:36:50Z", GoVersion:"go1.19.4", Compiler:"gc", Platform:"linux/arm64"}

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants