zking2000 / NotePad

1 stars 0 forks source link

java #76

Closed zking2000 closed 1 month ago

zking2000 commented 2 months ago
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: gateway-java17
spec:
  replicas: 1
  selector:
    matchLabels:
      app: gateway-java17
  template:
    metadata:
      labels:
        app: gateway-java17
    spec:
      containers:
      - name: gateway-java17
        image: [YOUR_GATEWAY_IMAGE]
        ports:
        - containerPort: 8080
        env:
        - name: USER_SERVICE_URL
          value: "http://user-service-java17:8081"
---
apiVersion: v1
kind: Service
metadata:
  name: gateway-service-java17
spec:
  selector:
    app: gateway-java17
  ports:
    - protocol: TCP
      port: 80
      targetPort: 8080
  type: LoadBalancer
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: user-java17
spec:
  replicas: 1
  selector:
    matchLabels:
      app: user-java17
  template:
    metadata:
      labels:
        app: user-java17
    spec:
      containers:
      - name: user-java17
        image: [YOUR_USER_IMAGE]
        ports:
        - containerPort: 8081
        env:
        - name: SPRING_DATASOURCE_URL
          value: "jdbc:postgresql:///otel_db?cloudSqlInstance=airflow-sql-da167303&socketFactory=com.google.cloud.sql.postgres.SocketFactory&user=cap-pft-uk-grafana-sa@hsbc-10614851-apigwppt-dev.iam"
        - name: SPRING_DATASOURCE_DRIVER_CLASS_NAME
          value: "org.postgresql.Driver"
---
apiVersion: v1
kind: Service
metadata:
  name: user-service-java17
spec:
  selector:
    app: user-java17
  ports:
    - protocol: TCP
      port: 8081
      targetPort: 8081
zking2000 commented 1 month ago
# 请求总数
curl -X POST http://localhost:8080/actuator/prometheus/counter -H "Content-Type: text/plain" -d 'requests_total 1'

# 错误总数
curl -X POST http://localhost:8080/actuator/prometheus/counter -H "Content-Type: text/plain" -d 'errors_total 1'

# 重试总数
curl -X POST http://localhost:8080/actuator/prometheus/counter -H "Content-Type: text/plain" -d 'retries_total 1'

# 跟踪调用总数
curl -X POST http://localhost:8080/actuator/prometheus/counter -H "Content-Type: text/plain" -d 'traces_spanmetrics_calls_total 1'

# 服务图请求总数
curl -X POST http://localhost:8080/actuator/prometheus/counter -H "Content-Type: text/plain" -d 'traces_service_graph_request_total 1'

# 服务图请求失败总数
curl -X POST http://localhost:8080/actuator/prometheus/counter -H "Content-Type: text/plain" -d 'traces_service_graph_request_failed_total 1'

# 服务图未配对跨度总数
curl -X POST http://localhost:8080/actuator/prometheus/counter -H "Content-Type: text/plain" -d 'traces_service_graph_unpaired_spans_total 1'

# 服务图丢弃跨度总数
curl -X POST http://localhost:8080/actuator/prometheus/counter -H "Content-Type: text/plain" -d 'traces_service_graph_dropped_spans_total 1'
zking2000 commented 1 month ago
curl -X POST 'http://localhost:8080/actuator/dynamicmetrics/my_counter?type=counter'