-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
traceing use elastic apm #4386
Comments
Help me. |
Same panic in thanos@0.22.0 Thanos, Golang version used:
panic log:
Full logs to relevant components: Full logs with --log.level=debug{"caller":"main.go:64","level":"debug","msg":"maxprocs: Updating GOMAXPROCS=[2]: determined from CPU quota","ts":"2021-08-17T09:31:10.272249221Z"} {"caller":"factory.go:38","level":"info","msg":"loading tracing configuration","ts":"2021-08-17T09:31:10.272428136Z"} {"caller":"engine.go:292","level":"debug","msg":"Lookback delta is zero, setting to default value","ts":"2021-08-17T09:31:10.27636971Z","value":"5m0s"} {"caller":"options.go:24","level":"info","msg":"disabled TLS, key and cert must be set to enable","protocol":"gRPC","ts":"2021-08-17T09:31:10.277965106Z"} {"caller":"query.go:640","level":"info","msg":"starting query node","ts":"2021-08-17T09:31:10.278338688Z"} {"caller":"intrumentation.go:60","level":"info","msg":"changing probe status","status":"healthy","ts":"2021-08-17T09:31:10.278503006Z"} {"address":"0.0.0.0:9090","caller":"http.go:63","component":"query","level":"info","msg":"listening for requests and metrics","service":"http/server","ts":"2021-08-17T09:31:10.278536659Z"} {"caller":"tls_config.go:191","component":"query","http2":false,"level":"info","msg":"TLS is disabled.","service":"http/server","ts":"2021-08-17T09:31:10.278649952Z"} {"caller":"intrumentation.go:48","level":"info","msg":"changing probe status","status":"ready","ts":"2021-08-17T09:31:10.278713161Z"} {"address":"0.0.0.0:10901","caller":"grpc.go:123","component":"query","level":"info","msg":"listening for serving gRPC","service":"gRPC/server","ts":"2021-08-17T09:31:10.278743287Z"} {"cachedStores":0,"caller":"storeset.go:409","component":"storeset","level":"debug","msg":"starting updating storeAPIs","ts":"2021-08-17T09:31:10.278776269Z"} {"activeStores":0,"cachedStores":0,"caller":"storeset.go:412","component":"storeset","level":"debug","msg":"checked requested storeAPIs","ts":"2021-08-17T09:31:10.278829168Z"} {"cachedStores":0,"caller":"storeset.go:409","component":"storeset","level":"debug","msg":"starting updating storeAPIs","ts":"2021-08-17T09:31:15.279829519Z"} {"activeStores":9,"cachedStores":0,"caller":"storeset.go:412","component":"storeset","level":"debug","msg":"checked requested storeAPIs","ts":"2021-08-17T09:31:15.325354902Z"} {"address":"172.16.0.24:10901","caller":"storeset.go:463","component":"storeset","extLset":"{receive=\"true\", receive_replica=\"thanos-receive-3\", tenant_id=\"default-tenant\"}","level":"info","msg":"adding new storeAPI to query storeset","ts":"2021-08-17T09:31:15.325406739Z"} {"address":"172.16.0.250:10901","caller":"storeset.go:463","component":"storeset","extLset":"{receive=\"true\", receive_replica=\"thanos-receive-2\", tenant_id=\"default-tenant\"}","level":"info","msg":"adding new storeAPI to query storeset","ts":"2021-08-17T09:31:15.32542843Z"} {"address":"172.16.0.113:10901","caller":"storeset.go:463","component":"storeset","extLset":"{receive=\"true\", receive_replica=\"thanos-receive-0\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-1\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-2\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-3\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-4\", tenant_id=\"default-tenant\"}","level":"info","msg":"adding new storeAPI to query storeset","ts":"2021-08-17T09:31:15.325471391Z"} {"address":"172.16.1.7:10901","caller":"storeset.go:463","component":"storeset","extLset":"{receive=\"true\", receive_replica=\"thanos-receive-0\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-1\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-2\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-3\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-4\", tenant_id=\"default-tenant\"}","level":"info","msg":"adding new storeAPI to query storeset","ts":"2021-08-17T09:31:15.325507488Z"} {"address":"172.16.1.3:10901","caller":"storeset.go:463","component":"storeset","extLset":"{receive=\"true\", receive_replica=\"thanos-receive-0\", tenant_id=\"default-tenant\"}","level":"info","msg":"adding new storeAPI to query storeset","ts":"2021-08-17T09:31:15.325530953Z"} {"address":"172.16.0.110:10901","caller":"storeset.go:463","component":"storeset","extLset":"{receive=\"true\", receive_replica=\"thanos-receive-4\", tenant_id=\"default-tenant\"}","level":"info","msg":"adding new storeAPI to query storeset","ts":"2021-08-17T09:31:15.325552383Z"} {"address":"172.16.0.184:10901","caller":"storeset.go:463","component":"storeset","extLset":"{receive=\"true\", receive_replica=\"thanos-receive-1\", tenant_id=\"default-tenant\"}","level":"info","msg":"adding new storeAPI to query storeset","ts":"2021-08-17T09:31:15.325574765Z"} {"address":"172.16.0.32:10901","caller":"storeset.go:463","component":"storeset","extLset":"{rule_replica=\"thanos-rule-0\"}","level":"info","msg":"adding new storeAPI to query storeset","ts":"2021-08-17T09:31:15.325597248Z"} {"address":"172.16.0.116:10901","caller":"storeset.go:463","component":"storeset","extLset":"{rule_replica=\"thanos-rule-1\"}","level":"info","msg":"adding new storeAPI to query storeset","ts":"2021-08-17T09:31:15.325620601Z"} {"cachedStores":9,"caller":"storeset.go:409","component":"storeset","level":"debug","msg":"starting updating storeAPIs","ts":"2021-08-17T09:31:20.282361055Z"} {"activeStores":9,"cachedStores":9,"caller":"storeset.go:412","component":"storeset","level":"debug","msg":"checked requested storeAPIs","ts":"2021-08-17T09:31:20.284025571Z"} {"cachedStores":9,"caller":"storeset.go:409","component":"storeset","level":"debug","msg":"starting updating storeAPIs","ts":"2021-08-17T09:31:25.282178565Z"} {"activeStores":9,"cachedStores":9,"caller":"storeset.go:412","component":"storeset","level":"debug","msg":"checked requested storeAPIs","ts":"2021-08-17T09:31:25.283644257Z"} {"cachedStores":9,"caller":"storeset.go:409","component":"storeset","level":"debug","msg":"starting updating storeAPIs","ts":"2021-08-17T09:31:30.282237366Z"} {"activeStores":9,"cachedStores":9,"caller":"storeset.go:412","component":"storeset","level":"debug","msg":"checked requested storeAPIs","ts":"2021-08-17T09:31:30.284005367Z"} {"cachedStores":9,"caller":"storeset.go:409","component":"storeset","level":"debug","msg":"starting updating storeAPIs","ts":"2021-08-17T09:31:35.279837842Z"} {"activeStores":9,"cachedStores":9,"caller":"storeset.go:412","component":"storeset","level":"debug","msg":"checked requested storeAPIs","ts":"2021-08-17T09:31:35.281350331Z"} {"caller":"proxy.go:659","level":"debug","msg":"Store Addr: 172.16.0.110:10901 LabelSets: {receive=\"true\", receive_replica=\"thanos-receive-4\", tenant_id=\"default-tenant\"} Mint: 1628582400000 Maxt: 9223372036854775807 queried;Store Addr: 172.16.0.250:10901 LabelSets: {receive=\"true\", receive_replica=\"thanos-receive-2\", tenant_id=\"default-tenant\"} Mint: 1628582400000 Maxt: 9223372036854775807 queried;Store Addr: 172.16.0.113:10901 LabelSets: {receive=\"true\", receive_replica=\"thanos-receive-0\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-1\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-2\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-3\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-4\", tenant_id=\"default-tenant\"} Mint: 1624439036465 Maxt: 1629188507217 queried;Store Addr: 172.16.1.7:10901 LabelSets: {receive=\"true\", receive_replica=\"thanos-receive-0\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-1\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-2\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-3\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-4\", tenant_id=\"default-tenant\"} Mint: 1624439036465 Maxt: 1629188507217 queried;Store Addr: 172.16.1.3:10901 LabelSets: {receive=\"true\", receive_replica=\"thanos-receive-0\", tenant_id=\"default-tenant\"} Mint: 1628582400000 Maxt: 9223372036854775807 queried;Store Addr: 172.16.0.116:10901 LabelSets: {rule_replica=\"thanos-rule-1\"} Mint: 9223372036854775807 Maxt: 9223372036854775807 filtered out due to does not have data within this time period: [1629149483143,1629192683143]. Store time ranges: [9223372036854775807,9223372036854775807];Store Addr: 172.16.0.24:10901 LabelSets: {receive=\"true\", receive_replica=\"thanos-receive-3\", tenant_id=\"default-tenant\"} Mint: 1628582400000 Maxt: 9223372036854775807 queried;Store Addr: 172.16.0.184:10901 LabelSets: {receive=\"true\", receive_replica=\"thanos-receive-1\", tenant_id=\"default-tenant\"} Mint: 1628582400000 Maxt: 9223372036854775807 queried;Store Addr: 172.16.0.32:10901 LabelSets: {rule_replica=\"thanos-rule-0\"} Mint: 9223372036854775807 Maxt: 9223372036854775807 filtered out due to does not have data within this time period: [1629149483143,1629192683143]. Store time ranges: [9223372036854775807,9223372036854775807]","ts":"2021-08-17T09:31:38.854410793Z"} {"caller":"proxy.go:274","component":"proxy","level":"debug","msg":"Series: started fanout streams","request":"min_time:1629192392224 max_time:1629192692224 matchers: aggregates:COUNT aggregates:SUM partial_response_disabled:true ","status":"Store Addr: 172.16.0.24:10901 LabelSets: {receive=\"true\", receive_replica=\"thanos-receive-3\", tenant_id=\"default-tenant\"} Mint: 1628582400000 Maxt: 9223372036854775807 queried;Store Addr: 172.16.0.184:10901 LabelSets: {receive=\"true\", receive_replica=\"thanos-receive-1\", tenant_id=\"default-tenant\"} Mint: 1628582400000 Maxt: 9223372036854775807 queried;store Addr: 172.16.0.32:10901 LabelSets: {rule_replica=\"thanos-rule-0\"} Mint: 9223372036854775807 Maxt: 9223372036854775807 filtered out: does not have data within this time period: [1629192392224,1629192692224]. Store time ranges: [9223372036854775807,9223372036854775807];Store Addr: 172.16.1.3:10901 LabelSets: {receive=\"true\", receive_replica=\"thanos-receive-0\", tenant_id=\"default-tenant\"} Mint: 1628582400000 Maxt: 9223372036854775807 queried;store Addr: 172.16.0.116:10901 LabelSets: {rule_replica=\"thanos-rule-1\"} Mint: 9223372036854775807 Maxt: 9223372036854775807 filtered out: does not have data within this time period: [1629192392224,1629192692224]. Store time ranges: [9223372036854775807,9223372036854775807];Store Addr: 172.16.0.110:10901 LabelSets: {receive=\"true\", receive_replica=\"thanos-receive-4\", tenant_id=\"default-tenant\"} Mint: 1628582400000 Maxt: 9223372036854775807 queried;Store Addr: 172.16.0.250:10901 LabelSets: {receive=\"true\", receive_replica=\"thanos-receive-2\", tenant_id=\"default-tenant\"} Mint: 1628582400000 Maxt: 9223372036854775807 queried;store Addr: 172.16.0.113:10901 LabelSets: {receive=\"true\", receive_replica=\"thanos-receive-0\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-1\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-2\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-3\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-4\", tenant_id=\"default-tenant\"} Mint: 1624439036465 Maxt: 1629188507217 filtered out: does not have data within this time period: [1629192392224,1629192692224]. Store time ranges: [1624439036465,1629188507217];store Addr: 172.16.1.7:10901 LabelSets: {receive=\"true\", receive_replica=\"thanos-receive-0\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-1\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-2\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-3\", tenant_id=\"default-tenant\"},{receive=\"true\", receive_replica=\"thanos-receive-4\", tenant_id=\"default-tenant\"} Mint: 1624439036465 Maxt: 1629188507217 filtered out: does not have data within this time period: [1629192392224,1629192692224]. Store time ranges: [1624439036465,1629188507217]","ts":"2021-08-17T09:31:38.924669277Z"} panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x143818f] |
Hello 👋 Looks like there was no activity on this issue for the last two months. |
I'm getting the same issue even after upgrading to 0.23.1 |
Looks like this started to appear after #4619 but hasn't been addressed yet. I'm wondering what is the exact issue, to me it looks like something might be up with APM's implementation. This would need further investigation but might be worth opening issue upstream as well. |
The problem is happening at pkg/mod/go.elastic.co/apm/module/apmot@v1.11.0/span.go:182 with the s.span.Context.SetLabel call. Everything is fine with spans from the inbound HTTP UI requests, where s.span.Context is set (likely directly in thanos/pkg/tracing/http.go) When an intercepted GRPC span is handled by the above APM span code however (e.g. when Thanos query is connecting to a store API over GRPC to service a query) s.span.Context is nil, and the null pointer deference for SetLabel causes the SIGSEGV. Looking at thanos/pkg/tracing/tracing/client/factory.go, it looks like elastic APM is the only library that is not passed a context when setting up a new tracer. I'm guessing that could be why the problem is only happening with APM, and only with traces using the grpc interception middleware That's as far as I got with a bunch of time and dlv. I'm not that experienced with golang or the ecosystem so can't fix it myself but hopefully that should give a lot more direction (assuming I'm right about the root cause) |
Thanks for the investigation @dbasden! I had a bit of closer look as well, to me it seems that for some reason, in the APM implementation, the According to the docs, the |
Hello 👋 Looks like there was no activity on this issue for the last two months. |
This is still needed and would be great to have it fixed :-) |
Hello 👋 Looks like there was no activity on this issue for the last two months. |
This is still needed and would be great to have it fixed :-) |
Hello 👋 Looks like there was no activity on this issue for the last two months. |
This is still needed and would be great to have it fixed :-) |
Can confirm still happening and still would be great to have fixed! |
Yes, this unfortunately this still needs more investigation, it would be great if someone who's affected had the time and resources to look at this 😞 |
Hello 👋 Looks like there was no activity on this issue for the last two months. |
Same error 0.28 |
Thanos, Prometheus and Golang version used:
Object Storage Provider:
COS
What happened:
thanos turns on the traceid function. Report indicators to elastic
elastic-apm-config
systemctl
Full logs to relevant components:
The text was updated successfully, but these errors were encountered: