{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { Span } from '@opentelemetry/api';\nimport { InstrumentationConfig } from '@opentelemetry/instrumentation';\n\nexport interface SerializerPayload {\n  condition?: any;\n  options?: any;\n  updates?: any;\n  document?: any;\n  aggregatePipeline?: any;\n  fields?: any;\n  documents?: any;\n  operations?: any;\n}\n\nexport type DbStatementSerializer = (\n  operation: string,\n  payload: SerializerPayload\n) => string;\n\nexport interface ResponseInfo {\n  moduleVersion: string | undefined;\n  response: any;\n}\n\nexport type MongooseResponseCustomAttributesFunction = (\n  span: Span,\n  responseInfo: ResponseInfo\n) => void;\n\nexport interface MongooseInstrumentationConfig extends InstrumentationConfig {\n  /**\n   * Mongoose operation use mongodb under the hood.\n   * If mongodb instrumentation is enabled, a mongoose operation will also create\n   * a mongodb operation describing the communication with mongoDB servers.\n   * Setting the `suppressInternalInstrumentation` config value to `true` will\n   * cause the instrumentation to suppress instrumentation of underlying operations,\n   * effectively causing mongodb spans to be non-recordable.\n   */\n  suppressInternalInstrumentation?: boolean;\n\n  /** Custom serializer function for the db.statement tag */\n  dbStatementSerializer?: DbStatementSerializer;\n\n  /** hook for adding custom attributes using the response payload */\n  responseHook?: MongooseResponseCustomAttributesFunction;\n\n  /** Set to true if you do not want to collect traces that start with mongoose */\n  requireParentSpan?: boolean;\n}\n"]}