instana / otel-shop

OpenTelemetry Demo App
Apache License 2.0
17 stars 12 forks source link

TypeError: requestCount.bind is not a function #268

Closed esara closed 2 years ago

esara commented 2 years ago

running on my openshift cluter and having some trouble with a few of the robot-shop microservices with errors like

$ oc logs -f -n otel-shop otel-shop-catalogue-59cd5f9f7f-lwncq 
{"level":30,"time":1653170515740,"pid":1,"hostname":"otel-shop-catalogue-59cd5f9f7f-lwncq","msg":"Started on port"}
{"level":30,"time":1653170515947,"pid":1,"hostname":"otel-shop-catalogue-59cd5f9f7f-lwncq","msg":"MongoDB connected"}
{"level":30,"time":1653170518238,"pid":1,"hostname":"otel-shop-catalogue-59cd5f9f7f-lwncq","req":{"id":1,"method":"GET","url":"/health-check","query":{},"params":{},"headers":{"host":"10.129.6.151:8080","user-agent":"kube-probe/1.21","accept":"*/*","connection":"close"},"remoteAddress":"::ffff:10.129.6.1","remotePort":47904},"trace_id":"a2d29bb106b9e5ab6dd69b938f7a23c8","span_id":"0bacb1ac719cfe17","trace_flags":"01","res":{"statusCode":500,"headers":{"x-powered-by":"Express","content-security-policy":"default-src 'none'","x-content-type-options":"nosniff","content-type":"text/html; charset=utf-8","content-length":1194}},"err":{"type":"Error","message":"failed with status code 500","stack":"Error: failed with status code 500\n    at ServerResponse.onResFinished (/opt/server/node_modules/pino-http/logger.js:107:40)\n    at /opt/server/node_modules/@opentelemetry/context-async-hooks/build/src/AbstractAsyncHooksContextManager.js:49:55\n    at AsyncLocalStorage.run (node:async_hooks:327:14)\n    at AsyncLocalStorageContextManager.with (/opt/server/node_modules/@opentelemetry/context-async-hooks/build/src/AsyncLocalStorageContextManager.js:33:40)\n    at ServerResponse.contextWrapper (/opt/server/node_modules/@opentelemetry/context-async-hooks/build/src/AbstractAsyncHooksContextManager.js:49:32)\n    at ServerResponse.emit (node:events:539:35)\n    at onFinish (node:_http_outgoing:830:10)\n    at callback (node:internal/streams/writable:553:21)\n    at afterWrite (node:internal/streams/writable:498:5)\n    at afterWriteTick (node:internal/streams/writable:485:10)"},"responseTime":25,"msg":"request errored"}
TypeError: requestCount.bind is not a function
    at /opt/server/monitoring.js:25:41
    at /opt/server/node_modules/@opentelemetry/instrumentation-express/build/src/instrumentation.js:207:41
    at Layer.handle [as handle_request] (/opt/server/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/opt/server/node_modules/express/lib/router/index.js:328:13)
    at /opt/server/node_modules/express/lib/router/index.js:286:9
    at Function.process_params (/opt/server/node_modules/express/lib/router/index.js:346:12)
    at next (/opt/server/node_modules/express/lib/router/index.js:280:10)
    at /opt/server/node_modules/@opentelemetry/context-async-hooks/build/src/AbstractAsyncHooksContextManager.js:49:55
    at AsyncLocalStorage.run (node:async_hooks:327:14)
    at AsyncLocalStorageContextManager.with (/opt/server/node_modules/@opentelemetry/context-async-hooks/build/src/AsyncLocalStorageContextManager.js:33:40)
...

and of course the pods are not becoming ready

$ oc get pods -n otel-shop
NAME                                   READY   STATUS    RESTARTS   AGE
otel-shop-cart-657cc7d647-qwqbr        0/1     Running   0          61m
otel-shop-catalogue-59cd5f9f7f-lwncq   0/1     Running   0          61m
otel-shop-dispatch-6f789d4f75-dpfxw    1/1     Running   0          34h
otel-shop-front-5fcd4d7ddd-8bwnw       1/1     Running   0          81m
otel-shop-load-5d6c6cf968-pmzfh        1/1     Running   0          34h
otel-shop-mongodb-5d7b969b4c-7j9l6     1/1     Running   0          82m
otel-shop-payment-84787cb46f-qnskd     1/1     Running   0          31h
otel-shop-rabbitmq-5c79c47764-q4cgn    1/1     Running   0          29h
otel-shop-ratings-6686bfbd79-4pcz6     0/1     Running   0          61m
otel-shop-redis-0                      1/1     Running   0          29h
otel-shop-shipping-67b45478f8-89jjg    0/1     Running   3          61m
otel-shop-user-6df576467c-jmldb        0/1     Running   1          61m
otel-shop-web-85c784cfc7-j5k72         1/1     Running   0          81m

is there anything that I should configured/deployed differently?

cedricziel commented 2 years ago

The type was changed - migrated off of bind in 2d686d3e350613976612941c8d060ff3966e92fc

esara commented 2 years ago

thanks Cedric, this is working perfectly

$ oc get pods -n otel-shop otel-shop-catalogue-866f4cbdb8-87rpq
NAME                                   READY   STATUS    RESTARTS   AGE
otel-shop-catalogue-866f4cbdb8-87rpq   1/1     Running   0          6m38s