mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
fix how we look for our request
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
parent
3eaca7cf51
commit
a1635fa702
@ -21,6 +21,7 @@ import (
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@ -109,13 +110,16 @@ func containsNodeListSpan(req *traceservice.ExportTraceServiceRequest) bool {
|
||||
for _, resourceSpans := range req.GetResourceSpans() {
|
||||
for _, instrumentationSpans := range resourceSpans.GetScopeSpans() {
|
||||
for _, span := range instrumentationSpans.GetSpans() {
|
||||
if span.Name != "KubernetesAPI" {
|
||||
if span.Name != "HTTP GET" {
|
||||
continue
|
||||
}
|
||||
for _, attr := range span.GetAttributes() {
|
||||
if attr.GetKey() == "http.target" && attr.GetValue().GetStringValue() == "/api/v1/nodes" {
|
||||
// We found our request!
|
||||
return true
|
||||
if attr.GetKey() == "http.url" {
|
||||
value := attr.GetValue().GetStringValue()
|
||||
if strings.HasSuffix(value, "/api/v1/nodes") {
|
||||
// We found our request!
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user