mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +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"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -109,13 +110,16 @@ func containsNodeListSpan(req *traceservice.ExportTraceServiceRequest) bool {
|
|||||||
for _, resourceSpans := range req.GetResourceSpans() {
|
for _, resourceSpans := range req.GetResourceSpans() {
|
||||||
for _, instrumentationSpans := range resourceSpans.GetScopeSpans() {
|
for _, instrumentationSpans := range resourceSpans.GetScopeSpans() {
|
||||||
for _, span := range instrumentationSpans.GetSpans() {
|
for _, span := range instrumentationSpans.GetSpans() {
|
||||||
if span.Name != "KubernetesAPI" {
|
if span.Name != "HTTP GET" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
for _, attr := range span.GetAttributes() {
|
for _, attr := range span.GetAttributes() {
|
||||||
if attr.GetKey() == "http.target" && attr.GetValue().GetStringValue() == "/api/v1/nodes" {
|
if attr.GetKey() == "http.url" {
|
||||||
// We found our request!
|
value := attr.GetValue().GetStringValue()
|
||||||
return true
|
if strings.HasSuffix(value, "/api/v1/nodes") {
|
||||||
|
// We found our request!
|
||||||
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user