123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302 |
- <template>
- <div>
- <!-- <el-progress :percentage="100" status="success"></el-progress> @submit.native.prevent -->
- <el-form ref="queryTrace" :model="queryTrace" :inline="true" label-width="68px" @submit.native.prevent>
- <el-form-item label="" prop="trace_id">
- <el-input
- style='width:220px'
- v-model="queryTrace.trace_id"
- placeholder="TraceID"
- clearable
- size="mini"
- @input='$forceUpdate()'
- @paste.native.capture.prevent="handlePaste"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- </el-form>
- <el-table
- v-loading="loading"
- :data="selectList"
- border
- @row-click="handleRowClick"
- ref="table"
- highlight-current-row
- >
- <el-table-column
- type="index"
- width="50" label="#">
- </el-table-column>
- <el-table-column label="TraceID" prop="trace_id" header-align="center" :show-overflow-tooltip="true" align="center" />
- <el-table-column label="开始时间" prop="timestamp" header-align="center" :show-overflow-tooltip="true" align="center">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.timestamp) }}</span>
- </template>
- </el-table-column>
- <el-table-column label="持续时间(ms)" header-align="right" prop="duration" align="right"/>
- <el-table-column label="涉及的服务数量" header-align="right" prop="service_num" align="right"/>
- <el-table-column label="包含的span数量" header-align="right" prop="span_num" align="right"/>
- <!-- <el-table-column label="调用深度" header-align="right" prop="max_depth" align="right"/> -->
- </el-table>
- <pagination
- v-show="total>0"
- :total="total"
- :page.sync="queryTrace.pageIndex"
- :limit.sync="queryTrace.pageSize"
- @pagination="getTraceList"
- />
- <div style="margin-top:32px;">
- <div class='css-container' style="margin-bottom:24px;">
- <div class='css-header'>
- <div class='css-title'>Trace</div>
- </div>
- <div class='css-content' v-if='tableDetail !=null'>
- <div class='css-page-header'>
- <div class='css-name'>
- <div class='css-name-title'>
- <span class='trace-name'>
- <span class='css-text'>{{tableDetail.service_name}}:</span>
- <span class='css-text'>{{tableDetail.span_name}}</span>
- <!-- <span class='css-text'>Convert</span> -->
- </span>
- <small class='css-small'>{{tableDetail.duration}}ms</small>
- </div>
- <div class='css-action'>
- TraceID: <span v-cloak>{{tractID}}</span>
- </div>
- </div>
- <div class='css-time-box'>
- <span class='css-time-wrap'>
- <span class='css-time-value'>{{parseTime(tableDetail.timestamp)}}
- <!-- <span class='css-time-vlaue-detail'>:07.635</span> -->
- </span>
- </span>
- <span class='css-type'>
- <el-tag size="mini" style='margin-right:8px'>{{tableDetail.http_method}}</el-tag>
- <el-tag size="mini" :type="tableDetail.http_code>300?'danger':'success'" style='margin-right:8px'>{{tableDetail.http_code}}</el-tag>
- <span class='css-api'>{{tableDetail.span_attributes!=undefined?tableDetail.span_attributes['http.url']:tableDetail.http_url}}</span>
- </span>
- </div>
- </div>
- </div>
- </div>
- <div class="TreeBox" style="margin-bottom:24px;">
- <div>
- <el-button-group>
- <el-button size="mini" type="primary" @click='toggleTab(1)'>Trace Tree</el-button>
- <el-button size="mini" type="primary" @click='toggleTab(2)'>Trace Map</el-button>
- <el-button size="mini" type="primary" @click='toggleTab(3)'>Deep Tree</el-button>
- </el-button-group>
- <div style='display:inline-block;vertical-align: middle;'>
- <el-dropdown
- style="margin-left: 10px"
- size="mini"
- trigger="click"
- placement="bottom"
- >
- <el-button type="primary" size="mini">
- <!-- 下拉菜单 -->
- <i class="el-icon-s-grid" />
- <i class="el-icon-arrow-down"></i>
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-checkbox-group
- v-model="colSelect"
- style="text-align: left"
- @change="columnChange"
- >
- <el-dropdown-item
- v-for="(item, index) in colData"
- :key="index"
- ><el-checkbox :label="item.title">{{
- item.title
- }}</el-checkbox></el-dropdown-item
- >
- </el-checkbox-group>
- </el-dropdown-menu>
- </el-dropdown>
- </div>
- </div>
- <div style='font-size:14px;font-weight:bold;'>
- <!-- <el-button size="mini" icon="el-icon-full-screen" @click.native.prevent='clickFull'></el-button> -->
- <svg-icon :icon-class="isFull?'exit-fullscreen':'fullscreen'" @click.native.prevent="clickFull" />
- </div>
- </div>
-
- <div v-if='flag==true' style='position:relative;'>
- <div v-if='num == 1' class='tree_box'>
- </div>
- <div v-if="num ==2">
- <el-table
- v-loading="treeLoading"
- :data="tableData"
- :row-key="getRowKeys"
- :indent='4'
- style="width: 100%;margin-bottom: 20px;"
- border
- default-expand-all
- :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
- :row-class-name="status_change"
- :row-style="rowClassRender"
- @row-click='clickRowHandle'
- >
- <el-table-column
- prop="service_name"
- label="Name"
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[0].istrue"
- >
- <template slot-scope="scope">
- <span>{{scope.row.service_name}}<span>({{scope.row.span_name}})</span></span>
- </template>
- </el-table-column>
- <el-table-column
- prop="timestamp"
- label="StartTime"
- align='center'
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[1].istrue"
- >
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.timestamp) }}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="duration"
- label="Cost(ms)"
- align='right'
- header-align="right"
- width='120'
- :show-overflow-tooltip="true"
- v-if="colData[2].istrue"
- >
- </el-table-column>
- <el-table-column
- prop="duration_persent"
- label="Duration(%)"
- header-align="center"
- v-if="colData[3].istrue"
- >
- <template slot-scope="scope">
- <!-- <div @click='getRowData(scope.row)' style="cursor: pointer;"> -->
- <div>
- <el-progress :percentage="scope.row.duration_persent * 100" color="#4343c8" :show-text='false' define-back-color='#E3E7ED'></el-progress>
- </div>
- </template>
- </el-table-column>
- <!-- <el-table-column
- prop="status_code"
- label="StatusCode"
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[4].istrue"
- >
- </el-table-column> -->
- <el-table-column
- prop="span_kind"
- label="SpanKind"
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[4].istrue"
- >
- </el-table-column>
- <el-table-column
- prop="service_name"
- label="ServiceName"
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[5].istrue"
- >
- </el-table-column>
- <el-table-column
- prop="events_attributes"
- label="EventsAttributes"
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[6].istrue"
- width="120"
- >
- </el-table-column>
- <el-table-column
- prop="events_name"
- label="EventsName"
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[7].istrue"
- >
- </el-table-column>
- <el-table-column
- prop="events_timestamp"
- label="EventsTimestamp"
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[8].istrue"
- width="120"
- >
- </el-table-column>
- <el-table-column
- prop="http_url"
- label="HttpUrl"
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[9].istrue"
- >
- </el-table-column>
- <el-table-column
- prop="http_method"
- label="HttpMethod"
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[10].istrue"
- >
- </el-table-column>
- <el-table-column
- prop="container_id"
- label="ContainerId"
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[11].istrue"
- >
- </el-table-column>
- <el-table-column
- prop="http_code"
- label="httpCode"
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[12].istrue"
- >
- </el-table-column>
- <el-table-column
- prop="db_connection_string"
- label="DbConnectionString"
- v-if="colData[13].istrue"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span>{{scope.row.db_connection_string}}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="rpc_method"
- label="RpcMethod"
- v-if="colData[14].istrue"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- <el-table-column
- prop="resource_attributes"
- label="ResourceAttributes"
- v-if="colData[15].istrue"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span>{{JSON.stringify(scope.row.resource_attributes)}}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="span_attributes"
- label="SpanAttributes"
- v-if="colData[16].istrue"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span>{{JSON.stringify(scope.row.span_attributes)}}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="max_depth"
- label="MaxDepth"
- v-if="colData[17].istrue"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- <!-- <el-table-column
- prop="db_connection_string"
- label="dbConnectionString"
- v-if="colData[18].istrue"
- :show-overflow-tooltip="true"
- >
- </el-table-column> -->
- <el-table-column
- prop="db_statement"
- label="DbStatement"
- v-if="colData[18].istrue"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- </el-table>
- </div>
- <div v-if="num ==3" style='position:relative;'>
- <iframe src='gi-topo-analyst2.html' style="width:100%;height:calc(100vh - 60px);min-height:800px;margin-top: -10px;"
- id="myIframe"
- scrolling='auto'
- frameBorder='no'
- border='0'
- marginWidth='0'
- marginHeight='0'></iframe>
- </div>
- </div>
- </div>
- <el-dialog
- :visible.sync="Visible"
- :fullscreen='true'
- center>
- <div style="margin-top:32px;">
- <div class='css-container' style="margin-bottom:24px;">
- <div class='css-header'>
- <div class='css-title'>Trace</div>
- </div>
- <div class='css-content' v-if='tableDetail !=null'>
- <div class='css-page-header'>
- <div class='css-name'>
- <div class='css-name-title'>
- <span class='trace-name'>
- <span class='css-text'>{{tableDetail.service_name}}:</span>
- <span class='css-text'>{{tableDetail.span_name}}</span>
- <!-- <span class='css-text'>Convert</span> -->
- </span>
- <small class='css-small'>{{tableDetail.duration}}ms</small>
- </div>
- <div class='css-action'>
- TraceID: <span v-cloak>{{tractID}}</span>
- </div>
- </div>
- <div class='css-time-box'>
- <span class='css-time-wrap'>
- <span class='css-time-value'>{{parseTime(tableDetail.timestamp)}}
- <!-- <span class='css-time-vlaue-detail'>:07.635</span> -->
- </span>
- </span>
- <span class='css-type'>
- <el-tag size="mini" style='margin-right:8px'>{{tableDetail.http_method}}</el-tag>
- <el-tag size="mini" :type="tableDetail.http_code>300?'danger':'success'" style='margin-right:8px'>{{tableDetail.http_code}}</el-tag>
- <span class='css-api'>{{tableDetail.span_attributes!=undefined?tableDetail.span_attributes['http.url']:tableDetail.http_url}}</span>
- </span>
- </div>
- </div>
- </div>
- </div>
- <div class="TreeBox" style="margin-bottom:24px;">
- <div>
- <el-button-group>
- <el-button size="mini" type="primary" @click='toggleTab(1)'>Trace Tree</el-button>
- <el-button size="mini" type="primary" @click='toggleTab(2)'>Trace Map</el-button>
- <el-button size="mini" type="primary" @click='toggleTab(3)'>Deep Tree</el-button>
- </el-button-group>
- <div style='display:inline-block;vertical-align: middle;'>
- <el-dropdown
- style="margin-left: 10px"
- size="mini"
- trigger="click"
- placement="bottom"
- >
- <el-button type="primary" size="mini">
- <!-- 下拉菜单 -->
- <i class="el-icon-s-grid" />
- <i class="el-icon-arrow-down"></i>
- </el-button>
- <el-dropdown-menu slot="dropdown">
- <el-checkbox-group
- v-model="colSelect"
- style="text-align: left"
- @change="columnChange"
- >
- <el-dropdown-item
- v-for="(item, index) in colData"
- :key="index"
- ><el-checkbox :label="item.title">{{
- item.title
- }}</el-checkbox></el-dropdown-item
- >
- </el-checkbox-group>
- </el-dropdown-menu>
- </el-dropdown>
- </div>
- </div>
- <div style='font-size:14px;font-weight:bold;'>
- </div>
- </div>
-
- <div v-if='flag==true' style='position:relative;'>
- <div v-if='num == 1' class='tree_box'>
- </div>
- <div v-if="num ==2">
- <el-table
- v-loading="treeLoading"
- :data="tableData"
- :row-key="getRowKeys"
- :indent='4'
- style="width: 100%;margin-bottom: 20px;"
- border
- default-expand-all
- :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
- :row-class-name="status_change"
- :row-style="rowClassRender"
- @row-click='clickRowHandle'
- >
- <el-table-column
- prop="service_name"
- label="Name"
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[0].istrue"
- >
- <template slot-scope="scope">
- <span>{{scope.row.service_name}}<span>({{scope.row.span_name}})</span></span>
- </template>
- </el-table-column>
- <el-table-column
- prop="timestamp"
- label="StartTime"
- align='center'
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[1].istrue"
- >
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.timestamp) }}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="duration"
- label="Cost(ms)"
- align='right'
- header-align="right"
- width='120'
- :show-overflow-tooltip="true"
- v-if="colData[2].istrue"
- >
- </el-table-column>
- <el-table-column
- prop="duration_persent"
- label="Duration(%)"
- header-align="center"
- v-if="colData[3].istrue"
- >
- <template slot-scope="scope">
- <!-- <div @click='getRowData(scope.row)' style="cursor: pointer;"> -->
- <div>
- <el-progress :percentage="scope.row.duration_persent * 100" color="#4343c8" :show-text='false' define-back-color='#E3E7ED'></el-progress>
- </div>
- </template>
- </el-table-column>
- <!-- <el-table-column
- prop="status_code"
- label="StatusCode"
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[4].istrue"
- >
- </el-table-column> -->
- <el-table-column
- prop="span_kind"
- label="SpanKind"
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[4].istrue"
- >
- </el-table-column>
- <el-table-column
- prop="service_name"
- label="ServiceName"
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[5].istrue"
- >
- </el-table-column>
- <el-table-column
- prop="events_attributes"
- label="EventsAttributes"
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[6].istrue"
- width="120"
- >
- </el-table-column>
- <el-table-column
- prop="events_name"
- label="EventsName"
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[7].istrue"
- >
- </el-table-column>
- <el-table-column
- prop="events_timestamp"
- label="EventsTimestamp"
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[8].istrue"
- width="120"
- >
- </el-table-column>
- <el-table-column
- prop="http_url"
- label="HttpUrl"
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[9].istrue"
- >
- </el-table-column>
- <el-table-column
- prop="http_method"
- label="HttpMethod"
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[10].istrue"
- >
- </el-table-column>
- <el-table-column
- prop="container_id"
- label="ContainerId"
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[11].istrue"
- >
- </el-table-column>
- <el-table-column
- prop="http_code"
- label="httpCode"
- header-align="center"
- :show-overflow-tooltip="true"
- v-if="colData[12].istrue"
- >
- </el-table-column>
- <el-table-column
- prop="db_connection_string"
- label="DbConnectionString"
- v-if="colData[13].istrue"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span>{{scope.row.db_connection_string}}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="rpc_method"
- label="RpcMethod"
- v-if="colData[14].istrue"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- <el-table-column
- prop="resource_attributes"
- label="ResourceAttributes"
- v-if="colData[15].istrue"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span>{{JSON.stringify(scope.row.resource_attributes)}}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="span_attributes"
- label="SpanAttributes"
- v-if="colData[16].istrue"
- :show-overflow-tooltip="true"
- >
- <template slot-scope="scope">
- <span>{{JSON.stringify(scope.row.span_attributes)}}</span>
- </template>
- </el-table-column>
- <el-table-column
- prop="max_depth"
- label="MaxDepth"
- v-if="colData[17].istrue"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- <!-- <el-table-column
- prop="db_connection_string"
- label="dbConnectionString"
- v-if="colData[18].istrue"
- :show-overflow-tooltip="true"
- >
- </el-table-column> -->
- <el-table-column
- prop="db_statement"
- label="DbStatement"
- v-if="colData[18].istrue"
- :show-overflow-tooltip="true"
- >
- </el-table-column>
- </el-table>
- </div>
- <div v-if="num ==3" style='position:relative;'>
- <iframe src='gi-topo-analyst2.html' style="width:100%;height:calc(100vh - 60px);min-height:800px;margin-top: -10px;"
- id="myIframe"
- scrolling='auto'
- frameBorder='no'
- border='0'
- marginWidth='0'
- marginHeight='0'></iframe>
- </div>
- </div>
- </div>
- </el-dialog>
- <el-drawer
- :visible.sync="drawer"
- direction="rtl"
- size="55%"
- @close="drawerClose"
- v-if='JSON.stringify(detailData) != "{}"'
- >
- <el-collapse v-model="activeNames">
- <el-collapse-item title="Attributes" name="one">
- <ul class='ul_box' v-if='detailData.span_attributes !=null'>
- <li v-for='(value,key) in detailData.span_attributes' :key='key'>
- <div class="ul_label">{{key}}</div>
- <div class="ul_value" style='color:#008080;white-space: pre-wrap;'>"{{value}}"</div>
- </li>
- </ul>
- </el-collapse-item>
- <el-collapse-item title="Resource" name="tow">
-
- <ul class='ul_box' v-if='detailData.resource_attributes !=null'>
- <li v-for='(value,key) in detailData.resource_attributes' :key='key'>
- <div class="ul_label">{{key}}</div>
- <div class="ul_value" style='color:#008080;white-space: pre-wrap;'>"{{value}}"</div>
- </li>
- </ul>
- </el-collapse-item>
- <el-collapse-item v-if='detailData.events_timestamp.length>0 && detailData.events_timestamp!=null' :title="'Events'+'('+ detailData.events_timestamp.length +')'" name="three">
- <!-- <el-collapse-item title="Events" name="three"> -->
- <div class='events_box'>
- <el-collapse :value="activeIn">
- <el-collapse-item v-for='(item,index) in detailData.events_timestamp' :key='index' :title="item" :name="index">
- <ul class='ul_box'>
- <li>
- <div class="ul_label">message</div>
- <div class="ul_value" style='color:#008080;white-space: pre-wrap;'>"{{detailData.events_name[index]}}"</div>
- </li>
- <li v-for='(value,key) in detailData.events_attributes[index]' :key='key'>
- <div class="ul_label">{{key}}</div>
- <div class="ul_value" style='color:#008080;white-space: pre-wrap;'>"{{value}}"</div>
- </li>
- <!-- <li>
- <div class="ul_label">message.type</div>
- <div class="ul_value" style='color:#008080'>"{{detailData.events_attributes[index]['message.type']}}"</div>
- </li>
- <li>
- <div class="ul_label">message.id</div>
- <div class="ul_value" style='color:#0000ff'>{{detailData.events_attributes[index]['message.id']}}</div>
- </li> -->
- </ul>
- </el-collapse-item>
- </el-collapse>
- </div>
- </el-collapse-item>
- </el-collapse>
- </el-drawer>
- </div>
- </template>
- <script>
- import { traceList, traceGraph } from '@/api/trace'
- import { listBiz,listBizStats,listBizGraph} from '@/api/mapping'
- export default {
- data(){
- return {
- Visible:false,
- isFull: false,
- drawer:false,
- // activeIn:['1'],
- detailData:{},
- expands:[],
- activeNames:['one','tow','three'],
- loading: false,
- topoUrl:'http://observe-front.cestong.com.cn/ui/index.html',
- flag:false,
- graphData:{},
- // 设置选中的列的复选框
- colSelect: [
- "Name",
- "StartTime",
- "Cost(ms)",
- "Duration(%)",
- "SpanKind",
- "ServiceName",
- "HttpUrl",
- "HttpCode",
- "DbConnectionString"
- ],
- colData: [
- { title: "Name", istrue: false },
- { title: "StartTime", istrue: false },
- { title: "Cost(ms)", istrue: false },
- { title: "Duration(%)", istrue: false },
- // { title: "StatusCode", istrue: false },
- { title: "SpanKind", istrue: false },
- { title: "ServiceName", istrue: false },
- { title: "EventsAttributes", istrue: false },
- { title: "EventsName", istrue: false },
- { title: "EventsTimestamp", istrue: false },
- { title: "HttpUrl", istrue: false },
- { title: "HttpMethod", istrue: false },
- { title: "ContainerId", istrue: false },
- { title: "httpCode", istrue: false },
- { title: "DbConnectionString", istrue: false },
- { title: "RpcMethod", istrue: false },
- { title: "ResourceAttributes", istrue: false },
- { title: "SpanAttributes", istrue: false },
- { title: "MaxDepth", istrue: false },
- // { title: "dbConnectionString", istrue: false },
- { title: "DbStatement", istrue: false },
- ],
- num:0,
- tableData:[],
- tableDetail:null,
- selectList:[],
- treeList:[],
- // 总条数
- total: 0,
- queryTrace:{
- app_id:'',
- start_time:'',
- end_time:'',
- pageIndex:1,
- pageSize:10
- },
- // 查询参数
- queryParams: {
- trace_id:'',
- pageIndex:1,
- pageSize:10,
- },
- tractID:'',
- treeLoading:false,
- appItem:{},
- BizStatsQuery:{
- biz_id:0,
- start_time:'',
- end_time:'',
- },
- }
- },
- computed: {
- activeIn() {
- if(this.detailData.events_timestamp.length>0 && this.detailData.events_timestamp!=null){
- return this.detailData.events_timestamp.map((item,i) => {
- return i;
- });
- }
- }
- },
- watch: {},
- created(){
- this.$store.commit('time/setTimeFlag',false)
- this.appItem=storage.get('appsItem');
- if(JSON.stringify(this.appItem) !="{}"){
- this.queryTrace.app_id = this.appItem.id;
- const start_time = this.$store.state.time.globalTimes.startTime
- const end_time = this.$store.state.time.globalTimes.endTime
- this.queryTrace.start_time = start_time;
- this.queryTrace.end_time = end_time;
- this.BizStatsQuery.start_time= start_time;
- this.BizStatsQuery.end_time= end_time;
- // this.getListUrlMappingErrors();
- // this.getListUrlMappingQuality();
- // this.getListBiz();
- }
- // let traceId='';
- // let strr = window.location.href;
- // let param = this.parseQueryString(strr);
- // if(param.traceId!=undefined){
- // this.queryTrace.trace_id = param.traceId;
- // this.queryTrace.app_alias=String(param.app_alias);
- // this.tractID = param.traceId;
- // this.getTraceList();
- // }
- // if(param.min_duration != undefined && param.max_duration !=undefined){
- // this.queryTrace.start_time = param.start_time;
- // this.queryTrace.end_time = param.end_time;
- // this.queryTrace.min_duration = param.min_duration;
- // this.queryTrace.max_duration = param.max_duration;
- // this.queryTrace.app_alias = String(param.app_alias);
- // if(param.failed != undefined){
- // this.queryTrace.failed= JSON.parse(param.failed);
- // }
- // this.queryTrace.pageIndex = 1;
- // this.queryTrace.pageSize =10;
- // this.queryTrace.trace_id = ''
- // this.getTraceList();
- // }
-
-
- this.columnChange();
- },
- methods:{
- clickFull() {
- this.Visible=true;
- this.$refs['topo'].initGraph();
- },
- handlePaste(e){
- var clip = e.clipboardData.getData('Text');
- this.queryTrace.trace_id = clip;
- this.$forceUpdate();
- },
- change(e){
- this.$forceUpdate();
- },
- parseQueryString(url){
- var json = {};
- var arr = url.substr(url.indexOf('?') + 1).split('&');
- arr.forEach(item=>{
- var tmp = item.split('=');
- json[tmp[0]] = tmp[1];
- });
- return json;
- },
- getRowData(row){
- this.detailData = row;
- this.drawer=true;
- },
- drawerClose() {
- this.drawer = false;
- },
- // toogleExpand(row,expandedRows){
- // // this.childQueryParams.id = row.id;
- // // this.rowData = []
- // var that = this
- // if (expandedRows.length) {
- // that.expands = []
- // if (row) {
- // that.expands.push(row.id)
- // }
- // } else {
- // that.expands = []
- // }
- // },
- //根据行的id判断
- getRowKeys(row) {
- return row.span_id;
- },
- rowClassRender({row}) {
- if(row.events_timestamp!=null){
- if(row.events_timestamp.length>0){
- return { "background-color": "#fef0f0" }
- }else{
- return '';
- }
- }
- },
- clickRowHandleNode(item){
- this.detailData = item;
- this.drawer=true;
- },
- clickRowHandle(row, column, event) {
- this.detailData = row;
- this.drawer=true;
- },
- status_change(row){
- if(row.row.events_timestamp!=null){
- if(row.row.events_timestamp.length>0){
- return 'table-error-row'
- }else{
- return ''
- }
- }else{
- return ''
- }
-
- },
- /** 搜索按钮操作 */
- handleQuery() {
- this.queryTrace.pageIndex = 1
- // this.queryParams.pageIndex = 1
- // this.getSingleTrace()
- this.getTraceList();
- },
- //控制列的显示和隐藏
- columnChange(val) {
- this.colData.filter((i) => {
- if (this.colSelect.indexOf(i.title) !== -1) {
- i.istrue = true;
- } else {
- i.istrue = false;
- }
- });
- },
- getTraceList(){
- this.loading=true;
- // this.queryTrace.pageSize = 10;
- listBiz(this.queryTrace).then(res=>{
- if(res.code == 200){
- this.loading=false;
- let list = res.data.list;
- this.selectList = res.data.list;
- this.total = res.data.count;
- if(list.length>0){
- for(let i=0;i<list.length;i++){
- for(let j=0;j<this.selectList.length;j++){
- if(this.selectList[i].id == list[i].id){
- this.BizStatsQuery.biz_id = list[i].id;
- listBizStats(this.BizStatsQuery).then(res=>{
- list[i] = {...list[i],...res.data}
- })
- }
- }
-
- }
- this.selectList = list;
- }
- }
-
- })
- },
- getSingleTrace(){
- traceList(this.queryParams).then(res=>{
- if(res.code == 200){
- this.selectList = res.data.list
- // this.total = res.data.count;
- }
-
- })
- },
- getTraceDetail(biz_id){
- this.treeLoading=true;
- listBizGraph({biz_id:biz_id}).then(res=>{
- if(res.code == 200){
- this.num = 1;
- this.treeLoading=false;
- this.tableData=res.data
- this.tableDetail = res.data;
- let arr = res.data
- // let List = this.handleDataTree(arr)
- // this.graphData=List[0];
-
- let List = this.handleData(arr)
- this.graphData = List;
-
- }
- })
- },
- handleData(data) {
- data.forEach((v, k) => {
- v.id = v.span_id;
- v.collapsed = false;
- v.name = v.span_name;
- // v.label = (v.duration).toFixed(2);
- v.label = v.duration.toFixed(2);
- v.currency='ms';
- v.rate = v.duration_persent;
- v.status = (v.status_code == 'STATUS_CODE_ERROR'||v.events_timestamp.length>0||v.http_code>399)?'R':(v.duration>500)?'Y':'G';
- v.variableValue = v.duration_persent;
- // v.status_code = 'UNSET'
-
- if (v.children != undefined && v.children.length > 0) {
- v.children = this.handleData(v.children)
- }
- })
- return data
- },
- handlerTreeData(arr) {
- if (arr) {
- arr.forEach((item) => {
- // if(item[key]){
- // delete item[key]
- // }
- // const {gender, ...item} = item;
- if (item.children && item.children!==[]) handler(item.children)
- })
- return arr
- }
- },
- //删除树形结构数据中的某个属性
- handlerTreeDataSimple (arr, key) {
- if (arr) {
- arr.forEach((item) => {
- if(item[key]){
- delete item[key]
- }
- if (item.children && item.children!==[]) handler(item.children, key)
- })
- return arr
- }
- },
- handleDataTree(data) {
- let obj = {}
- let list = [];
- data.forEach((v, k) => {
- obj.id = v.span_id.substr(v.span_id.length - 4);;
- obj.collapsed = false;
- obj.name = v.span_name;
- obj.label = (v.duration).toFixed(2);
- obj.rate = v.duration_persent.toFixed(2);
- obj.status = v.status_code == 'STATUS_CODE_ERROR'?'R':'G';
- obj.variableValue = v.duration_persent.toFixed(2);
- obj.currency='ms';
- obj.variableName='V1';
- obj.variableUp=false;
- if (v.children != undefined && v.children.length > 0) {
- obj.children = this.handleDataTree(v.children)
- }
- list.push(obj)
- })
- return list
- },
-
- getTraceGraph(trace_id){
- traceGraph(trace_id).then(res=>{
- if(res.code == 200){
- res.data.nodes = res.data.nodes.map((item)=>({
- label:item.title,
- id: item.id,
- title: item.title,
- subtitle: item.subtitle,
- mainstat: item.mainstat,
- secondarystat: item.secondarystat,
- arc_green: item.arc_green, // 结点圆圈颜色,1代表纯绿色,与red和为1
- arc_red: item.arc_red, // 计算方式为当spankind为client时, current/total的值
- icon: item.icon
- }))
- // this.graphData=res.data
- }
- })
- },
- handleRowClick(row, column, event){
- setTimeout(()=>{
- this.flag = true;
- this.tractID = row.trace_id;
- this.$refs.table.toggleRowSelection(row);
- this.getTraceDetail(row.trace_id);
- // this.getTraceGraph(this.tractID);
- },0)
- // this.num = 1;
-
- },
- toggleTab(val){
- this.num = val;
- }
- }
- }
- </script>
- <style lang='scss' scoped>
- .TreeBox{
- display: flex;
- justify-content: space-between;
- }
- [v-cloak]{
- display: none!important;
- }
- ::v-deep .el-tooltip__popper{ max-width:50%!important }
- .table-error-row td{
- background-color: #fef0f0;
- }
- ::v-deep .collapse-title {
- flex: 1 0 90% !important;
- order: 1 !important;
- }
- ::v-deep .el-collapse-item__header {
- flex: 1 0 auto !important;
- order: -1 !important;
- padding-left:8px!important;
- height: 30px;
- line-height: 30px;
- }
- ::v-deep .el-collapse-item__header:hover{
- background: rgb(232, 232, 232);
- }
- ::v-deep .el-drawer__header{
- margin-bottom: 0!important;
- font-weight: 500;
- }
- ul {
- display: block;
- list-style-type: disc;
- margin-block-start: 0;
- margin-block-end: 0;
- margin-inline-start: 0px;
- margin-inline-end: 0px;
- padding-inline-start: 0;
- }
- .ul_box{
- border: 1px solid rgba(36, 41, 46, 0.12);
- box-sizing: border-box;
- padding:4px;
- margin:8px;
- border-radius: 3px;
- }
- .ul_box li{
- display: flex;
- min-height: 30px;
- line-height: 30px;
- box-sizing: border-box;
- // padding:0 4px;
- }
- .ul_box li .ul_label{
- color: rgb(136, 136, 136);
- // white-space: pre;
- width: 180px;
- min-width: 180px;
- display: flex;
- flex-direction: column;
- // align-items: flex-end;
- justify-content: flex-end;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .ul_box li .ul_value{
- // white-space: nowrap;
- // word-break: keep-all;
- // overflow: hidden;
- // text-overflow: ellipsis;
- font-family: monospace;
- display: flex;
- flex-direction: column;
- // align-items: flex-end;
- justify-content: flex-end;
- }
- .ul_box li:nth-child(even) {
- background: rgb(245, 245, 245);
- }
- .events_box{
- padding:8px;
- border: 1px solid rgba(36, 41, 46, 0.12);
- border-radius: 3px;
- }
- .events_box ::v-deep .el-collapse-item__header {
- background-color: rgb(244, 245, 245)
- // background: rgb(228, 228, 228);
- }
- .css-container{
- background-color: rgb(255, 255, 255);
- border: 1px solid rgba(36, 41, 46, 0.12);
- position: relative;
- border-radius: 2px;
- height: 100%;
- display: flex;
- flex-direction: column;
- }
- .css-header{
- display: flex;
- -webkit-box-align: center;
- align-items: center;
- height: 32px;
- cursor: auto;
- .css-title{
- margin-bottom: 0px;
- padding: 0px 8px;
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
- font-size: 14px;
- font-weight: 550;
- line-height: 1.57143;
- letter-spacing: 0.2px;
- font-family: Inter, Helvetica, Arial, sans-serif;
- }
- }
- .css-content{
- padding: 0px;
- box-flex:1;
- -webkit-box-flex: 1;
- flex-grow: 1;
- contain: none;
- }
- .css-page-header{
- background-color: rgb(255, 255, 255);
- padding: 0.5em 0px 0px;
- position: sticky;
- top: 0px;
- z-index: 5;
- }
- .css-name{
- align-items: flex-start;
- display: flex;
- padding: 0px 8px;
- .css-name-title{
- color: inherit;
- flex: 1 1 0%;
- font-size: 1.7em;
- line-height: 1em;
- margin: 0px 0px 0.45em;
- font-weight: 400;
- letter-spacing: -0.00893em;
- font-family: Inter, Helvetica, Arial, sans-serif;
- .trace-name{
- font-size: 18px;
- }
- .css-text{
- display: inline-block;
- white-space: pre;
- }
- }
- }
- .css-small{
- color: rgb(170, 170, 170);
- margin: 0px 12px;
- font-size: 12px;
- font-weight: 400;
- }
- .css-action{
- font-size: 14px;
- font-weight: 500;
- font-family: Inter, Helvetica, Arial, sans-serif;
- }
- .css-time-box{
- flex: 1 1 0%;
- line-height: 1.5;
- margin: -8px 8px 12px;
- }
- .css-time-wrap{
- vertical-align: middle;
- }
- .css-time-vlaue-detail{
- color: rgb(170, 170, 170);
- }
- .css-type {
- margin: 0px 12px;
- // vertical-align: text-top;
- }
- .css-api{
- margin: -2.5px 2.4px;
- height: 15px;
- overflow: hidden;
- word-break: break-all;
- line-height: 20px;
- }
- .full{
- width:32px;
- height:32px;
- position: absolute;
- top:-35px;
- right:0px;
- display: block;
- i{
- font-size: 16px;
- color:#999;
- }
- }
- </style>
- <style scoped>
- .el-tooltip__popper{ max-width:50%!important }
- [v-cloak]{
- display:none!important;
- }
- </style>
|