0

我的应用程序中有一个千分尺 + 弹簧执行器,它在 kibana 中以这种方式显示:

"name": "jvm_threads_daemon",
    "type": "gauge",
    "cluster": "cluster_app",
    "kubernetes_namespace": "test",
    "kubernetes_pod_name": "fargate-ip-10-121-31-148.ec2.internal",
    "value": 18

但我想转换成这个:

"jvm_threads_daemon": "18",
    "type": "gauge",
    "cluster": "cluster_app",
    "kubernetes_namespace": "test",
    "kubernetes_pod_name": "fargate-ip-10-121-31-148.ec2.internal",
    "value": 18

因此,请注意,我需要将指标作为标签名称,而不是在“名称”中。这可以用微米吗?

查看我的 application.yml:

management:
  endpoints:
    web:
      exposure:
        include: "*"
      base-path: /actuator
      path-mapping.health: health
  endpoint:
    health:
      probes:
        enabled: true
      show-details: always
  metrics:
    export:
      elastic:
        host: "https://elastico.url:443"
        index: "metricbeat-k8s-apps"
        user-name: "elastic"
        password: "xxxx"
        step: 30s
        connect-timeout: 10s
    tags:
      cluster: "cluster_app"
      kubernetes.pod.name: ${NODE_NAME}
      kubernetes.namespace: ${POD_NAMESPACE}
4

1 回答 1

1

您可以扩展/实现自己的ElasticMeterRegistry并定义自己的格式

不过要考虑的一件事:如果您进行了您想要的更改,您将如何在 Kibana 中查询/过滤/聚合指标?

于 2021-04-20T17:33:08.217 回答