-
Notifications
You must be signed in to change notification settings - Fork 7
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
allow overriding stat name via Upstream label #10654
base: main
Are you sure you want to change the base?
Conversation
fb99f7f
to
14f10b9
Compare
Entry("non-kube upstream", createStaticUpstream("name", "ns", nil), "name_ns"), | ||
Entry("non-kube upstream", createStaticUpstream("name", "ns", map[string]string{ | ||
translator.ClusterStatNameLabel: translator.FormatClusterStatName("istio-se_", "usname", "usns", "svcns", "svcName", 123), | ||
}), "istio-se_usname_usns_svcns_svcName_123"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@krisztianfekete can you spot check this output would be correctly parsed
changelog: | ||
- type: NON_USER_FACING | ||
description: >- | ||
Allow using the label `~internal.solo.io/cluster-stat-name` to manually set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allow using the label `~internal.solo.io/cluster-stat-name` to manually set | |
Allow using the label `internal.solo.io/cluster-stat-name` to manually set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just changed the actual label. I think we want the ~, otherwise any user in any namespace could break the metric for any service in any other namespace.
const ClusterStatNameLabel = "internal.solo.io/cluster-stat-name" | ||
|
||
// FormatClusterStatName produces a parseable alt_stat_name. | ||
func FormatClusterStatName( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to export this? will it be used externally? (besides in the translator test)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may use it in solo-projects. I technically don't have to.
Description
Allow using the label
~internal.solo.io/cluster-stat-name
to manually set the alt_stat_name on the Envoy cluster that will result from an Upstream. This allows synthetic Upstreams to specify parseable alt_stat_name.API changes
(Internal) ~internal.solo.io/cluster-stat-name can be set from code that generates Upstream synthetically. The ~ prevents users from setting this label and hijacking some services stats.
Code changes
Context
ServiceEntry support that will eventually land in kgateway, but we want it to produce parseable stat names in the near terrm.