Skip to content

NimTechnology

Trình bày các công nghệ CLOUD một cách dễ hiểu.

  • Kubernetes & Container
    • Docker
    • Kubernetes
      • Ingress
      • Pod
    • Helm Chart
    • OAuth2 Proxy
    • Isito-EnvoyFilter
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Vault
    • Longhorn – Storage
    • VictoriaMetrics
    • MetalLB
    • Kong Gateway
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Argo Events
    • Spinnaker
    • Jenkins
    • Harbor
    • TeamCity
    • Git
      • Bitbucket
  • Coding
    • DevSecOps
    • Terraform
      • GCP – Google Cloud
      • AWS – Amazon Web Service
      • Azure Cloud
    • Golang
    • Laravel
    • Python
    • Jquery & JavaScript
    • Selenium
  • Log, Monitor & Tracing
    • DataDog
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
    • NextCloud
  • Toggle search form

[APM/Elastic] Install APM Elastic inside container WordPress.

Posted on March 17, 2022March 17, 2022 By nim No Comments on [APM/Elastic] Install APM Elastic inside container WordPress.

Hôm qua mình mới khám phá thêm thanh niên khá hay ho. Đó là APM trong họ hàng nhà Elastic
Elastic APM is an application performance monitoring system built on the Elastic Stack. It allows you to monitor software services and applications in real-time, by collecting detailed performance information on response time for incoming requests, database queries, calls to caches, external HTTP requests, and more.

Contents

Toggle
  • 1) Install APM Server
  • 2) Install APM Agent
  • 3) result

1) Install APM Server

Bạn có thể cài bất cứ con nào? Đại loại APM server sẽ nhận từ APM agent và gửi về cho elastic.

thường UI kibana hướng dẫn chúng ta cái luôn.
mkdir apm-server
cd apm-server/
wget https://artifacts.elastic.co/downloads/apm-server/apm-server-7.16.3-amd64.deb
dpkg -i apm-server-7.16.3-amd64.deb

Giờ sửa file config

vi /etc/apm-server/apm-server.yml

######################### APM Server Configuration #########################

################################ APM Server ################################

apm-server:
  # Defines the host and port the server is listening on. Use "unix:/path/to.sock" to listen on a unix domain socket.
  host: "192.168.101.24:8200"

  # Configure authorization via a common `secret_token`. By default it is disabled.
  # Agents include the token in the following format: Authorization: Bearer <secret-token>.
  # It is recommended to use an authorization token in combination with SSL enabled,
  # and save the token in the apm-server keystore.
  #
  # WARNING: This configuration is deprecated and replaced with `apm-server.auth.secret_token`, and will be removed
  # in the 8.0 release. If that config is defined, this one will be ignored.
  #secret_token:
  secret_token: "<input password>"
#-------------------------- Elasticsearch output --------------------------
output.elasticsearch:
  # Array of hosts to connect to.
  # Scheme and port can be left out and will be set to the default (`http` and `9200`).
  # In case you specify and additional path, the scheme is required: `http://localhost:9200/path`.
  # IPv6 addresses should always be defined as: `https://[2001:db8::1]:9200`.
  hosts: ["192.168.101.24:9200"]

Giờ thực hiện restart và kiểm tra

systemctl restart apm-server
systemctl enable apm-server
systemctl status apm-server
Nếu response như hình là ok

2) Install APM Agent

Bạn sẽ cần exec vào container workpress nhé

docker exec -it wordpress_wordpress_1 bash
cd /var/www/html/
apt install wget -y
wget https://github.com/elastic/apm-agent-php/releases/download/v1.4.2/apm-agent-php_1.4.2_all.deb
dpkg -i apm-agent-php_1.4.2_all.deb 
ls -ll /usr/local/etc/php/conf.d

giờ sửa file 99-elastic-apm-custom.ini

Last login: Wed Mar 16 00:21:25 2022 from 192.168.101.37
root@docker-center-u20:~# docker exec -it wordpress_wordpress_1 bash
root@7d2d8c677ede:/var/www/html# cat /usr/local/etc/php/conf.d/99-elastic-apm-custom.ini 
; This file contains the various settings for the Elastic APM PHP agent. For
; further details refers to the following URL:
; https://www.elastic.co/guide/en/apm/agent/php/current/configuration-reference.html
;

[elastic]
elastic_apm.enabled = true
;elastic_apm.api_key = "REPLACE_WITH_API_KEY"
elastic_apm.environment = "production"
elastic_apm.log_level = "INFO"
elastic_apm.log_level_stderr = "INFO"
elastic_apm.secret_token = "<input password>"
;elastic_apm.server_timeout = "30s"
elastic_apm.server_url = "http://192.168.101.24:8200"
elastic_apm.service_name = "nimtechnology"
;elastic_apm.service_version = "REPLACE_WITH_OUTPUT_FROM_git rev-parse HEAD"
;elastic_apm.transaction_max_spans = 500
;elastic_apm.transaction_sample_rate = 

Bạn save lại và restart container nhé!

3) result

giờ quay trở lại APM sẽ thể có suất hiện thông tin APM gent

Bạn có thể biết được Latency, Throughput, Transactions,…

ELK

Post navigation

Previous Post: [Golang] Checking a string inside or in another string by Golang
Next Post: [Cilium/Hubble] Research together and install cilium instead of using kube-proxy and other CNI providers.

More Related Articles

[Logstash] Multi config, input, filter, output inside a Logstash server and Not conflict ELK
[Kibana-ELK] Installing and Seting a Kibana For ELK ELK
[Kibana] Tutorial export and import much data(dashboard,…) in Kibana – ELK ELK
[logstash/kibana] Draw a Map on Kibana by data from Logstash – Fix “Index pattern does not contain any geospatial fields” ELK
[error] Solve elasticsearch error Limit of total fields [1000] in index [xxx] ELK
[Elastic] Install Elasticsearch through package manager. ELK

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tham Gia Group DevOps nhé!
Để Nim có nhiều động lực ra nhiều bài viết.
Để nhận được những thông báo mới nhất.

Recent Posts

  • [Azure] The subscription is not registered to use namespace ‘Microsoft.ContainerService’ May 8, 2025
  • [Azure] Insufficient regional vcpu quota left May 8, 2025
  • [WordPress] How to add a Dynamic watermark on WordPress. May 6, 2025
  • [vnet/Azure] VNet provisioning via Terraform. April 28, 2025
  • [tracetcp] How to perform a tracert command using a specific port. April 3, 2025

Archives

  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021

Categories

  • BareMetal
    • NextCloud
  • CI/CD
    • Argo Events
    • ArgoCD
    • ArgoWorkflows
    • Git
      • Bitbucket
    • Harbor
    • Jenkins
    • Spinnaker
    • TeamCity
  • Coding
    • DevSecOps
    • Golang
    • Jquery & JavaScript
    • Laravel
    • NextJS 14 & ReactJS & Type Script
    • Python
    • Selenium
    • Terraform
      • AWS – Amazon Web Service
      • Azure Cloud
      • GCP – Google Cloud
  • Kubernetes & Container
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Docker
    • Helm Chart
    • Isito-EnvoyFilter
    • Kong Gateway
    • Kubernetes
      • Ingress
      • Pod
    • Longhorn – Storage
    • MetalLB
    • OAuth2 Proxy
    • Vault
    • VictoriaMetrics
  • Log, Monitor & Tracing
    • DataDog
    • ELK
      • Kibana
      • Logstash
    • Fluent
    • Grafana
    • Prometheus
  • Uncategorized
  • Admin

Copyright © 2025 NimTechnology.