mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-17 15:50:10 +00:00
change the integration test
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
This commit is contained in:
parent
84b9fbbdef
commit
02154293c7
@ -56,6 +56,10 @@ func WithTracing(handler http.Handler, tp trace.TracerProvider) http.Handler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getSpanNameFromRequestInfo(info *request.RequestInfo) string {
|
func getSpanNameFromRequestInfo(info *request.RequestInfo) string {
|
||||||
|
if !info.IsResourceRequest {
|
||||||
|
return info.Path
|
||||||
|
}
|
||||||
|
|
||||||
spanName := "/" + info.APIPrefix
|
spanName := "/" + info.APIPrefix
|
||||||
if info.APIGroup != "" {
|
if info.APIGroup != "" {
|
||||||
spanName += "/" + info.APIGroup
|
spanName += "/" + info.APIGroup
|
||||||
@ -66,7 +70,7 @@ func getSpanNameFromRequestInfo(info *request.RequestInfo) string {
|
|||||||
}
|
}
|
||||||
spanName += "/" + info.Resource
|
spanName += "/" + info.Resource
|
||||||
if info.Name != "" {
|
if info.Name != "" {
|
||||||
spanName += "/" + "{:id}"
|
spanName += "/" + "{:name}"
|
||||||
}
|
}
|
||||||
if info.Subresource != "" {
|
if info.Subresource != "" {
|
||||||
spanName += "/" + info.Subresource
|
spanName += "/" + info.Subresource
|
||||||
|
@ -309,7 +309,7 @@ endpoint: %s`, listener.Addr().String())), os.FileMode(0755)); err != nil {
|
|||||||
},
|
},
|
||||||
expectedTrace: []*spanExpectation{
|
expectedTrace: []*spanExpectation{
|
||||||
{
|
{
|
||||||
name: "KubernetesAPI",
|
name: "/api/v1/nodes",
|
||||||
attributes: map[string]func(*commonv1.AnyValue) bool{
|
attributes: map[string]func(*commonv1.AnyValue) bool{
|
||||||
"http.user_agent": func(v *commonv1.AnyValue) bool {
|
"http.user_agent": func(v *commonv1.AnyValue) bool {
|
||||||
return strings.HasPrefix(v.GetStringValue(), "tracing.test")
|
return strings.HasPrefix(v.GetStringValue(), "tracing.test")
|
||||||
@ -428,7 +428,7 @@ endpoint: %s`, listener.Addr().String())), os.FileMode(0755)); err != nil {
|
|||||||
},
|
},
|
||||||
expectedTrace: []*spanExpectation{
|
expectedTrace: []*spanExpectation{
|
||||||
{
|
{
|
||||||
name: "KubernetesAPI",
|
name: "/api/v1/nodes/{:name}",
|
||||||
attributes: map[string]func(*commonv1.AnyValue) bool{
|
attributes: map[string]func(*commonv1.AnyValue) bool{
|
||||||
"http.user_agent": func(v *commonv1.AnyValue) bool {
|
"http.user_agent": func(v *commonv1.AnyValue) bool {
|
||||||
return strings.HasPrefix(v.GetStringValue(), "tracing.test")
|
return strings.HasPrefix(v.GetStringValue(), "tracing.test")
|
||||||
@ -518,7 +518,7 @@ endpoint: %s`, listener.Addr().String())), os.FileMode(0755)); err != nil {
|
|||||||
},
|
},
|
||||||
expectedTrace: []*spanExpectation{
|
expectedTrace: []*spanExpectation{
|
||||||
{
|
{
|
||||||
name: "KubernetesAPI",
|
name: "/api/v1/nodes",
|
||||||
attributes: map[string]func(*commonv1.AnyValue) bool{
|
attributes: map[string]func(*commonv1.AnyValue) bool{
|
||||||
"http.user_agent": func(v *commonv1.AnyValue) bool {
|
"http.user_agent": func(v *commonv1.AnyValue) bool {
|
||||||
return strings.HasPrefix(v.GetStringValue(), "tracing.test")
|
return strings.HasPrefix(v.GetStringValue(), "tracing.test")
|
||||||
@ -636,7 +636,7 @@ endpoint: %s`, listener.Addr().String())), os.FileMode(0755)); err != nil {
|
|||||||
},
|
},
|
||||||
expectedTrace: []*spanExpectation{
|
expectedTrace: []*spanExpectation{
|
||||||
{
|
{
|
||||||
name: "KubernetesAPI",
|
name: "/api/v1/nodes/{:name}",
|
||||||
attributes: map[string]func(*commonv1.AnyValue) bool{
|
attributes: map[string]func(*commonv1.AnyValue) bool{
|
||||||
"http.user_agent": func(v *commonv1.AnyValue) bool {
|
"http.user_agent": func(v *commonv1.AnyValue) bool {
|
||||||
return strings.HasPrefix(v.GetStringValue(), "tracing.test")
|
return strings.HasPrefix(v.GetStringValue(), "tracing.test")
|
||||||
@ -780,7 +780,7 @@ endpoint: %s`, listener.Addr().String())), os.FileMode(0755)); err != nil {
|
|||||||
},
|
},
|
||||||
expectedTrace: []*spanExpectation{
|
expectedTrace: []*spanExpectation{
|
||||||
{
|
{
|
||||||
name: "KubernetesAPI",
|
name: "/api/v1/nodes/{:name}",
|
||||||
attributes: map[string]func(*commonv1.AnyValue) bool{
|
attributes: map[string]func(*commonv1.AnyValue) bool{
|
||||||
"http.user_agent": func(v *commonv1.AnyValue) bool {
|
"http.user_agent": func(v *commonv1.AnyValue) bool {
|
||||||
return strings.HasPrefix(v.GetStringValue(), "tracing.test")
|
return strings.HasPrefix(v.GetStringValue(), "tracing.test")
|
||||||
@ -901,7 +901,7 @@ endpoint: %s`, listener.Addr().String())), os.FileMode(0755)); err != nil {
|
|||||||
},
|
},
|
||||||
expectedTrace: []*spanExpectation{
|
expectedTrace: []*spanExpectation{
|
||||||
{
|
{
|
||||||
name: "KubernetesAPI",
|
name: "/api/v1/nodes/{:name}",
|
||||||
attributes: map[string]func(*commonv1.AnyValue) bool{
|
attributes: map[string]func(*commonv1.AnyValue) bool{
|
||||||
"http.user_agent": func(v *commonv1.AnyValue) bool {
|
"http.user_agent": func(v *commonv1.AnyValue) bool {
|
||||||
return strings.HasPrefix(v.GetStringValue(), "tracing.test")
|
return strings.HasPrefix(v.GetStringValue(), "tracing.test")
|
||||||
|
Loading…
Reference in New Issue
Block a user