Ingress Monitoring
Tingyun supports monitoring for NGINX Ingress Controller, Apache APISIX Ingress Controller, and Kong Ingress Controller.
After the Agent is injected into the Ingress, the transaction name of requests passing through the Ingress can only be named according to the URL, and it does not support obtaining user source data.
Kubernetes UniAgent version 2.5.3.1 and above supports automatic JS Agent injection into html pages via the Ingress Agent, collecting Web frontend performance data.
To enable, go to "Real User Monitoring" -> "Web" -> "Application" page, click the "Add Application" button, enter the application name, select "APM Injection" as the injection method, select the backend application corresponding to the Ingress, and click enable.
In the following scenarios, JS Agent injection is not possible:
- Requests not initiated by browsers, such as requests initiated by tools like Curl, Wget, or HttpClient in upstream applications
- Upstream response Content-Encoding is gzip or other compressed formats
- Upstream response Content-Type is not text/html
- Response status code is not 200
- JS injection position exceeds 64K
NGINX Ingress Controller Monitoring
Compatibility Requirements
- Kubernetes UniAgent: Agent version 2.4.2.0 or above for AMD64, 2.5.0.0 or above for ARM64
- Kubernetes cluster version: 1.16~1.29
- ingress-nginx-controller version: v0.40.0 ~ v1.10.1
Injection Steps
Step 1: Label the ingress-nginx namespace
kubectl label namespace ingress-nginx tingyun-injection=enabled
Or edit the yaml for ingress-nginx: find the namespace named ingress-nginx, and add tingyun-injection: enabled under metadata.labels.
apiVersion: v1
kind: Namespace
metadata:
labels:
app.kubernetes.io/instance: ingress-nginx
app.kubernetes.io/name: ingress-nginx
tingyun-injection: enabled # Add this line
name: ingress-nginx
Step 2: Label the ingress-nginx-controller deployment
Edit the yaml for ingress-nginx: find the deployment named ingress-nginx-controller, and add tingyun-agent-injected: "true" and tingyun-ingress-nginx: "true" under spec.template.metadata.labels.
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/component: controller
app.kubernetes.io/instance: ingress-nginx
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
app.kubernetes.io/version: 1.8.0
name: ingress-nginx-controller
namespace: ingress-nginx
spec:
minReadySeconds: 0
revisionHistoryLimit: 10
selector:
matchLabels:
app.kubernetes.io/component: controller
app.kubernetes.io/instance: ingress-nginx
app.kubernetes.io/name: ingress-nginx
template:
metadata:
labels:
app.kubernetes.io/component: controller
app.kubernetes.io/instance: ingress-nginx
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
app.kubernetes.io/version: 1.8.0
tingyun-agent-injected: "true" # Add this line
tingyun-ingress-nginx: "true" # Add this line
spec:
containers:
- args:
- /nginx-ingress-controller
Step 3: Restart the ingress-nginx-controller Pod
kubectl apply -f ingress-nginx corresponding yaml
Validation
Access the Ingress and check whether the Tingyun Agent is injected. The describe output should include the Tingyun Agent image.
kubectl -n ingress-nginx describe pod ingress-nginx-controller-5b486bcc4b-bsgcw | grep tingyun
Enter ingress-nginx-controller:
kubectl -n ingress-nginx exec -it ingress-nginx-controller-5b486bcc4b-bsgcw -- bash
Run the following inside the ingress-nginx-controller Pod:
Check the process list, which should include the transagent process:
ps -ef
Check the initialization log:
cat /opt/tingyun-oneagent/logs/agent/ingress-init.log
Check the Agent logs:
cat /opt/tingyun-oneagent/logs/agent/nginx.log
cat /opt/tingyun-oneagent/logs/agent/daemon.log
Apache APISIX Ingress Controller Monitoring
Compatibility Requirements
- Kubernetes UniAgent: Agent version 2.4.2.0 or above for AMD64, 2.5.0.0 or above for ARM64
- Kubernetes cluster version: 1.16~1.29
- apisix-ingress-controller version: v1.0.0 - v1.8.2
Injection Steps
Step 1: Label the ingress-apisix namespace
kubectl label namespace ingress-apisix tingyun-injection=enabled
Step 2: Label the apisix deployment
kubectl -n ingress-apisix edit deployment.apps/apisix
Add tingyun-agent-injected: "true" under spec.template.metadata.labels.
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
meta.helm.sh/release-name: apisix
meta.helm.sh/release-namespace: ingress-apisix
labels:
app.kubernetes.io/name: apisix
helm.sh/chart: apisix-2.2.0
name: apisix
namespace: ingress-apisix
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/instance: apisix
app.kubernetes.io/name: apisix
template:
metadata:
labels:
app.kubernetes.io/instance: apisix
app.kubernetes.io/name: apisix
tingyun-agent-injected: "true" # Add this line
Validation
Access the Ingress and check whether the Tingyun Agent is injected. The describe output should include the Tingyun Agent image.
kubectl -n ingress-apisix describe pod apisix-556b6fddd8-hqnmc | grep tingyun
Enter apisix:
kubectl -n ingress-apisix exec -it apisix-556b6fddd8-hqnmc -- bash
Run the following inside the apisix Pod:
Check the Agent logs:
cat /opt/tingyun-oneagent/logs/agent/nginx.log
cat /opt/tingyun-oneagent/logs/agent/daemon.log
Kong Ingress Controller Monitoring
Compatibility Requirements
- Kubernetes UniAgent: Agent version 2.4.2.0 or above for AMD64, 2.5.0.0 or above for ARM64
- Kubernetes cluster version: 1.16~1.29
- Kong Ingress Controller version: v2.0.0 - v2.12.0
Injection Steps
Step 1: Label the kong namespace
kubectl label namespace kong tingyun-injection=enabled
Step 2: Label the ingress-kong deployment
kubectl -n kong edit deployment.apps/ingress-kong
Add tingyun-agent-injected: "true" under spec.template.metadata.labels.
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: ingress-kong
name: ingress-kong
namespace: kong
spec:
replicas: 1
selector:
matchLabels:
app: ingress-kong
template:
metadata:
annotations: