Skip to content
This repository was archived by the owner on Dec 14, 2022. It is now read-only.

Commit 497223b

Browse files
author
Chris Wiechmann
authored
Merge pull request #153 from Axway-API-Management-Plus/apibuilder-apm
Adds APM Support for API-Builder
2 parents 3447eec + f495abb commit 497223b

20 files changed

+1505
-81
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77
## [Unreleased]
88
### Added
99
- API-Management KPIs incl. dashboard [#64](https://github.com/Axway-API-Management-Plus/apigateway-openlogging-elk/issues/64)
10+
- Added support to enable an APM-Service or use an external APM-Server with API-Builder [#149](https://github.com/Axway-API-Management-Plus/apigateway-openlogging-elk/issues/149)
1011

1112
### Changed
1213
- Helm Default-Values for Kibana Memory-Limits changed from 300MB to 500MB (Request) and 300MB to 750MB (Limit)
@@ -16,7 +17,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1617
- Updated Elastic-Stack from version 7.14.0 to 7.15.2
1718

1819
### Fixed
19-
- Error initializing cluster when having multiple ELASTICSEARCH_HOSTS configured [#150](https://github.com/Axway-API-Management-Plus/apigateway-openlogging-elk/issues/150)
20+
- Error initializing cluster when already multiple ELASTICSEARCH_HOSTS configured [#150](https://github.com/Axway-API-Management-Plus/apigateway-openlogging-elk/issues/150)
2021
- Filebeat ignored most recent OpenTraffic file due to a wrong filename pattern (*_traffic_*.log --> *_traffic*.log)
2122
- Default for optional parameter: `FILEBEAT_COMPRESSION_LEVEL` was not working as expected
2223

DEVELOPMENT.MD

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ instances:
8080
- "*.ec2.internal"
8181
- "*.compute-1.amazonaws.com"
8282
- "*.cloudapp.azure.com"
83+
- name: "apm-server"
84+
dns:
85+
- "apm-server"
86+
- "localhost"
87+
- "api-env"
88+
- "*.ec2.internal"
89+
- "*.compute-1.amazonaws.com"
90+
- "*.cloudapp.azure.com"
8391
```
8492
8593
Run elasticsearch-certutil:

apibuilder4elastic/app.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
const APIBuilder = require('@axway/api-builder-runtime');
2+
3+
if(process.env.APM_ENABLED) {
4+
console.log(`Application performance monitoring enabled. Using APM-Server: ${process.env.APM_SERVER || 'https://apm-server:8200'}`);
5+
require('elastic-apm-node').start({
6+
serviceName: 'APIBuilder4Elastic',
7+
serverUrl: process.env.APM_SERVER || 'https://apm-server:8200',
8+
verifyServerCert: ("false" == process.env.APM_VALIDATE_SERVER_CERT) ? false : true,
9+
serverCaCertFile: process.env.APM_SERVER_CA || 'config/certificates/ca.crt'
10+
});
11+
}
12+
213
const server = new APIBuilder();
314

415
// lifecycle examples

0 commit comments

Comments
 (0)