Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,55 +195,55 @@ func ContainerMetric(msg *events.Envelope) *Event {
}

func (e *Event) AnnotateWithAppData(appCache cache.Cache, config *Config) {
cf_app_id := e.Fields["cf_app_id"]
appGuid := fmt.Sprintf("%s", cf_app_id)
cfAppId := e.Fields["cf_app_id"]
appGuid := fmt.Sprintf("%s", cfAppId)

if cf_app_id != nil && appGuid != "<nil>" && cf_app_id != "" {
if cfAppId != nil && appGuid != "<nil>" && cfAppId != "" {
appInfo, err := appCache.GetApp(appGuid)
if err != nil {
if err == cache.ErrMissingAndIgnored {
logrus.Info(err.Error(), cf_app_id)
logrus.Info(err.Error(), cfAppId)
} else {
logrus.Error("Failed to fetch application metadata from remote: ", err)
}
return
} else if appInfo == nil {
return
}
cf_app_name := appInfo.Name
cf_space_id := appInfo.SpaceGuid
cf_space_name := appInfo.SpaceName
cf_org_id := appInfo.OrgGuid
cf_org_name := appInfo.OrgName
cf_ignored_app := appInfo.IgnoredApp
app_env := appInfo.CfAppEnv

if cf_app_name != "" && config.AddAppName {
e.Fields["cf_app_name"] = cf_app_name
cfAppName := appInfo.Name
cfSpaceId := appInfo.SpaceGuid
cfSpaceName := appInfo.SpaceName
cfOrgId := appInfo.OrgGuid
cfOrgName := appInfo.OrgName
cfIgnoredApp := appInfo.IgnoredApp
appEnv := appInfo.CfAppEnv

if cfAppName != "" && config.AddAppName {
e.Fields["cf_app_name"] = cfAppName
}

if cf_space_id != "" && config.AddSpaceGuid {
e.Fields["cf_space_id"] = cf_space_id
if cfSpaceId != "" && config.AddSpaceGuid {
e.Fields["cf_space_id"] = cfSpaceId
}

if cf_space_name != "" && config.AddSpaceName {
e.Fields["cf_space_name"] = cf_space_name
if cfSpaceName != "" && config.AddSpaceName {
e.Fields["cf_space_name"] = cfSpaceName
}

if cf_org_id != "" && config.AddOrgGuid {
e.Fields["cf_org_id"] = cf_org_id
if cfOrgId != "" && config.AddOrgGuid {
e.Fields["cf_org_id"] = cfOrgId
}

if cf_org_name != "" && config.AddOrgName {
e.Fields["cf_org_name"] = cf_org_name
if cfOrgName != "" && config.AddOrgName {
e.Fields["cf_org_name"] = cfOrgName
}

if app_env["SPLUNK_INDEX"] != nil {
e.Fields["info_splunk_index"] = app_env["SPLUNK_INDEX"]
if appEnv["SPLUNK_INDEX"] != nil {
e.Fields["info_splunk_index"] = appEnv["SPLUNK_INDEX"]
}

if cf_ignored_app != false {
e.Fields["cf_ignored_app"] = cf_ignored_app
if cfIgnoredApp != false {
e.Fields["cf_ignored_app"] = cfIgnoredApp
}

}
Expand Down
1 change: 1 addition & 0 deletions monitoring/no_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func (nm *NoMonitor) RegisterCounter(id string, varType utils.CounterType) utils
return &utils.NopCounter{}
}
func (nm *NoMonitor) Start() {
// NoMonitor start - empty
}

func (nm *NoMonitor) Stop() error {
Expand Down
2 changes: 2 additions & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
sonar.projectKey=github-mirrors.splunk-firehose-nozzle
sonar.exclusions=vendor/**/*
sonar.test.inclusions=testing/**/*, **/*_test.go
sonar.c.file.suffixes=-
sonar.cpp.file.suffixes=-
sonar.objc.file.suffixes=-
3 changes: 2 additions & 1 deletion testing/integration/lib/runner.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from .helper import *
from .helper import get_integration_folder, get_project_folder
import subprocess
import time
import logging
import os

_env_var = os.environ
_env_path = get_project_folder()
Expand Down
3 changes: 2 additions & 1 deletion testing/integration/lib/update_env.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#! /usr/bin/env python

from .helper import *
from .helper import get_project_folder, get_config_folder
import time
import yaml
import json
import os
import configparser
from os.path import join

Expand Down
4 changes: 2 additions & 2 deletions testing/integration/testcases/test_nozzle_configurations.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from itertools import count
import pytest
from lib.json_assert import *
from lib.splunk_api import *
from lib.json_assert import assert_json_contains
from lib.splunk_api import SplunkApi
import json


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest
from lib.update_env import *
from lib.splunk_api import *
from lib.helper import get_project_folder, get_integration_folder
import string
import random
import subprocess
Expand Down
5 changes: 3 additions & 2 deletions testing/integration/testcases/test_nozzle_performance.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest
from lib.update_env import *
from lib.runner import *
from lib.update_env import update_data_gen_manifest, update_environment_variables, update_nozzle_manifest
from lib.runner import login_pcf,delete_data_gen, delete_pcf_org, nozzle_logger, deploy_date_gen_to_pcf, \
start_local_nozzle_binary, deploy_nozzle_to_pcf, wait_until_date_gen_done
import time


Expand Down
6 changes: 3 additions & 3 deletions tile/tile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ forms:
- name: selected_monitoring_metrics
type: multi_select_options
label: Metric types
default: ['nozzle.queue.percentage','splunk.events.dropped.count','splunk.events.sent.count','firehose.events.dropped.count','firehose.events.received.count','splunk.events.throughput','nozzle.usage.ram','nozzle.usage.cpu','nozzle.cache.memory.hit','nozzle.cache.memory.miss','nozzle.cache.remote.hit','nozzle.cache.remote.miss','nozzle.cache.boltdb.hit','nozzle.cache.boltdb.miss']
default: ['nozzle.queue.percentage', 'splunk.events.dropped.count', 'splunk.events.sent.count', 'firehose.events.dropped.count', 'firehose.events.received.count', 'splunk.events.throughput', 'nozzle.usage.ram', 'nozzle.usage.cpu', 'nozzle.cache.memory.hit', 'nozzle.cache.memory.miss', 'nozzle.cache.remote.hit', 'nozzle.cache.remote.miss', 'nozzle.cache.boltdb.hit', 'nozzle.cache.boltdb.miss']
options:
- name: nozzle.queue.percentage
label: nozzle.queue.percentage
Expand Down Expand Up @@ -238,7 +238,7 @@ forms:
label: Splunk Metric Index
description: Index where Metric Data will be indexed
optional: true

migration: |
if (typeof properties['properties']['.properties.add_app_info']['value'] == "boolean") {
if (properties['properties']['.properties.add_app_info']['value']==true) {
Expand All @@ -261,4 +261,4 @@ packages:
path: ../splunk-firehose-nozzle
command: ./splunk-firehose-nozzle
env:
GOPACKAGENAME: main
GOPACKAGENAME: main