Troubleshooting common issues with Laminar tracing
commonjs
modules.
Make sure that you pass `instrumentModules`
instrumentModules
option is required to instrument the modules you need.Check if you are using ESM modules
package.json
file with "type": "module"
– this is a 100% indicator..mjs
extension – this is a strong indicator.import
statements and this is not TypeScript – this is a strong indicator.node --input-type=module yourfile.js
and see if it works.Try to migrate to CommonJS
.mjs
to .js
and adding "type": "commonjs"
to your package.json
file.[Optional] Further reading
onShutdown
, but it is not implemented in the
OpenTelemetry JS SDK. Apparently, doing that may cause the consequent incoming spans to block the process.
See originating commit where onShutdown
was only implemented for the browser contexts,
but not for Node.js.
flush()
function to ensure that the traces are sent before the process exits.
string
, number
, boolean
, and array
of each. If the input or output is not one of these types, it will not be sent as an attribute.
To work around this, we serialize the input and output to JSON and send it as a string. We do our best to serialize the inputs and outputs, but it may be
that the serialization fails.
default()
method on some of them, or on the parent object.
GET /my/route
POST /my/other/route
dns.lookup
middleware - query
tcp - connect
fs statSync
CERTIFICATE_VERIFY_FAILED
and StatusCode.UNAVAILABLE
when attempting to export traces to a GRPC server.
certifi
library to obtain an updated set of trusted CA certificates.pip install certifi
certifi
CA bundle by running:
cacert.pem
file, which you can use for further configurations.SSL_CERT_FILE
: Set the path to the trusted CA certificate file.
GRPC_DEFAULT_SSL_ROOTS_FILE_PATH
: Configure this variable so that GRPC uses the same CA certificate file.
@observe
decorator in Python is not correctly capturing the spans when I use async generators, e.g. when I am streaming responses from a model.
async for
loop is done.
Given the nature of Python’s async, the chance of the interruptions within stream, and the
way OpenTelemetry’s contexts work, there is no way to ensure that @observe
works in 100% of the cases.