Skip to content

Commit

Permalink
PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ogupte committed Jan 13, 2020
1 parent 3ccffad commit 02cae50
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion x-pack/legacy/plugins/apm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const apm: LegacyPluginInitializer = kibana => {

// service map
serviceMapEnabled: Joi.boolean().default(false),
serviceMapInitialTimeRange: Joi.number().default(60 * 1000 * 15) // last 15 minutes
serviceMapInitialTimeRange: Joi.number().default(60 * 1000 * 60) // last 1 hour
}).default();
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export function Cytoscape({
// Trigger a custom "data" event when data changes
useEffect(() => {
if (cy) {
// cy.remove(cy.nodes());
cy.add(elements);
cy.trigger('data');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export async function getServiceMapFromTraceIds({
map_script: {
lang: 'painless',
source: `def id;
if (!doc['span.id'].empty) {
if (!doc['span.id'].empty) {
id = doc['span.id'].value;
} else {
id = doc['transaction.id'].value;
Expand Down Expand Up @@ -106,12 +106,12 @@ export async function getServiceMapFromTraceIds({
destination['span.subtype'] = event['span.subtype'];
return destination;
}
def processAndReturnEvent(def context, def eventId) {
if (context.processedEvents[eventId] != null) {
return context.processedEvents[eventId];
}
def event = context.eventsById[eventId];
if (event == null) {
Expand Down Expand Up @@ -141,7 +141,8 @@ export async function getServiceMapFromTraceIds({
if (parent['destination.address'] != null
&& parent['destination.address'] != ""
&& parent['span.type'] == 'external'
&& (parent['span.type'] == 'external'
|| parent['span.type'] == 'messaging')
&& (parent['service.name'] != event['service.name']
|| parent['service.environment'] != event['service.environment']
)
Expand All @@ -154,15 +155,15 @@ export async function getServiceMapFromTraceIds({
def lastLocation = basePath.size() > 0 ? basePath[basePath.size() - 1] : null;
def currentLocation = new HashMap(service);
def currentLocation = service;
/* only add the current location to the path if it's different from the last one*/
if (lastLocation == null || !lastLocation.equals(currentLocation)) {
basePath.add(currentLocation);
}
/* if there is an outgoing span, create a new path */
if (event['destination.address'] != null && event['destination.address'] != '') {
if (event['span.type'] == 'external' || event['span.type'] == 'messaging') {
def outgoingLocation = getDestination(event);
def outgoingPath = new ArrayList(basePath);
outgoingPath.add(outgoingLocation);
Expand All @@ -179,7 +180,7 @@ export async function getServiceMapFromTraceIds({
context.processedEvents = new HashMap();
context.eventsById = new HashMap();
context.paths = new HashSet();
context.externalToServiceMap = new HashMap();
context.locationsToRemove = new HashSet();
Expand All @@ -195,8 +196,8 @@ export async function getServiceMapFromTraceIds({
def paths = new HashSet();
for(foundPath in context.paths) {
if (!context.locationsToRemove.contains(foundPath)) {
paths.add(foundPath);
if (!context.locationsToRemove.contains(foundPath)) {
paths.add(foundPath);
}
}
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/apm/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const config = {
},
schema: schema.object({
serviceMapEnabled: schema.boolean({ defaultValue: false }),
serviceMapInitialTimeRange: schema.number({ defaultValue: 60 * 1000 * 15 }), // last 15 minutes
serviceMapInitialTimeRange: schema.number({ defaultValue: 60 * 1000 * 60 }), // last 1 hour
autocreateApmIndexPattern: schema.boolean({ defaultValue: true }),
ui: schema.object({
enabled: schema.boolean({ defaultValue: true }),
Expand Down

0 comments on commit 02cae50

Please sign in to comment.