yace 在 grafana 中不显示任何数据

Posted

技术标签:

【中文标题】yace 在 grafana 中不显示任何数据【英文标题】:yace doesn't show any data in grafana 【发布时间】:2021-09-21 12:43:02 【问题描述】:

我在 Grafana 中有一个仪表板,它显示了 6 个月前来自 yace cloudwatch 导出器的数据,现在它没有显示任何数据,尽管我可以通过端口转发正确地看到 prometheus 的 mertics。你有什么线索吗? (特别适用于 s3 指标)。

Yace 配置如下:

    - type: s3
      regions:
        - eu-central-1
      addCloudwatchTimestamp: false
      period: 172800
      length: 259200
      metrics:
        - name: NumberOfObjects
          statistics:
            - Maximum
          additionalDimensions:
            - name: StorageType
              value: AllStorageTypes
        - name: BucketSizeBytes
          statistics:
            - Sum
          additionalDimensions:
            - name: StorageType
              value: StandardStorage
        - name: BytesUploaded
          statistics:
            - Average
          period: 60
          length: 300
          additionalDimensions:
            - name: FilterId
              value: EntireBucket

yacl pod的部署如下:


apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/name: alt-cloudwatch-exporter
    app.kubernetes.io/version: v0.26.3-alpha
    app.kubernetes.io/part-of: prometheus
  name: alt-cloudwatch-exporter
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: alt-cloudwatch-exporter
  template:
    metadata:
      annotations:
        #iam.amazonaws.com/role: "arn:aws:iam::%%AWS_ACCOUNT_NUMBER%%:role/k8s/pod/id_CloudWatchMetricsExportAccess"
      labels:
        app.kubernetes.io/name: alt-cloudwatch-exporter
        app.kubernetes.io/version: v0.26.3-alpha
        app.kubernetes.io/part-of: prometheus
    spec:
      containers:
        - name: alt-cloudwatch-exporter
          image: quay.io/invisionag/yet-another-cloudwatch-exporter:v0.26.3-alpha
          imagePullPolicy: IfNotPresent
          args:
            - "--config.file=/cfg/yace-config.yaml"
          env:
            - name: gateway
              value: prometheus-pushgateway.monitor-system:9091
          ports:
            - containerPort: 5000
              protocol: TCP
          volumeMounts:
            - name: config-volume
              mountPath: /cfg
      volumes:
        - name: config-volume
          configMap:
            name: alt-cloudwatch-exporter-config

---
apiVersion: v1
kind: Service
metadata:
  labels:
    app.kubernetes.io/name: alt-cloudwatch-exporter
    app.kubernetes.io/version: v0.26.3-alpha
    app.kubernetes.io/part-of: prometheus
  name: alt-cloudwatch-exporter
spec:
  type: ClusterIP
  ports:
    - name: metrics
      protocol: TCP
      targetPort: 5000
      port: 9144
  selector:
    app.kubernetes.io/name: alt-cloudwatch-exporter

---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  labels:
    app.kubernetes.io/name: alt-cloudwatch-exporter
    app.kubernetes.io/version: v0.26.3-alpha
    app.kubernetes.io/part-of: prometheus
  name: alt-cloudwatch-exporter
spec:
  endpoints:
    - port: metrics
      interval: 60s
  selector:
    matchLabels:
      app.kubernetes.io/name: alt-cloudwatch-exporter

【问题讨论】:

【参考方案1】:

如果您使用 prometheus 运算符,则需要使用中间脚本 pod 处理数据,否则它们将无法消化。 YACE 以 aws_yace 的形式创建指标标签,因此除非您的应用被明确称为 yace,否则您将看不到任何内容

【讨论】:

以上是关于yace 在 grafana 中不显示任何数据的主要内容,如果未能解决你的问题,请参考以下文章

当变量过滤器设置为“全部”时,Grafana 不显示任何数据点

Grafana:警报查询中不支持模板变量

时间范围面板在 Grafana 中不可用

如何在显示仪表板时在 Grafana 门户上启用 url 加密

如何在 Prometheus/Grafana 中不指定标签的情况下通过唯一标签计算指标数量?

如何在Grafana中查询Elasticsearch