{"id":16472140,"url":"https://github.com/yidinghan/eak","last_synced_at":"2025-09-09T19:26:06.566Z","repository":{"id":48028191,"uuid":"112264951","full_name":"yidinghan/eak","owner":"yidinghan","description":"elasticsearch apm-server kibana","archived":false,"fork":false,"pushed_at":"2021-08-10T20:44:46.000Z","size":623,"stargazers_count":34,"open_issues_count":2,"forks_count":20,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-03T18:21:41.374Z","etag":null,"topics":["apm-server","eak","elasticsearch","kibana"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yidinghan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-28T00:27:49.000Z","updated_at":"2024-07-11T11:12:50.000Z","dependencies_parsed_at":"2022-08-12T17:00:55.334Z","dependency_job_id":null,"html_url":"https://github.com/yidinghan/eak","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/yidinghan/eak","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yidinghan%2Feak","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yidinghan%2Feak/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yidinghan%2Feak/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yidinghan%2Feak/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yidinghan","download_url":"https://codeload.github.com/yidinghan/eak/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yidinghan%2Feak/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274348734,"owners_count":25268972,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-09T02:00:10.223Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apm-server","eak","elasticsearch","kibana"],"created_at":"2024-10-11T12:16:16.835Z","updated_at":"2025-09-09T19:26:06.537Z","avatar_url":"https://github.com/yidinghan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EAK\n\n- [EAK](#eak)\n- [Quick Run](#quick-run)\n- [Remarks](#remarks)\n- [Resources](#resources)\n- [Waterline](#waterline)\n  - [Example](#example)\n\nelasticsearch apm-server kibana\n\n# Quick Run\n\n```sh\nwget https://raw.githubusercontent.com/yidinghan/eak/master/docker-compose.yml\ndocker-compose up -d\n```\n\nGo to `localhost:5601`, or what your machine IP\n\nWait for kibana to be available, then you are ready to try apm\n\n# Remarks\n\n- Since v6.4, apm dashboard setup move to Kibana UI.\n\n  ![](https://github.com/yidinghan/eak/raw/master/images/apm-setup-instructions.jpg)\n  ![](https://github.com/yidinghan/eak/raw/master/images/load-kibana-objects.jpg)\n\n- with [apm-agent-nodejs:v1.1.0](https://github.com/elastic/apm-agent-nodejs/tree/v1.1.0)\n\n  - start method\n\n  ```js\n  // change from\n  require('elastic-apm-node/start');\n  // to\n  require('elastic-apm-node').start();\n  ```\n\n  - `elastic-apm-node.js` config change\n\n  ```js\n  // change from\n  appName: 'apm-reseach',\n  // to\n  serviceName: 'apm-reseach',\n  ```\n\n- with [docker.elastic.co/kibana/kibana:6.2.2](https://github.com/elastic/kibana/tree/6.2.2)\n\n  - New tab `APM` is ready to go\n\n  ![](http://om4h4iqhe.bkt.clouddn.com/kibana-apm-services.jpg)\n  ![](http://om4h4iqhe.bkt.clouddn.com/kibana-apm-service.jpg)\n  ![](http://om4h4iqhe.bkt.clouddn.com/kibana-apm-request.jpg)\n  ![](http://om4h4iqhe.bkt.clouddn.com/kibana-apm-pg-span.jpg)\n\n- with [playdingnow/elastic-apm-server:1.5.0](https://github.com/yidinghan/elastic-apm-server/tree/1.5.0)\n  - drop `Waterline` from dashboard temporary\n- with [docker.elastic.co/kibana/kibana:6.1.1](https://github.com/elastic/kibana/tree/6.1.1)\n\n  - A new tab named `APM` appears in the left sidebar\n\n  ![](http://om4h4iqhe.bkt.clouddn.com/kibana-tab-apm.jpg)\n\n- with [playdingnow/elastic-apm-server:1.4.3](https://github.com/yidinghan/elastic-apm-server/tree/1.4.3)\n\n  - The default `apm-dashboards.json` have been changed to customize [data](https://github.com/yidinghan/elastic-apm-server/blob/master/apm-dashboards.json)\n  - One more `visualization` chart name is [Waterline](#waterline)\n\n  ![](http://om4h4iqhe.bkt.clouddn.com/apm-waterline.jpg)\n\n- with [playdingnow/elastic-apm-server:v1.2](https://github.com/yidinghan/elastic-apm-server/tree/v1.2)\n  - The default secret_token have been changed from `''` to `xxVpmQB2HMzCL9PgBHVrnxjNXXw5J7bd79DFm6sjBJR5HPXDhcF8MSb3vv4bpg44`\n- with compose 2.2 feature, [healthcheck](https://docs.docker.com/compose/compose-file/compose-file-v2/#healthcheck)\n  - your may need to wait a while in the `up` stage\n  - because kibana depends on es\n  - apm-server depends on es and kibana\n- apm-server may exit before elasticsearch is ready\n  - exit status could be found by `docker-compose ps`\n  - once exit then you should restart it, like `docker-compose up -d`\n\n# Resources\n\n- docker elastic: https://www.docker.elastic.co/\n- elasticsearch\n\n  - image: `docker pull docker.elastic.co/elasticsearch/elasticsearch:6.5.1`\n  - github: https://github.com/elastic/elasticsearch\n  - docker: https://www.elastic.co/guide/en/elasticsearch/reference/6.0/docker.html\n  - vm.max_map_count: https://github.com/docker-library/elasticsearch/issues/111#issuecomment-268989731\n\n  ```shell\n  $ grep vm.max_map_count /etc/sysctl.conf\n  vm.max_map_count=262144\n\n  $ sysctl -w vm.max_map_count=262144\n  ```\n\n- apm-server\n  - image: `docker pull docker.elastic.co/apm/apm-server:6.5.1`\n  - github: https://github.com/elastic/apm-server\n  - docker: https://www.elastic.co/guide/en/apm/server/current/running-on-docker.html\n  - config: https://github.com/elastic/apm-server/blob/master/apm-server.reference.yml\n- kibana\n  - image: `docker pull docker.elastic.co/kibana/kibana:6.5.1`\n  - github: https://github.com/elastic/kibana\n  - docker: https://www.elastic.co/guide/en/kibana/6.0/docker.html\n- apm agent\n  - nodejs: https://www.elastic.co/guide/en/apm/agent/nodejs/current/intro.html\n    - agent api: https://www.elastic.co/guide/en/apm/agent/nodejs/current/agent-api.html\n    - github: https://github.com/elastic/apm-agent-nodejs\n\n# Waterline\n\nThe higher the waterline, the higher the service load, formula is as follows\n\n```js\nwaterline = sum([waterline_0, waterline_1, ..., waterline_n]) / count(duration)\n\nwaterline_x = count(duration, [border_x_start, border_x_end]) * a_x\n```\n\nWhere\n\n- duration is `transaction.duration.us`\n- border_x is interval border, like [0, 100] means from 0ms to 100ms\n- a_x is interval coefficient of border_x, like 1/2/100 or whatever you want\n\n## Example\n\n```js\nwaterline = ( count(duration, [0, 200]) * 1 + count(duration, [200, *]) * 2 ) / count(duration)\n```\n\nIn a point\n\n```js\n10 = count(duration, [0, 200])\n1 = count(duration, [200, *])\n```\n\nThen, in 3 decimal places precision\n\n```js\nwaterline = ( 10 * 1 + 1 * 2 ) / 11 = 1.091\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyidinghan%2Feak","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyidinghan%2Feak","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyidinghan%2Feak/lists"}