chore(): Update dependencies usage (#13910)
* chore(): Update dependencies usage * chore(): Update dependencies usage * chore(): Update dependencies usage * chore(): Update dependencies usage * chore(): Update dependencies usage * chore(): Update dependencies usage * chore(): Update dependencies usage * chore(): Update dependencies usage * fix for wxios 1.6 * chore(): Update dependencies usage * chore(): Update dependencies usage * chore(): Update dependencies usage * chore(): Update dependencies usage * chore(): Update dependencies usage * chore(): Update dependencies usage * chore(): Update dependencies usage * chore(): Update dependencies usage * chore(): Update dependencies usage * chore(): Update dependencies usage * push scripts * update build concurrency * chore(): Update dependencies usage * chore(): Update dependencies usage * chore(): Update dependencies usage * chore(): Update dependencies usage * chore(): Update dependencies usage * fixes * update yarn * fixes * fix script * Create heavy-suns-tickle.md * update changeset --------- Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
This commit is contained in:
co-authored by
Carlos R. L. Rodrigues
parent
4e5b318583
commit
224ab39a81
@@ -1,7 +1,6 @@
|
||||
import { MedusaRequest, MedusaResponse } from "@medusajs/framework/http"
|
||||
import { HttpTypes } from "@medusajs/framework/types"
|
||||
import { ContainerRegistrationKeys } from "@medusajs/framework/utils"
|
||||
import { isString } from "lodash"
|
||||
import { ContainerRegistrationKeys, isString } from "@medusajs/framework/utils"
|
||||
|
||||
export const GET = async (
|
||||
req: MedusaRequest<unknown>,
|
||||
|
||||
@@ -5,15 +5,14 @@ import {
|
||||
Query,
|
||||
} from "@medusajs/framework"
|
||||
import { ApiLoader } from "@medusajs/framework/http"
|
||||
import { SpanStatusCode } from "@medusajs/framework/opentelemetry/api"
|
||||
import type { NodeSDKConfiguration } from "@medusajs/framework/opentelemetry/sdk-node"
|
||||
import type { SpanExporter } from "@medusajs/framework/opentelemetry/sdk-trace-node"
|
||||
import { TransactionOrchestrator } from "@medusajs/framework/orchestration"
|
||||
import { Tracer } from "@medusajs/framework/telemetry"
|
||||
import { FeatureFlag } from "@medusajs/framework/utils"
|
||||
import { SpanStatusCode } from "@opentelemetry/api"
|
||||
import type { NodeSDKConfiguration } from "@opentelemetry/sdk-node"
|
||||
import type { SpanExporter } from "@opentelemetry/sdk-trace-node"
|
||||
import { snakeCase } from "lodash"
|
||||
import CacheModule from "../modules/caching"
|
||||
import { ICachingModuleService } from "@medusajs/framework/types"
|
||||
import { camelToSnakeCase, FeatureFlag } from "@medusajs/framework/utils"
|
||||
import CacheModule from "../modules/caching"
|
||||
|
||||
const EXCLUDED_RESOURCES = [".vite", "virtual:"]
|
||||
|
||||
@@ -30,7 +29,6 @@ function shouldExcludeResource(resource: string) {
|
||||
export function instrumentHttpLayer() {
|
||||
const startCommand = require("../commands/start")
|
||||
const HTTPTracer = new Tracer("@medusajs/http", "2.0.0")
|
||||
const { SpanStatusCode } = require("@opentelemetry/api")
|
||||
|
||||
startCommand.traceRequestHandler = async (
|
||||
requestHandler,
|
||||
@@ -110,7 +108,7 @@ export function instrumentHttpLayer() {
|
||||
}
|
||||
|
||||
const traceName = `middleware: ${
|
||||
handler.name ? snakeCase(handler.name) : `anonymous`
|
||||
handler.name ? camelToSnakeCase(handler.name) : `anonymous`
|
||||
}`
|
||||
|
||||
await HTTPTracer.trace(traceName, async (span) => {
|
||||
@@ -135,7 +133,6 @@ export function instrumentHttpLayer() {
|
||||
*/
|
||||
export function instrumentRemoteQuery() {
|
||||
const QueryTracer = new Tracer("@medusajs/query", "2.0.0")
|
||||
const { SpanStatusCode } = require("@opentelemetry/api")
|
||||
|
||||
Query.instrument.graphQuery(async function (queryFn, queryOptions) {
|
||||
return await QueryTracer.trace(
|
||||
@@ -198,7 +195,7 @@ export function instrumentRemoteQuery() {
|
||||
options
|
||||
) {
|
||||
return await QueryTracer.trace(
|
||||
`${snakeCase(serviceName)}.${snakeCase(method)}`,
|
||||
`${camelToSnakeCase(serviceName)}.${camelToSnakeCase(method)}`,
|
||||
async (span) => {
|
||||
span.setAttributes({
|
||||
"fetch.select": options.select,
|
||||
@@ -235,7 +232,7 @@ export function instrumentWorkflows() {
|
||||
metadata
|
||||
) => {
|
||||
return await WorkflowsTracer.trace(
|
||||
`workflow:${snakeCase(metadata.model_id)}`,
|
||||
`workflow:${camelToSnakeCase(metadata.model_id)}`,
|
||||
async function (span) {
|
||||
span.setAttribute("workflow.transaction_id", metadata.transaction_id)
|
||||
|
||||
@@ -252,7 +249,7 @@ export function instrumentWorkflows() {
|
||||
|
||||
TransactionOrchestrator.traceStep = async (stepHandler, metadata) => {
|
||||
return await WorkflowsTracer.trace(
|
||||
`step:${snakeCase(metadata.action)}:${metadata.type}`,
|
||||
`step:${camelToSnakeCase(metadata.action)}:${metadata.type}`,
|
||||
async function (span) {
|
||||
Object.entries(metadata).forEach(([key, value]) => {
|
||||
span.setAttribute(`workflow.step.${key}`, value)
|
||||
@@ -410,12 +407,16 @@ export function registerOtel(
|
||||
const {
|
||||
Resource,
|
||||
resourceFromAttributes,
|
||||
} = require("@opentelemetry/resources")
|
||||
const { NodeSDK } = require("@opentelemetry/sdk-node")
|
||||
const { SimpleSpanProcessor } = require("@opentelemetry/sdk-trace-node")
|
||||
} = require("@medusajs/framework/opentelemetry/resources")
|
||||
const { NodeSDK } = require("@medusajs/framework/opentelemetry/sdk-node")
|
||||
const {
|
||||
SimpleSpanProcessor,
|
||||
} = require("@medusajs/framework/opentelemetry/sdk-trace-node")
|
||||
|
||||
if (instrument.db) {
|
||||
const { PgInstrumentation } = require("@opentelemetry/instrumentation-pg")
|
||||
const {
|
||||
PgInstrumentation,
|
||||
} = require("@medusajs/framework/opentelemetry/instrumentation-pg")
|
||||
instrumentations.push(new PgInstrumentation())
|
||||
}
|
||||
if (instrument.http) {
|
||||
|
||||
@@ -2,9 +2,9 @@ import { INotificationModuleService } from "@medusajs/framework/types"
|
||||
import {
|
||||
ContainerRegistrationKeys,
|
||||
Modules,
|
||||
pickValueFromObject,
|
||||
promiseAll,
|
||||
} from "@medusajs/framework/utils"
|
||||
import { get } from "lodash"
|
||||
import { SubscriberArgs, SubscriberConfig } from "../types/subscribers"
|
||||
|
||||
type HandlerConfig = {
|
||||
@@ -60,11 +60,11 @@ export default async function configurableNotifications({
|
||||
const notificationData = {
|
||||
template: handler.template,
|
||||
channel: handler.channel,
|
||||
to: get(payload, handler.to),
|
||||
to: pickValueFromObject(handler.to, payload),
|
||||
trigger_type: handler.event,
|
||||
resource_id: get(payload, handler.resource_id),
|
||||
resource_id: pickValueFromObject(handler.resource_id, payload),
|
||||
data: Object.entries(handler.data).reduce((acc, [key, value]) => {
|
||||
acc[key] = get(payload, value)
|
||||
acc[key] = pickValueFromObject(value, payload)
|
||||
return acc
|
||||
}, {}),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user