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

Fix: Dont append deprecated span metrics connector flag #1036

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

frzifus
Copy link
Collaborator

@frzifus frzifus commented Sep 24, 2024

Since Jaeger 1.58.0 this flag no longer exists.

Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 73.07%. Comparing base (c39140e) to head (1495102).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1036      +/-   ##
==========================================
- Coverage   73.08%   73.07%   -0.01%     
==========================================
  Files         106      106              
  Lines        6624     6623       -1     
==========================================
- Hits         4841     4840       -1     
  Misses       1493     1493              
  Partials      290      290              
Flag Coverage Δ
unittests 73.07% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -366,7 +366,6 @@ func enableMonitoringTab(tempo v1alpha1.TempoStack, jaegerQueryContainer corev1.
},
},
Args: []string{
"--prometheus.query.support-spanmetrics-connector",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the env var be set somewhere instead of the cli arg?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be no longer needed. Previously it was already enabled by default.

@IshwarKanse
Copy link
Contributor

Tested the change and the query frontend pods doesn't crash with the error and spanmetrics are also working fine.

Bundle image built off the PR quay.io/rhn_support_ikanse/tempo-operator-bundle:v0.13

% oc get pods
NAME                                               READY   STATUS      RESTARTS   AGE
hotrod-77d7f46665-lhnv8                            1/1     Running     0          13m
hotrod-curl-528x5                                  1/1     Running     0          13m
minio-cb747bcc4-nrdjr                              1/1     Running     0          14m
otel-collector-584d4f5d54-s2q9c                    1/1     Running     0          14m
tempo-redmetrics-compactor-8697b4d4f7-xt44r        1/1     Running     0          14m
tempo-redmetrics-distributor-568cf8989c-7ll72      1/1     Running     0          14m
tempo-redmetrics-ingester-0                        1/1     Running     0          14m
tempo-redmetrics-querier-67ff7f4dc4-lb8qw          1/1     Running     0          14m
tempo-redmetrics-query-frontend-8689884bfc-jbxp5   4/4     Running     0          14m
verify-metrics-ppkbs                               0/1     Completed   0          13m
--- PASS: chainsaw (224.12s)
    --- PASS: chainsaw/red-metrics (224.12s)
PASS
Tests Summary...
- Passed  tests 1
- Failed  tests 0
- Skipped tests 0
Done.
Screenshot 2024-09-25 at 1 14 00 PM

I do see this error in the Jaeger query container. Not sure what it means.

% oc logs tempo-redmetrics-query-frontend-8689884bfc-jbxp5 -c jaeger-query
{"level":"error","ts":1727250190.7516181,"caller":"http/server.go:3487","msg":"http: superfluous response.WriteHeader call from github.com/gorilla/handlers.(*compressResponseWriter).WriteHeader (compress.go:26)","stacktrace":"net/http.(*Server).logf\n\tnet/http/server.go:3487\nnet/http.(*response).WriteHeader\n\tnet/http/server.go:1201\ngh.neting.cc/gorilla/handlers.(*compressResponseWriter).WriteHeader\n\tgh.neting.cc/gorilla/handlers@v1.5.2/compress.go:26\ngh.neting.cc/felixge/httpsnoop.(*rw).WriteHeader\n\tgh.neting.cc/felixge/httpsnoop@v1.0.4/wrap_generated_gteq_1.8.go:372\ngo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request.(*RespWriterWrapper).writeHeader\n\tgo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.54.0/internal/request/resp_writer_wrapper.go:78\ngo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request.(*RespWriterWrapper).Write\n\tgo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.54.0/internal/request/resp_writer_wrapper.go:47\ngh.neting.cc/felixge/httpsnoop.(*rw).Write\n\tgh.neting.cc/felixge/httpsnoop@v1.0.4/wrap_generated_gteq_1.8.go:380\ngh.neting.cc/gogo/protobuf/jsonpb.(*errWriter).write\n\tgh.neting.cc/gogo/protobuf@v1.3.2/jsonpb/jsonpb.go:1272\ngh.neting.cc/gogo/protobuf/jsonpb.(*Marshaler).marshalField\n\tgh.neting.cc/gogo/protobuf@v1.3.2/jsonpb/jsonpb.go:507\ngh.neting.cc/gogo/protobuf/jsonpb.(*Marshaler).marshalObject\n\tgh.neting.cc/gogo/protobuf@v1.3.2/jsonpb/jsonpb.go:371\ngh.neting.cc/gogo/protobuf/jsonpb.(*Marshaler).Marshal\n\tgh.neting.cc/gogo/protobuf@v1.3.2/jsonpb/jsonpb.go:138\ngh.neting.cc/jaegertracing/jaeger/cmd/query/app.(*APIHandler).writeJSON.newProtoJSONMarshaler.func1\n\tgh.neting.cc/jaegertracing/jaeger/cmd/query/app/json_marshaler.go:25\ngh.neting.cc/jaegertracing/jaeger/cmd/query/app.(*APIHandler).writeJSON\n\tgh.neting.cc/jaegertracing/jaeger/cmd/query/app/http_handler.go:522\ngh.neting.cc/jaegertracing/jaeger/cmd/query/app.(*APIHandler).metrics\n\tgh.neting.cc/jaegertracing/jaeger/cmd/query/app/http_handler.go:363\ngh.neting.cc/jaegertracing/jaeger/cmd/query/app.(*APIHandler).latencies\n\tgh.neting.cc/jaegertracing/jaeger/cmd/query/app/http_handler.go:318\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2220\ngh.neting.cc/jaegertracing/jaeger/cmd/query/app.(*APIHandler).handleFunc.traceResponseHandler.func2\n\tgh.neting.cc/jaegertracing/jaeger/cmd/query/app/http_handler.go:538\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2220\ngo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp.WithRouteTag.func1\n\tgo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.54.0/handler.go:215\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2220\ngo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp.(*middleware).serveHTTP\n\tgo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.54.0/handler.go:177\ngo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp.NewMiddleware.func1.1\n\tgo.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.54.0/handler.go:65\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2220\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2220\ngh.neting.cc/gorilla/mux.(*Router).ServeHTTP\n\tgh.neting.cc/gorilla/mux@v1.8.1/mux.go:212\ngh.neting.cc/jaegertracing/jaeger/cmd/query/app.createHTTPServer.additionalHeadersHandler.func4\n\tgh.neting.cc/jaegertracing/jaeger/cmd/query/app/additional_headers_handler.go:17\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2220\ngh.neting.cc/jaegertracing/jaeger/cmd/query/app.createHTTPServer.PropagationHandler.func5\n\tgh.neting.cc/jaegertracing/jaeger/pkg/bearertoken/http.go:39\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2220\ngh.neting.cc/jaegertracing/jaeger/cmd/query/app.createHTTPServer.CompressHandler.CompressHandlerLevel.func6\n\tgh.neting.cc/gorilla/handlers@v1.5.2/compress.go:141\nnet/http.HandlerFunc.ServeHTTP\n\tnet/http/server.go:2220\ngh.neting.cc/gorilla/handlers.recoveryHandler.ServeHTTP\n\tgh.neting.cc/gorilla/handlers@v1.5.2/recovery.go:80\nnet/http.serverHandler.ServeHTTP\n\tnet/http/server.go:3210\nnet/http.(*conn).serve\n\tnet/http/server.go:2092"}

@frzifus frzifus marked this pull request as ready for review September 25, 2024 08:12
@frzifus
Copy link
Collaborator Author

frzifus commented Sep 25, 2024

"msg": "http: superfluous response.WriteHeader call from github.com/gorilla/handlers.(*compressResponseWriter).WriteHeader (compress.go:26)",

Looks like WriteHeader is called multiple times in jaeger-query. Looking at the stack trace:

  "stacktrace": [
    "net/http.(*Server).logf",
    "net/http/server.go:3487",
    "net/http.(*response).WriteHeader",
    "net/http/server.go:1201",
    "github.com/gorilla/handlers.(*compressResponseWriter).WriteHeader",
    "github.com/gorilla/handlers@v1.5.2/compress.go:26",
    "github.com/felixge/httpsnoop.(*rw).WriteHeader",
    "github.com/felixge/httpsnoop@v1.0.4/wrap_generated_gteq_1.8.go:372",
    "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request.(*RespWriterWrapper).writeHeader",
    "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.54.0/internal/request/resp_writer_wrapper.go:78",
    "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp/internal/request.(*RespWriterWrapper).Write",
    "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.54.0/internal/request/resp_writer_wrapper.go:47",
    "github.com/felixge/httpsnoop.(*rw).Write",
    "github.com/felixge/httpsnoop@v1.0.4/wrap_generated_gteq_1.8.go:380",
    "github.com/gogo/protobuf/jsonpb.(*errWriter).write",
    "github.com/gogo/protobuf@v1.3.2/jsonpb/jsonpb.go:1272",
    "github.com/gogo/protobuf/jsonpb.(*Marshaler).marshalField",
    "github.com/gogo/protobuf@v1.3.2/jsonpb/jsonpb.go:507",
    "github.com/gogo/protobuf/jsonpb.(*Marshaler).marshalObject",
    "github.com/gogo/protobuf@v1.3.2/jsonpb/jsonpb.go:371",
    "github.com/gogo/protobuf/jsonpb.(*Marshaler).Marshal",
    "github.com/gogo/protobuf@v1.3.2/jsonpb/jsonpb.go:138",
    "github.com/jaegertracing/jaeger/cmd/query/app.(*APIHandler).writeJSON.newProtoJSONMarshaler.func1",
    "github.com/jaegertracing/jaeger/cmd/query/app/json_marshaler.go:25",
    "github.com/jaegertracing/jaeger/cmd/query/app.(*APIHandler).writeJSON",
    "github.com/jaegertracing/jaeger/cmd/query/app/http_handler.go:522",
    "github.com/jaegertracing/jaeger/cmd/query/app.(*APIHandler).metrics",
    "github.com/jaegertracing/jaeger/cmd/query/app/http_handler.go:363",
    "github.com/jaegertracing/jaeger/cmd/query/app.(*APIHandler).latencies",
    "github.com/jaegertracing/jaeger/cmd/query/app/http_handler.go:318",
    "net/http.HandlerFunc.ServeHTTP",
    "net/http/server.go:2220",
    "github.com/jaegertracing/jaeger/cmd/query/app.(*APIHandler).handleFunc.traceResponseHandler.func2",
    "github.com/jaegertracing/jaeger/cmd/query/app/http_handler.go:538",
    "net/http.HandlerFunc.ServeHTTP",
    "net/http/server.go:2220",
    "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp.WithRouteTag.func1",
    "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.54.0/handler.go:215",
    "net/http.HandlerFunc.ServeHTTP",
    "net/http/server.go:2220",
    "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp.(*middleware).serveHTTP",
    "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.54.0/handler.go:177",
    "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp.NewMiddleware.func1.1",
    "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.54.0/handler.go:65",
    "net/http.HandlerFunc.ServeHTTP",
    "net/http/server.go:2220",
    "github.com/gorilla/mux.(*Router).ServeHTTP",
    "github.com/gorilla/mux@v1.8.1/mux.go:212",
    "github.com/jaegertracing/jaeger/cmd/query/app.createHTTPServer.additionalHeadersHandler.func4",
    "github.com/jaegertracing/jaeger/cmd/query/app/additional_headers_handler.go:17",
    "net/http.HandlerFunc.ServeHTTP",
    "net/http/server.go:2220",
    "github.com/jaegertracing/jaeger/cmd/query/app.createHTTPServer.PropagationHandler.func5",
    "github.com/jaegertracing/jaeger/pkg/bearertoken/http.go:39",
    "net/http.HandlerFunc.ServeHTTP",
    "net/http/server.go:2220",
    "github.com/jaegertracing/jaeger/cmd/query/app.createHTTPServer.CompressHandler.CompressHandlerLevel.func6",
    "github.com/gorilla/handlers@v1.5.2/compress.go:141",
    "net/http.HandlerFunc.ServeHTTP",
    "net/http/server.go:2220",
    "github.com/gorilla/handlers.recoveryHandler.ServeHTTP",
    "github.com/gorilla/handlers@v1.5.2/recovery.go:80",
    "net/http.serverHandler.ServeHTTP",
    "net/http/server.go:3210",
    "net/http.(*conn).serve",
    "net/http/server.go:2092"
  ]

It the first two aside from "net/http.(*response).WriteHeader", are "github.com/gorilla/handlers.(*compressResponseWriter).WriteHeader", & "github.com/felixge/httpsnoop.(*rw).WriteHeader",.
But we would need to manually check if the call WriteHeader on the actual response.

@frzifus frzifus enabled auto-merge (squash) September 25, 2024 08:39
@frzifus frzifus requested a review from iblancasa September 25, 2024 08:51
@frzifus frzifus merged commit f221206 into grafana:main Sep 25, 2024
11 checks passed
@frzifus frzifus deleted the fix/unknown_flag branch September 25, 2024 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants