Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/wso2/product-sp
Browse files Browse the repository at this point in the history
  • Loading branch information
niveathika committed Jun 8, 2018
2 parents 03a7b5c + a0906f1 commit b33f3cf
Show file tree
Hide file tree
Showing 22 changed files with 689 additions and 130 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,8 @@ wso2.business.rules.manager:
- identifying-continuous-production-decrease
- popular-tweets-analysis
- http-analytics-processing
- activity-explorer-app-template
- activity-explorer-source-template
# credentials for worker nodes
username: admin
password: admin
Expand Down
17 changes: 17 additions & 0 deletions modules/distribution/carbon-home/conf/worker/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,23 @@ wso2.datasources:
validationTimeout: 30000
isAutoCommit: false

- name: Activity_Explorer_DB
description: "The datasource used for activity explorer to store span information."
jndiConfig:
name: jdbc/Activity_Explorer_DB
definition:
type: RDBMS
configuration:
jdbcUrl: 'jdbc:h2:${sys:carbon.home}/wso2/dashboard/database/ACTIVITY_EXPLORER_DB;AUTO_SERVER=TRUE'
username: wso2carbon
password: wso2carbon
driverClassName: org.h2.Driver
maxPoolSize: 50
idleTimeout: 60000
connectionTestQuery: SELECT 1
validationTimeout: 30000
isAutoCommit: false

