Service Integration with Sentinel Monitoring¶
This document describes how to integrate traditional microservices with the Sentinel monitoring feature.
-  
Add Dependencies
The version of the
sentinel metric exporterSDK needs to be >= v2.0.0-alpha.<dependency> <groupId>com.alibaba.csp</groupId> <artifactId>sentinel-metric-exporter</artifactId> <version>v2.0.0-alpha</version> </dependency>If you want to understand the reasons behind it, you can refer to: https://github.com/alibaba/Sentinel/pull/2976
 -  
When starting the service, add the
For detailed information about JMX, you can refer to Exposing JVM Monitoring Metrics using JMX Exporter.javaagentparameter and set the JMX port to12345. -  
Create a Kubernetes Service for your service. Pay attention to the following parameters:
-  
labelsfield: Set it toskoala.io/type: sentinel. -  
portsfield: Set it toname: jmx-metrics,port: 12345,targetPort: 12345. 
 -  
 
Note
If you want to understand the reasons behind it, you can refer to the definition of the ServiceMonitor CR.
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  labels:
    release: insight-agent
    operator.insight.io/managed-by: insight
  name: sentinel-service-monitor
spec:
  endpoints:
    - port: jmx-metrics
      scheme: http
  jobLabel: jobLabel
  namespaceSelector:
    any: true
  selector:
    matchLabels:
      skoala.io/type: sentinel