Apisix接入prometheus插件监控

作者: root007 分类: Linux 发布时间: 2022-10-17 16:24

修改配置文件

    plugin_attr:
          skywalking:
            service_name: APISIX_INGRESS
            service_instance_name: "APISIX Instance Name"
            endpoint_addr: http://skywalking.kube-ops.svc.cluster.local:12800
          prometheus:
            export_addr:
                 ip:  ${{HOSTNAME}}
                 port: 9092
接入prometheus
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: apisix
spec:
  endpoints:
   - scheme: http
     # [note] use the container port name exposed by the workload in the previous step
     port: metrics
     path: /apisix/prometheus/metrics
     interval: 15s
  namespaceSelector:
    matchNames:
      - apisix
  selector:
    matchLabels:
      app: apisix
apiVersion: v1
kind: Service
metadata:
  labels:
    app: apisix
  name: apisix-metrics
  namespace: apisix
spec:
  ports:
  - name: metrics
    port: 9092
    protocol: TCP
    targetPort: 9092
  selector:
    app.kubernetes.io/instance: apisix
    app.kubernetes.io/name: apisix
  se犀利士
ssionAffinity: None
  type: ClusterIP
kubectl  apply -f apisix_servicemonitor.yaml  -n prometheus

https://apisix.apache.org/zh/docs/apisix/2.15/plugins/prometheus/

一条评论
  • 晨汐网

    2022年12月30日 下午5:37

    博主你好,你的网站做得真好,可以跟你换个友链吗?

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注