Skip to content

Commit

Permalink
Upgrade to ODFE 1.12.0 (#5)
Browse files Browse the repository at this point in the history
* Bump to 7.10

* Add github actions

* Refactor

* Add release notes for ODFE 1.12

* Use env in github actions

* Remove target in plugin helpers config

* Update readme

* Add doc link
  • Loading branch information
joshuali925 authored Nov 20, 2020
1 parent b95d4bf commit 6449ee5
Show file tree
Hide file tree
Showing 13 changed files with 268 additions and 4,116 deletions.
6 changes: 6 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*Issue #, if available:*

*Description of changes:*


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
57 changes: 57 additions & 0 deletions .github/workflows/release-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

name: Release Trace Analytics Artifacts

on:
push:
tags:
- 'v*'

env:
PLUGIN_NAME: opendistroTraceAnalyticsKibana
OD_VERSION: 1.12.0.0

jobs:

build:

runs-on: ubuntu-latest

steps:

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Checkout Kibana
uses: actions/checkout@v1
with:
repository: opendistro-for-elasticsearch/kibana-oss
ref: 7.10.0
token: ${{secrets.OD_ACCESS}}
path: kibana

- name: Checkout Plugin
uses: actions/checkout@v1
with:
path: kibana/plugins/trace-analytics

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '10.22.1'

- name: Kibana Pluign Bootstrap
run: |
yarn kbn bootstrap
- name: Build Artifact
run: |
yarn build
mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}.zip
artifact=`ls ./build/*.zip`
aws s3 cp $artifact s3://artifacts.opendistroforelasticsearch.amazon.com/downloads/kibana-plugins/opendistro-trace-analytics/
aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths "/downloads/*"
42 changes: 42 additions & 0 deletions .github/workflows/test-and-build-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@

name: Test and Build Trace Analytics

on: [pull_request, push]

env:
PLUGIN_NAME: opendistroTraceAnalyticsKibana
OD_VERSION: 1.12.0.0

jobs:

build:

runs-on: ubuntu-latest

steps:
- name: Checkout Kibana
uses: actions/checkout@v1
with:
repository: elastic/kibana
ref: v7.10.0
path: kibana
- name: Checkout Plugin
uses: actions/checkout@v1
with:
path: kibana/plugins/trace-analytics
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '10.22.1'
- name: Kibana Pluign Bootstrap
run: |
yarn kbn bootstrap
- name: Build Artifact
run: |
yarn build
mv ./build/*.zip ./build/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}.zip
- name: Upload Artifact
uses: actions/upload-artifact@v1
with:
name: trace-analytics
path: ./build
10 changes: 5 additions & 5 deletions .kibana-plugin-helpers.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"buildSourcePatterns": [
"serverSourcePatterns": [
"package.json",
"yarn.lock",
"tsconfig.json",
"{public,server}/**/*",
"kibana.json",
"target/**/*",
"common/**/*"
"common/**/*",
"public/**/*",
"server/**/*",
"kibana.json"
]
}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

The Open Distro for Elasticsearch Trace Analytics plugin provides instant on dashboards in Kibana for users to quickly analyze their logs. The plugin uses aggregated results from two indices, `otel-v1-apm-span-*` and `otel-v1-apm-service-map` created by the otel-trace-raw-processor and service-map-processor, and renders three main views:

1. Dashboard: an overview of the trace groups and three charts: service map, error rate, and throughput.
1. Dashboard: an overview of the trace groups and two charts: error rate and throughput.

1. Traces: a table of top-level traces with unique trace id's, where users can click on any trace to see its end-to-end performance metrics, service performance metrics, and a span latency metrics in a Gantt chart.

1. Services: a table of the services, where users can click on a service to see its performance metrics and related services.
1. Services: a table of the services and a service map, where users can click on a service in the table to see its performance metrics and related services.

Additionally the fields can be sorted and filtered.

## Documentation

