Skip to content

Commit

Permalink
added compression to elasticsearch
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin committed Jan 10, 2020
1 parent 1ec60c0 commit 620c504
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
7 changes: 4 additions & 3 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,25 @@
}
},
"efk": {
"host": "dev1-fluentd.mojaloop.live",
"host": "perf1-fluentd.mojaloop.live",
"port": 24224,
"timeout": 3.0,
"reconnectInterval": 600,
"requireAckResponse": true,
"namespace": "logstash"
},
"EFK_CLIENT": {
"host": "dev1-elasticsearch.mojaloop.live",
"host": "perf1-elasticsearch.mojaloop.live",
"log": "error",
"compression": "gzip",
"index": {
"name": "mojaloop",
"template": "{{index}}-{{date}}"
}
},
"APM": {
"serviceName": "event-stream-processor",
"serverUrl": "http://dev1-apm.mojaloop.live:80",
"serverUrl": "http://perf1-apm.mojaloop.live:80",
"captureErrorLogStackTraces": "never"
},
"PORT": 3082,
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mojaloop/event-stream-processor",
"version": "8.7.7-snapshot",
"version": "8.8.0-snapshot",
"description": "event stream processor to monitor kafka event topic and create traces and store logs to efk stack with APM",
"main": "app.js",
"scripts": {
Expand Down
6 changes: 2 additions & 4 deletions src/lib/efk/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ const ElasticSearchClient = (() => {
let currentDate
const createInstance = async () => {
try {
const client = new elasticsearch.Client({
host: Config.EFK_CLIENT.host,
log: Config.EFK_CLIENT.log
})
const { host, log, compression } = Config.EFK_CLIENT
const client = new elasticsearch.Client({ host, log, compression })
const resultPing = await client.ping({
// ping usually has a 3000ms timeout
requestTimeout: 1000
Expand Down
1 change: 1 addition & 0 deletions src/observables/apmTracerObservable.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const updateTraceToCache = async (key, trace) => {
}

const extractContextObservable = ({ message }) => {
console.log(Date.now().toLocaleString())
return Rx.Observable.create(observable => {
try {
Logger.debug(`Received event message :: Payload: \n${JSON.stringify(message.value, null, 2)}`)
Expand Down
1 change: 0 additions & 1 deletion src/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ const setup = async () => {
completed: () => Logger.debug('elastic API log completed')
})
})

const tracingObservable = sharedMessageObservable.pipe(
filter(props => props.message.value.metadata.event.type === 'trace'),
flatMap(Observables.TraceObservable.extractContextObservable),
Expand Down

0 comments on commit 620c504

Please sign in to comment.