# Cluster Configuration
cluster.config:
enabled: false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
{
"templateGroup": {
"uuid": "activity-explorer",
"name": "Activity Explorer",
"description": "Templates for Activity Explorer scenario",
"ruleTemplates": [
{
"uuid": "activity-explorer-source-template",
"name": "Activity Explorer Source Template",
"description": "Defines a source for the Span Stream (Assumes that the attributes of the receiving stream contains the exact attributes as the persisting span stream)",
"type": "template",
"instanceCount": "many",
"script": "var sourceOptions = acceptSourceOptions('${userInputForsourceOptions}');\n\n/**\n* Accepts source options when given, otherwise returns a blank\n*/\nfunction acceptSourceOptions(input) {\n\tif (input === '()') {\n\t return '';\n\t}\n\treturn input + ',';\n}\n\n\n\n\n",
"templates": [
{
"type": "siddhiApp",
"content": "@App:name(\"Activity Explorer\")\n@App:description(\"This Siddhi app defines a source for the Span Stream and persists the stream\")\n\n@source(type='${sourceType}', ${sourceOptions}\n @map(type='${mapType}')\n)\ndefine stream SpanStream (componentName string, traceId string, spanId string, baggageItems string, parentId string, serviceName string, startTime long, endTime long, tags string, references string);\n\n@Store(type='rdbms', datasource='Activity_Explorer_DB', field.length=\"tags:8000\")\n@PrimaryKey('traceId', 'spanId')\ndefine table SpanTable (componentName string, traceId string, spanId string, baggageItems string, parentId string, serviceName string, startTime long, endTime long, duration long, tags string, spanReferences string);\n\nfrom SpanStream\nselect componentName, traceId, spanId, baggageItems, parentId, serviceName, startTime, endTime, endTime - startTime as duration, tags, references as spanReferences\ninsert into SpanTable;"
}
],
"properties": {
"sourceType": {
"fieldName": "source type",
"description": "Receiving source type (\"http\", \"jms\", \"kafka\")",
"defaultValue": "wso2event"
},
"mapType": {
"fieldName": "Map Type",
"description": "Event attribute mapping type ",
"defaultValue": "wso2event"
},
"userInputForsourceOptions": {
"fieldName": "Source Options",
"description": "Receiving source options (eg: topic.list='kafka_topic', partition.no.list='0', threading.option='single.thread')",
"defaultValue": "()"
}
}
},
{
"uuid": "activity-explorer-app-template",
"name": "Activity Explorer App Template",
"description": "Converts a specific span stream to persisting span stream (with or without a parent span per activity trace)",
"type": "template",
"instanceCount": "many",
"script": "var noOfEventForTrace = acceptNoOfEventForTrace('${userInputForNoOfEventForTrace}');\n\n/**\n* Accepts source options when given, otherwise returns a blank\n*/\nfunction acceptNoOfEventForTrace(input) {\n\tvar value = Math.floor(--input);\n\tvar numarr = value.toString().split(\".\");\n\treturn numarr[0];\n}",
"templates": [
{
"type": "siddhiApp",
"content": "@App:name(\"ActivityExplorer\")\n@App:description(\"This Siddhi app defines a source for the Span Stream and converts the received span stream to WSO2 span stream format\")\n\n${spanStreamInDefinition}\n\n@Store(type='rdbms', datasource='Activity_Explorer_DB', field.length=\"tags:8000\")\n@PrimaryKey('traceId', 'spanId')\ndefine table SpanTable (componentName string, traceId string, spanId string, baggageItems string, parentId string, serviceName string, startTime long, endTime long, duration long, tags string, spanReferences string);\n\nfrom SpanStreamIn\nselect ${componentName} as componentName, ${traceId} as traceId, ${spanId} as spanId, ${baggageItems} as baggageItems, ${parentId} as parentId, ${serviceName} as serviceName, ${startTime} as startTime, ${endTime} as endTime, ${tags} as tags, ${spanReferences} as spanReferences\ninsert into TempSpanStream;\n\nfrom TempSpanStream[ not ${parentSpanIsDefined}]\nselect componentName, traceId, spanId, baggageItems, str:concat(\"parent_\", traceId) as parentId, serviceName, startTime, endTime, tags, spanReferences\ninsert into CreateParentSpanStream;\n\nfrom TempSpanStream[${parentSpanIsDefined}]\nselect componentName, traceId, spanId, baggageItems, parentId, serviceName, startTime, endTime, tags, spanReferences\ninsert into SpanStream;\n\nfrom every( e1=CreateParentSpanStream) -> e2=CreateParentSpanStream[e1.traceId==traceId]<${noOfEventForTrace}>\nwithin ${approximateTimeForCompleteTrace}\nselect e1.componentName as componentName, e1.traceId as traceId, str:concat(\"parent_\", e1.traceId) as spanId, \"\" as baggageItems, \"-1\" as parentId, ${parentServiceName} as serviceName, e1.startTime as startTime, e2[last].endTime as endTime, \"[{}]\" as tags, \"\" as spanReferences\ninsert into SpanStream;\n\nfrom CreateParentSpanStream\nselect *\ninsert into SpanStream;\n\nfrom SpanStream\nselect componentName, traceId, spanId, baggageItems, parentId, serviceName, startTime, endTime, endTime - startTime as duration, tags, spanReferences\ninsert into SpanTable;"
}
],
"properties": {
"spanStreamInDefinition": {
"fieldName": "Span stream definition",
"description": "This contains the source description and the stream definition",
"defaultValue": "@source(type='wso2event', @map(type='wso2event')) define stream SpanStreamIn (meta_tenant_id int, meta_http_method string, meta_character_set_encoding string, meta_remote_address string, meta_transport_in_url string, meta_message_type string, meta_remote_host string, meta_service_prefix string, meta_host string, correlation_activity_id string, message_direction string, service_name string, operation_name string, message_id string, timestamp long, zone string, status string, startzone string, targetzone string, file_path string, file_name string, file_uri string, file_length long, last_modified long, transport_name string, soap_header string);"
},
"componentName": {
"fieldName": "Component Name",
"description": "The module that generated the associated Span. Can be a constant or SpanStreamIn stream's attribute name",
"defaultValue": "\"wso2\""
},
"traceId": {
"fieldName": "Trace ID",
"description": "Attribute name in spanStreamIn for Trace ID. This is the module that generated the associated Span. Should be a unique value across the activity",
"defaultValue": "correlation_activity_id"
},
"spanId": {
"fieldName": "Span ID",
"description": "Attribute name in spanStreamIn for Span ID. Unique for each span. Use a mechanism to generate value as shown in the default value, if the stream \"start time\" attribute is not available) (check default value)",
"defaultValue": "str:concat(correlation_activity_id, timestamp)"
},
"baggageItems": {
"fieldName": "Baggage Items",
"description": "Attribute name in spanStreamIn for Baggage Items. This is a mostly a common payload which goes across the trace",
"defaultValue": "\"\""
},
"parentId": {
"fieldName": "Parent ID",
"description": "Attribute name in spanStreamIn for Parent ID. Parent's Span ID of the span (Can be an attribute name, constant or generated through this template)",
"defaultValue": "\"0\""
},
"serviceName": {
"fieldName": "Service Name",
"description": "Attribute name in spanStreamIn for Service Name. This will be visible in the activity explorer dashboard (Should be a unique value to identify the span). Use a mechanism to generate value as shown in the default value, if the stream \"start time\" attribute is not available)",
"defaultValue": "str:concat(correlation_activity_id, \"_\", timestamp)"
},
"startTime": {
"fieldName": "Start Time",
"description": "Attribute name in spanStreamIn for Start Time for the span in milliseconds",
"defaultValue": "timestamp"
},
"endTime": {
"fieldName": "End Time",
"description": "Attribute name in spanStreamIn for Start Time for the span in milliseconds. Use a mechanism to generate value as shown in the default value, if the stream \"start time\" attribute is not available)",
"defaultValue": "(timestamp + 300)"
},
"tags": {
"fieldName": "Tags",
"description": "Attribute name in spanStreamIn for Tags. This is the payload of the span (This should be a json payload. Can use concatenation using str:concat)",
"defaultValue": "str:concat(\"[{'meta_tenant_id':'\", meta_tenant_id, \"'},{'meta_http_method':'\", meta_http_method, \"'},{'meta_character_set_encoding':'\", meta_character_set_encoding, \"'},{'meta_remote_address':'\", meta_remote_address, \"'},{'correlation_activity_id':'\", correlation_activity_id, \"'},{'service_name':'\", service_name, \"'},{'operation_name':'\", operation_name, \"'},{'start_timestamp':'\", timestamp, \"'},{'end_timestamp':'\", (timestamp + 300), \"'}]\")"
},
"spanReferences": {
"fieldName": "Span References",
"description": "Attribute name in spanStreamIn for Span References",
"defaultValue": "\"\""
},
"parentSpanIsDefined": {
"fieldName": "Parent span is defined",
"description": "Value \"true\" implies the parent span received in the spanStreamIn",
"defaultValue": "true"
},
"approximateTimeForCompleteTrace": {
"fieldName": "Approximate Time For Complete Trace",
"description": "This parameter is required to generate parent span using the spans accumulated during the 1 minute period",
"defaultValue": "1 min"
},
"userInputForNoOfEventForTrace": {
"fieldName": "No of Events per Trace",
"description": " This is required only if parentSpanIsDefined is false to generate the parent span",
"defaultValue": "4"
},
"parentServiceName": {
"fieldName": "Parent Span Service name",
"description": "This is the service name which will be given to the parent span generated by siddhi (eg: str:concat(\"parent\", \"_\", e1.startTime, \"-\", e2[last].endTime)",
"defaultValue": "\"parent_service\""
}
}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ org.wso2.carbon.extensions.touchpoint.mkdir(path:${installFolder}/../{runtime}/d
org.wso2.carbon.extensions.touchpoint.copy(source:${installFolder}/../lib/features/org.wso2.sp.portal.activity.explorer.solution_${feature.version}/portal/extensions/widgets/,target:${installFolder}/../{runtime}/deployment/web-ui-apps/portal/extensions/widgets/,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../lib/features/org.wso2.carbon.dashboards.samples_${feature.version}/widgets/);\
org.wso2.carbon.extensions.touchpoint.mkdir(path:${installFolder}/../{runtime}/database/);\
org.wso2.carbon.extensions.touchpoint.copy(source:${installFolder}/../lib/features/org.wso2.sp.portal.activity.explorer.solution_${feature.version}/repository/database/ACTIVITY_EXPLORER_DB.mv.db,target:${installFolder}/../{runtime}/database/ACTIVITY_EXPLORER_DB.mv.db,overwrite:true);
org.wso2.carbon.extensions.touchpoint.copy(source:${installFolder}/../lib/features/org.wso2.sp.portal.activity.explorer.solution_${feature.version}/repository/database/ACTIVITY_EXPLORER_DB.mv.db,target:${installFolder}/../{runtime}/database/ACTIVITY_EXPLORER_DB.mv.db,overwrite:true);\
org.wso2.carbon.extensions.touchpoint.copy(source:${installFolder}/../lib/features/org.wso2.sp.portal.activity.explorer.solution_${feature.version}/business_rules/templates/activity-explorer.json,target:${installFolder}/../{runtime}/resources/businessRules/templates/activity-explorer.json,overwrite:true);

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
"private": true,
"dependencies": {
"@wso2-dashboards/widget": "1.1.2",
"axios": "^0.17.1",
"lodash": "^4.17.4",
"material-ui": "^0.20.0",
"prop-types": "^15.6.0",
"react": "^16.1.1",
"react-custom-scrollbars": "^4.2.1",
"react-dom": "^16.1.1",
"react-vizgrammar": "^0.7.5",
"react-vizgrammar": "^0.7.12",
"rimraf": "^2.6.2",
"victory": "^0.22.2"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
*/

.event-table-wrapper .rt-th {
box-shadow: none;
}

.event-table-wrapper .rt-tbody .rt-td > .rt-td {
padding-left: 3px;
box-sizing: border-box;
}
Loading

0 comments on commit b33f3cf

Please sign in to comment.