Please see our technical [documentation](https://opendistro.github.io/for-elasticsearch-docs/docs/kibana/) to learn more about its features.
Please see our technical [documentation](https://opendistro.github.io/for-elasticsearch-docs/docs/trace/) to learn more about its features.

## Setup

Expand All @@ -39,7 +39,7 @@ Ultimately, your directory structure should look like this:

To build the plugin's distributable zip simply run `yarn build`.

Example output: `./build/opendistro-trace-analytics-*.zip`
Example output: `./build/opendistroTraceAnalytics-*.zip`


## Run
Expand Down
2 changes: 2 additions & 0 deletions common/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ export const SERVICE_MAP_MAX_NODES = 500;
// size limit when requesting edge related queries, not necessarily the number of edges
export const SERVICE_MAP_MAX_EDGES = 1000;
export const TRACES_MAX_NUM = 3000;
export const DOCUMENTATION_LINK = 'https://opendistro.github.io/for-elasticsearch-docs/docs/trace/';

6 changes: 3 additions & 3 deletions kibana.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "opendistroTraceAnalytics",
"version": "0.0.3",
"kibanaVersion": "7.9.1",
"id": "opendistroTraceAnalyticsKibana",
"version": "1.12.0.0",
"kibanaVersion": "7.10.0",
"server": true,
"ui": true,
"requiredPlugins": ["navigation"],
Expand Down
41 changes: 13 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,31 @@
{
"name": "opendistro-trace-analytics",
"version": "0.0.4",
"name": "opendistro-trace-analytics-kibana",
"version": "1.12.0.0",
"kibana": {
"version": "7.9.1",
"version": "7.10.0",
"templateVersion": "1.0.0"
},
"license": "Apache-2.0",
"scripts": {
"kbn": "node ../../scripts/kbn",
"lint": "eslint .",
"test:cypress": "cypress run",
"build": "yarn plugin-helpers build",
"plugin-helpers": "node ../../scripts/plugin_helpers"
},
"dependencies": {
"@types/react-plotly.js": "^2.2.4",
"cypress": "^5.6.0",
"lodash": "^4.17.20",
"plotly.js": "^1.54.1",
"react": "^16.12.0",
"react-graph-vis": "^1.0.5",
"react-plotly.js": "^2.4.0"
},
"scripts": {
"kbn": "node ../../scripts/kbn",
"lint": "eslint .",
"start": "plugin-helpers start",
"test:server": "plugin-helpers test:server",
"test:browser": "plugin-helpers test:browser",
"build": "plugin-helpers build"
},
"devDependencies": {
"@elastic/eslint-config-kibana": "link:../../packages/eslint-config-kibana",
"@elastic/eslint-import-resolver-kibana": "link:../../packages/kbn-eslint-import-resolver-kibana",
"@kbn/plugin-helpers": "link:../../packages/kbn-plugin-helpers",
"cypress": "^5.0.0",
"eslint": "^6.8.0",
"eslint-plugin-babel": "^5.2.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jest": "^23.8.2",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-mocha": "^6.3.0",
"eslint-plugin-no-unsanitized": "^3.0.2",
"eslint-plugin-prefer-object-spread": "^1.2.1",
"eslint-plugin-react": "^7.11.1",
"eslint-plugin-react-hooks": "^4.2.0",
"typescript": "3.7.2"
"@types/react-plotly.js": "^2.2.4"
},
"engines": {
"node": "10.22.0",
"node": "10.22.1",
"yarn": "^1.21.1"
}
}
18 changes: 11 additions & 7 deletions public/components/common/helper_functions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
import dateMath from '@elastic/datemath';
import { EuiButton, EuiEmptyPrompt, EuiSpacer, EuiText } from '@elastic/eui';
import { SpacerSize } from '@elastic/eui/src/components/spacer/spacer';
import moment from 'moment';
import React from 'react';
import { RAW_INDEX_NAME, SERVICE_MAP_INDEX_NAME } from '../../../common';
import { DOCUMENTATION_LINK, RAW_INDEX_NAME, SERVICE_MAP_INDEX_NAME } from '../../../common';
import { serviceMapColorPalette } from './color_palette';
import { FilterType } from './filters/filters';
import { ServiceObject } from './plots/service_map';
Expand Down Expand Up @@ -64,7 +63,12 @@ export function MissingConfigurationMessage() {
}
actions={
// TODO: add docs link here
<EuiButton color="primary" iconSide="right" iconType="popout" onClick={() => {}}>
<EuiButton
color="primary"
iconSide="right"
iconType="popout"
onClick={() => window.open(DOCUMENTATION_LINK, '_blank')}
>
Learn more
</EuiButton>
}
Expand Down Expand Up @@ -186,10 +190,10 @@ export const minFixedInterval = (startTime: string, endTime: string) => {
const diffSeconds = momentEnd.unix() - momentStart.unix();

if (diffSeconds <= 1) return '1ms'; // less than 1 second
if (diffSeconds <= 60) return '1s'; // less than 1 minute
if (diffSeconds <= 3600) return '1m'; // less than 1 hour
if (diffSeconds <= 86400) return '1h'; // less than 1 day
if (diffSeconds <= 86400 * 31) return '1d'; // less than 1 month
if (diffSeconds <= 60 * 2) return '1s'; // less than 2 minutes
if (diffSeconds <= 3600 * 2) return '1m'; // less than 2 hours
if (diffSeconds <= 86400 * 2) return '1h'; // less than 2 days
if (diffSeconds <= 86400 * 62) return '1d'; // less than 2 months
if (diffSeconds <= 86400 * 366) return '30d'; // less than 1 year
return '365d';
};
Expand Down
64 changes: 32 additions & 32 deletions public/components/common/side_nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,38 @@ import { EuiPage, EuiPageBody, EuiPageSideBar, EuiSideNav, EuiText } from '@elas
import React from 'react';

export const renderPageWithSidebar = (BodyComponent: JSX.Element, activeId = 1) => {
function SideNav({ activeId }: { activeId: number }) {
return (
<EuiSideNav
items={[
{
name: 'Trace Analytics',
id: 0,
items: [
{
name: 'Dashboard',
id: 1,
href: '#/dashboard',
},
{
name: 'Traces',
id: 2,
href: '#/traces',
},
{
name: 'Services',
id: 3,
href: '#/services',
},
].map((item) => {
return { ...item, isSelected: activeId === item.id };
}),
},
]}
/>
);
}

return (
<EuiPage>
<EuiPageSideBar>
Expand All @@ -26,35 +58,3 @@ export const renderPageWithSidebar = (BodyComponent: JSX.Element, activeId = 1)
</EuiPage>
);
};

export function SideNav({ activeId }: { activeId: number }) {
return (
<EuiSideNav
items={[
{
name: <EuiText>Trace Analytics</EuiText>,
id: 0,
items: [
{
name: 'Dashboard',
id: 1,
href: '#/dashboard',
},
{
name: 'Traces',
id: 2,
href: '#/traces',
},
{
name: 'Services',
id: 3,
href: '#/services',
},
].map((item) => {
return { ...item, isSelected: activeId === item.id };
}),
},
]}
/>
);
}
2 changes: 1 addition & 1 deletion public/requests/traces_request_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const handleTracesRequest = async (http, DSL, timeFilterDSL, items, setIt
trace_group: bucket.trace_group.buckets[0]?.key,
latency: bucket.latency.value,
last_updated: moment(bucket.last_updated.value).format(DATE_FORMAT),
error_count: bucket.error_count.doc_count > 0 ? 'True' : 'False',
error_count: bucket.error_count.doc_count > 0 ? 'Yes' : 'No',
percentile_in_trace_group: binarySearch(
percentileRanges[bucket.trace_group.buckets[0]?.key],
bucket.latency.value
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## 2020-11-18 Version 1.12.0.0

### Features
* Rebase trace analytics to main branch ([#1](https://github.com/opendistro-for-elasticsearch/trace-analytics/pull/1))


### Enhancements
* Move service map UI and update status.code definition ([#3](https://github.com/opendistro-for-elasticsearch/trace-analytics/pull/3))


### Maintenance
* Upgrade to ODFE 1.12.0 ([#5](https://github.com/opendistro-for-elasticsearch/trace-analytics/pull/5))
Loading

0 comments on commit 6449ee5

Please sign in to comment.