@yunflyjs/yunfly-plugin-current-context
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@yunflyjs/yunfly-plugin-current-context

简介

  1. 获取当前的活动对象 context;
  2. 参数透传,使用 metadata 函数;
  3. 链路追踪,生成链路 trace-id;

使用

  1. 安装依赖
// 该插件依赖apm服务
yarn add @yunflyjs/yunfly-plugin-current-context
  1. config.plugin.ts 中声明插件
const plugins: { [key: string]: string }[] = [
  {
    name: 'contextTrace',
    package: '@yunflyjs/yunfly-plugin-current-context',
    priority: 3,
  },
];
export default plugins;
  1. config.default.ts 中启用插件
config.contextTrace = {
  enable: true,
}

api 使用

获取当前的活动对象

使用文档:https://yunke-yunfly.github.io/doc.github.io/document/high-function/context

参数透传

使用文档:https://yunke-yunfly.github.io/doc.github.io/document/high-function/param-trans

链路追踪

使用文档: https://yunke-yunfly.github.io/doc.github.io/document/high-function/link-trace

Readme

Keywords

Package Sidebar

Install

npm i @yunflyjs/yunfly-plugin-current-context

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

10.5 kB

Total Files

15

Last publish

Collaborators

  • wangweianger