仅针对api类型,过滤被扫描的数据
大石头 authored at 2022-02-04 11:58:25
20.56 KiB
Stardust
<?xml version="1.0" encoding="utf-8"?>
<Tables xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:schemaLocation="http://www.newlifex.com http://www.newlifex.com/Model2020.xsd" NameSpace="Stardust.Data.Monitors" ConnName="Monitor" Output="" BaseClass="Entity" xmlns="http://www.newlifex.com/Model2020.xsd">
  <Table Name="AppTracer" Description="应用跟踪器。负责追踪的应用管理和参数设置">
    <Columns>
      <Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
      <Column Name="Name" DataType="String" Master="True" Nullable="False" Description="名称" />
      <Column Name="DisplayName" DataType="String" Description="显示名" />
      <Column Name="Category" DataType="String" Description="类别" />
      <Column Name="ItemCount" DataType="Int32" Description="跟踪项。共有多少个埋点" />
      <Column Name="Days" DataType="Int32" Description="天数。共统计了多少天" />
      <Column Name="Total" DataType="Int64" Description="总次数。累计埋点采样次数" />
      <Column Name="Enable" DataType="Boolean" Description="启用" />
      <Column Name="Mode" DataType="Int32" Description="跟踪模式。仅针对api类型,过滤被扫描的数据" Type="TraceModes" />
      <Column Name="Period" DataType="Int32" Description="采样周期。单位秒" />
      <Column Name="MaxSamples" DataType="Int32" Description="正常数。最大正常采样数,采样周期内,最多只记录指定数量的正常事件,用于绘制依赖关系" />
      <Column Name="MaxErrors" DataType="Int32" Description="异常数。最大异常采样数,采样周期内,最多只记录指定数量的异常事件,默认10" />
      <Column Name="Excludes" DataType="String" Length="2000" Description="排除项。要排除的操作名,支持*模糊匹配" />
      <Column Name="Timeout" DataType="Int32" Description="超时时间。超过该时间时强制采样,默认5000毫秒" />
      <Column Name="TimeoutExcludes" DataType="String" Description="超时排除项。不判断超时的操作名,支持*模糊匹配" />
      <Column Name="VipClients" DataType="String" Description="Vip客户端。高频次大样本采样,10秒100次,逗号分割,支持*模糊匹配" />
      <Column Name="Nodes" DataType="String" Length="500" Description="节点集。该应用最近一段时间所涉及的来源地址" />
      <Column Name="AlarmThreshold" DataType="Int32" Description="告警阈值。错误数达到该值时触发告警,0表示不启用" />
      <Column Name="AlarmRobot" DataType="String" Length="500" Description="告警机器人。钉钉、企业微信等" />
      <Column Name="CreateUser" DataType="String" Description="创建者" />
      <Column Name="CreateUserID" DataType="Int32" Description="创建人" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="CreateIP" DataType="String" Description="创建地址" />
      <Column Name="UpdateUser" DataType="String" Description="更新者" />
      <Column Name="UpdateUserID" DataType="Int32" Description="更新人" />
      <Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
      <Column Name="UpdateIP" DataType="String" Description="更新地址" />
    </Columns>
    <Indexes>
      <Index Columns="Name" Unique="True" />
    </Indexes>
  </Table>
  <Table Name="TraceItem" Description="跟踪项。应用下的多个埋点">
    <Columns>
      <Column Name="Id" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
      <Column Name="AppId" DataType="Int32" Description="应用" />
      <Column Name="Kind" DataType="String" Description="种类" />
      <Column Name="Name" DataType="String" Master="True" Length="200" Description="操作名。接口名或埋点名" />
      <Column Name="Rules" DataType="String" Length="200" Description="规则。支持多个埋点操作名按照规则聚合成为一个跟踪项,用于处理多变的操作名,支持*模糊匹配,多个规则逗号隔开。" />
      <Column Name="Enable" DataType="Boolean" Description="启用" />
      <Column Name="Days" DataType="Int32" Description="天数。共统计了多少天" />
      <Column Name="Total" DataType="Int64" Description="总次数。累计埋点采样次数" />
      <Column Name="CreateIP" DataType="String" Description="创建地址" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="UpdateUser" DataType="String" Description="更新者" />
      <Column Name="UpdateUserID" DataType="Int32" Description="更新人" />
      <Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
      <Column Name="UpdateIP" DataType="String" Description="更新地址" />
      <Column Name="Remark" DataType="String" Length="500" Description="备注" />
    </Columns>
    <Indexes>
      <Index Columns="AppId,Name" Unique="True" />
    </Indexes>
  </Table>
  <Table Name="TraceData" Description="跟踪数据。应用定时上报采样得到的埋点追踪原始数据,应用端已完成初步统计,后端将再次向上汇总" ConnName="MonitorLog">
    <Columns>
      <Column Name="Id" DataType="Int64" PrimaryKey="True" Description="编号" />
      <Column Name="StatDate" DataType="DateTime" Description="统计日期" />
      <Column Name="StatHour" DataType="DateTime" Description="统计小时" />
      <Column Name="StatMinute" DataType="DateTime" Description="统计分钟" />
      <Column Name="AppId" DataType="Int32" Description="应用" />
      <Column Name="ClientId" DataType="String" Description="实例。应用可能多实例部署,ip@proccessid" />
      <Column Name="ItemId" DataType="Int32" Description="跟踪项" />
      <Column Name="Name" DataType="String" Master="True" Length="200" Description="操作名。接口名或埋点名" />
      <Column Name="StartTime" DataType="Int64" Description="开始时间。Unix毫秒" />
      <Column Name="EndTime" DataType="Int64" Description="结束时间。Unix毫秒" />
      <Column Name="Total" DataType="Int32" Description="总次数" />
      <Column Name="Errors" DataType="Int32" Description="错误数" />
      <Column Name="TotalCost" DataType="Int64" Description="总耗时。单位毫秒" />
      <Column Name="Cost" DataType="Int32" Description="平均耗时。总耗时除以总次数" />
      <Column Name="MaxCost" DataType="Int32" Description="最大耗时。单位毫秒" />
      <Column Name="MinCost" DataType="Int32" Description="最小耗时。单位毫秒" />
      <Column Name="Samples" DataType="Int32" Description="正常采样" />
      <Column Name="ErrorSamples" DataType="Int32" Description="异常采样" />
      <Column Name="CreateIP" DataType="String" Description="创建地址" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
    </Columns>
    <Indexes>
      <Index Columns="StatDate,AppId,Name,StartTime" />
      <Index Columns="StatHour,AppId,Name" />
      <Index Columns="StatMinute,AppId,Name" />
      <Index Columns="AppId,StatMinute" />
    </Indexes>
  </Table>
  <Table Name="SampleData" Description="采样数据。具体调用或异常详情,每次追踪统计携带少量样板,用于链路分析以及异常追踪" ConnName="MonitorLog">
    <Columns>
      <Column Name="Id" DataType="Int64" PrimaryKey="True" Description="编号" />
      <Column Name="DataId" DataType="Int64" Description="数据" />
      <Column Name="ItemId" DataType="Int32" Description="跟踪项" />
      <Column Name="Success" DataType="Boolean" Description="正常" />
      <Column Name="StartTime" DataType="Int64" Description="开始时间。Unix毫秒" />
      <Column Name="EndTime" DataType="Int64" Description="结束时间。Unix毫秒" />
      <Column Name="Cost" DataType="Int32" Description="耗时。毫秒" />
      <Column Name="ClientId" DataType="String" Description="实例。应用可能多实例部署,ip@proccessid" />
      <Column Name="TraceId" DataType="String" Description="追踪标识。可用于关联多个片段,建立依赖关系,随线程上下文、Http、Rpc传递" />
      <Column Name="SpanId" DataType="String" Description="唯一标识。随线程上下文、Http、Rpc传递,作为内部片段的父级" />
      <Column Name="ParentId" DataType="String" Description="父级标识" />
      <Column Name="Tag" DataType="String" Length="2000" Description="数据标签。记录一些附加数据" />
      <Column Name="Error" DataType="String" Length="2000" Description="错误信息" />
      <Column Name="CreateIP" DataType="String" Description="创建地址" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
    </Columns>
    <Indexes>
      <Index Columns="DataId" />
      <Index Columns="TraceId" />
    </Indexes>
  </Table>
  <Table Name="SampleData2" Description="采样数据2。采样备份,用于链路分析以及异常追踪">
    <Columns>
      <Column Name="Id" DataType="Int64" PrimaryKey="True" Description="编号" />
      <Column Name="DataId" DataType="Int64" Description="数据" />
      <Column Name="AppId" DataType="Int32" Description="应用" />
      <Column Name="ItemId" DataType="Int32" Description="跟踪项" />
      <Column Name="Name" DataType="String" Master="True" Length="200" Description="操作名。接口名或埋点名" />
      <Column Name="Success" DataType="Boolean" Description="正常" />
      <Column Name="StartTime" DataType="Int64" Description="开始时间。Unix毫秒" />
      <Column Name="EndTime" DataType="Int64" Description="结束时间。Unix毫秒" />
      <Column Name="Cost" DataType="Int32" Description="耗时。毫秒" />
      <Column Name="ClientId" DataType="String" Description="实例。应用可能多实例部署,ip@proccessid" />
      <Column Name="TraceId" DataType="String" Description="追踪标识。可用于关联多个片段,建立依赖关系,随线程上下文、Http、Rpc传递" />
      <Column Name="SpanId" DataType="String" Description="唯一标识。随线程上下文、Http、Rpc传递,作为内部片段的父级" />
      <Column Name="ParentId" DataType="String" Description="父级标识" />
      <Column Name="Tag" DataType="String" Length="2000" Description="数据标签。记录一些附加数据" />
      <Column Name="Error" DataType="String" Length="2000" Description="错误信息" />
      <Column Name="CreateUser" DataType="String" Description="创建者" />
      <Column Name="CreateUserID" DataType="Int32" Description="创建人" />
      <Column Name="CreateIP" DataType="String" Description="创建地址" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
    </Columns>
    <Indexes>
      <Index Columns="TraceId" />
    </Indexes>
  </Table>
  <Table Name="TraceDayStat" Description="跟踪每日统计。每应用每接口每日统计,用于分析接口健康状况">
    <Columns>
      <Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
      <Column Name="StatDate" DataType="DateTime" Description="统计日期" />
      <Column Name="AppId" DataType="Int32" Description="应用" />
      <Column Name="ItemId" DataType="Int32" Description="跟踪项" />
      <Column Name="Name" DataType="String" Master="True" Length="200" Description="操作名。接口名或埋点名" />
      <Column Name="Type" DataType="String" Description="种类。Api/Http/Db/Mq/Redis/Other" />
      <Column Name="Total" DataType="Int32" Description="总次数" />
      <Column Name="Errors" DataType="Int32" Description="错误数" />
      <Column Name="TotalCost" DataType="Int64" Description="总耗时。单位毫秒" />
      <Column Name="Cost" DataType="Int32" Description="平均耗时。总耗时除以总次数" />
      <Column Name="MaxCost" DataType="Int32" Description="最大耗时。单位毫秒" />
      <Column Name="MinCost" DataType="Int32" Description="最小耗时。单位毫秒" />
      <Column Name="TraceId" DataType="String" Description="追踪标识。最新一次查看采样,可用于关联多个片段,建立依赖关系,随线程上下文、Http、Rpc传递" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
    </Columns>
    <Indexes>
      <Index Columns="StatDate,AppId,Type" />
      <Index Columns="StatDate,AppId,ItemId" />
      <Index Columns="AppId,ItemId,Id" />
      <Index Columns="AppId,Type,StatDate" />
    </Indexes>
  </Table>
  <Table Name="TraceHourStat" Description="跟踪小时统计。每应用每接口每小时统计,用于分析接口健康状况">
    <Columns>
      <Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
      <Column Name="StatTime" DataType="DateTime" Description="统计小时" />
      <Column Name="AppId" DataType="Int32" Description="应用" />
      <Column Name="ItemId" DataType="Int32" Description="跟踪项" />
      <Column Name="Name" DataType="String" Master="True" Length="200" Description="操作名。接口名或埋点名" />
      <Column Name="Total" DataType="Int32" Description="总次数" />
      <Column Name="Errors" DataType="Int32" Description="错误数" />
      <Column Name="TotalCost" DataType="Int64" Description="总耗时。单位毫秒" />
      <Column Name="Cost" DataType="Int32" Description="平均耗时。总耗时除以总次数" />
      <Column Name="MaxCost" DataType="Int32" Description="最大耗时。单位毫秒" />
      <Column Name="MinCost" DataType="Int32" Description="最小耗时。单位毫秒" />
      <Column Name="TraceId" DataType="String" Description="追踪标识。最新一次查看采样,可用于关联多个片段,建立依赖关系,随线程上下文、Http、Rpc传递" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
    </Columns>
    <Indexes>
      <Index Columns="StatTime,AppId,ItemId" />
      <Index Columns="AppId,ItemId,Id" />
    </Indexes>
  </Table>
  <Table Name="TraceMinuteStat" Description="跟踪分钟统计。每应用每接口每5分钟统计,用于分析接口健康状况">
    <Columns>
      <Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
      <Column Name="StatTime" DataType="DateTime" Description="统计分钟" />
      <Column Name="AppId" DataType="Int32" Description="应用" />
      <Column Name="ItemId" DataType="Int32" Description="跟踪项" />
      <Column Name="Name" DataType="String" Master="True" Length="200" Description="操作名。接口名或埋点名" />
      <Column Name="Total" DataType="Int32" Description="总次数" />
      <Column Name="Errors" DataType="Int32" Description="错误数" />
      <Column Name="TotalCost" DataType="Int64" Description="总耗时。单位毫秒" />
      <Column Name="Cost" DataType="Int32" Description="平均耗时。总耗时除以总次数" />
      <Column Name="MaxCost" DataType="Int32" Description="最大耗时。单位毫秒" />
      <Column Name="MinCost" DataType="Int32" Description="最小耗时。单位毫秒" />
      <Column Name="TraceId" DataType="String" Description="追踪标识。最新一次查看采样,可用于关联多个片段,建立依赖关系,随线程上下文、Http、Rpc传递" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
    </Columns>
    <Indexes>
      <Index Columns="StatTime,AppId,ItemId" />
      <Index Columns="AppId,ItemId,Id" />
    </Indexes>
  </Table>
  <Table Name="AppDayStat" Description="应用每日统计。每应用每日统计,用于分析应用健康状况">
    <Columns>
      <Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
      <Column Name="StatDate" DataType="DateTime" Description="统计日期" />
      <Column Name="AppId" DataType="Int32" Description="应用" />
      <Column Name="Names" DataType="Int32" Description="埋点数" />
      <Column Name="Total" DataType="Int64" Description="总次数" />
      <Column Name="Errors" DataType="Int64" Description="错误数" />
      <Column Name="TotalCost" DataType="Int64" Description="总耗时。单位毫秒" />
      <Column Name="Cost" DataType="Int32" Description="平均耗时。总耗时除以总次数" />
      <Column Name="MaxCost" DataType="Int32" Description="最大耗时。单位毫秒" />
      <Column Name="MinCost" DataType="Int32" Description="最小耗时。单位毫秒" />
      <Column Name="Apis" DataType="Int64" Description="接口数" />
      <Column Name="Https" DataType="Int64" Description="Http请求" />
      <Column Name="Dbs" DataType="Int64" Description="数据库" />
      <Column Name="Mqs" DataType="Int64" Description="消息队列" />
      <Column Name="Redis" DataType="Int64" Description="Redis" />
      <Column Name="Others" DataType="Int64" Description="其它" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
    </Columns>
    <Indexes>
      <Index Columns="StatDate,AppId" Unique="True" />
    </Indexes>
  </Table>
  <Table Name="AppMinuteStat" Description="应用分钟统计。每应用每5分钟统计,用于分析应用健康状况">
    <Columns>
      <Column Name="ID" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
      <Column Name="StatTime" DataType="DateTime" Description="统计分钟" />
      <Column Name="AppId" DataType="Int32" Description="应用" />
      <Column Name="Total" DataType="Int32" Description="总次数" />
      <Column Name="Errors" DataType="Int32" Description="错误数" />
      <Column Name="TotalCost" DataType="Int64" Description="总耗时。单位毫秒" />
      <Column Name="Cost" DataType="Int32" Description="平均耗时。总耗时除以总次数" />
      <Column Name="MaxCost" DataType="Int32" Description="最大耗时。单位毫秒" />
      <Column Name="MinCost" DataType="Int32" Description="最小耗时。单位毫秒" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
    </Columns>
    <Indexes>
      <Index Columns="StatTime,AppId" Unique="True" />
      <Index Columns="AppId,Id" />
    </Indexes>
  </Table>
  <Table Name="AlarmGroup" Description="告警组。按照项目组设置告警,便于管理多节点和多应用,节点和应用的分类名对应组名">
    <Columns>
      <Column Name="Id" DataType="Int32" Identity="True" PrimaryKey="True" Description="编号" />
      <Column Name="Name" DataType="String" Master="True" Nullable="False" Description="名称" />
      <Column Name="Enable" DataType="Boolean" Description="启用" />
      <Column Name="WebHook" DataType="String" Length="500" Description="告警机器人。钉钉、企业微信等" />
      <Column Name="CreateUser" DataType="String" Description="创建者" />
      <Column Name="CreateUserID" DataType="Int32" Description="创建人" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
      <Column Name="CreateIP" DataType="String" Description="创建地址" />
      <Column Name="UpdateUser" DataType="String" Description="更新者" />
      <Column Name="UpdateUserID" DataType="Int32" Description="更新人" />
      <Column Name="UpdateTime" DataType="DateTime" Description="更新时间" />
      <Column Name="UpdateIP" DataType="String" Description="更新地址" />
    </Columns>
    <Indexes>
      <Index Columns="Name" Unique="True" />
    </Indexes>
  </Table>
  <Table Name="AlarmHistory" Description="告警历史。记录告警内容">
    <Columns>
      <Column Name="Id" DataType="Int64" PrimaryKey="True" Description="编号" />
      <Column Name="Name" DataType="String" Master="True" Nullable="False" Description="名称" />
      <Column Name="GroupId" DataType="Int32" Description="告警组" />
      <Column Name="Category" DataType="String" Description="类别。钉钉、企业微信" />
      <Column Name="Action" DataType="String" Description="操作" />
      <Column Name="Success" DataType="Boolean" Description="成功" />
      <Column Name="Content" DataType="String" Length="2000" Description="内容" />
      <Column Name="Creator" DataType="String" Description="创建者。服务端节点" />
      <Column Name="CreateTime" DataType="DateTime" Description="创建时间" />
    </Columns>
    <Indexes>
      <Index Columns="GroupId,Id" />
    </Indexes>
  </Table>
</Tables>