Back to Medusa

medusa

www/apps/resources/references/modules/medusa/page.mdx

2.15.35.5 KB
Original Source

import { TypeList } from "docs-ui"

medusa

Classes

Functions

Interfaces

Type Aliases

Variables


Functions

instrumentCache

instrumentHttpLayer

Instrument the first touch point of the HTTP layer to report traces to OpenTelemetry

instrumentRemoteQuery

Instrument the queries made using the remote query

instrumentWorkflows

Instrument the workflows and steps execution

registerOtel

A helper function to configure the OpenTelemetry SDK with some defaults. For better/more control, please configure the SDK manually.

You will have to install the following packages within your app for telemetry to work

  • @opentelemetry/sdk-node
  • @opentelemetry/resources
  • @opentelemetry/sdk-trace-node
  • @opentelemetry/instrumentation-pg
  • @opentelemetry/instrumentation

Parameters

<TypeList types={[{"name":"options","type":"Partial<NodeSDKConfiguration> & object","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"serviceName","type":"string","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"exporter","type":"SpanExporter","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"instrument","type":"Partial<object>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"http","type":"boolean","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"boolean","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"workflows","type":"boolean","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"db","type":"boolean","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"cache","type":"boolean","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="registerOtel"/>

Returns

<TypeList types={[{"name":"any","type":"any","optional":false,"defaultValue":"","description":"A helper function to configure the OpenTelemetry SDK with some defaults.\nFor better/more control, please configure the SDK manually.\n\nYou will have to install the following packages within your app for\ntelemetry to work\n\n- @opentelemetry/sdk-node\n- @opentelemetry/resources\n- @opentelemetry/sdk-trace-node\n- @opentelemetry/instrumentation-pg\n- @opentelemetry/instrumentation","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="registerOtel"/>


Variables

HTTP_METHODS

Const HTTP_METHODS: readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "HEAD"]

List of all the supported HTTP methods