【问题标题】:Do metrics published by the Jaeger Operator include those from the Collector and Query services too?Jaeger Operator 发布的指标是否也包括来自 Collector 和 Query 服务的指标?
【发布时间】:2020-11-27 16:17:00
【问题描述】:

我正在使用 Jaeger Operator 部署 Jaeger,它似乎工作正常。但是,现在我正在尝试设置 Prometheus 指标抓取(使用 Prometheus Operator),但在我的集群中没有看到 Service 公开 Jaeger 收集器(端口 14269)或查询服务(端口 16687)的指标端口) (port number reference from the Jeager Monitoring documentation)。

我看到的唯一相关的Servicejaeger-operator-metrics

$ kubectl get svc -A
NAME                            TYPE           CLUSTER-IP      EXTERNAL-IP      PORT(S)
simple-prod-collector           ClusterIP      10.43.20.131    <none>           9411/TCP,14250/TCP,14267/TCP,14268/TCP
simple-prod-query               ClusterIP      10.43.141.211   <none>           16686/TCP
simple-prod-collector-headless  ClusterIP      None            <none>           9411/TCP,14250/TCP,14267/TCP,14268/TCP
jaeger-operator-metrics         ClusterIP      10.43.90.169    <none>           8383/TCP,8686/TCP

我可以设置 Prometheus ServiceMonitor 来从该服务中抓取指标,但我不确定这是否包括通常由收集器和查询微服务收集的指标...我猜不是这似乎违反了微服务的前提。

我错过了 Jaeger Operator 规范中的某些设置以在其他组件中公开这些指标端点吗?

【问题讨论】:

    标签: prometheus prometheus-operator jaeger


    【解决方案1】:

    我想通了... Jaeger Operator 不会创建 Service 来公开指标端点。这些端点只是通过收集器和查询组件的 pod 公开。

    Collector pod 规范中的一个示例:

        ports:
        - containerPort: 9411
          name: zipkin
          protocol: TCP
        - containerPort: 14267
          name: c-tchan-trft
          protocol: TCP
        - containerPort: 14268
          name: c-binary-trft
          protocol: TCP
        - containerPort: 14269
          name: admin-http
          protocol: TCP
        - containerPort: 14250
          name: grpc
          protocol: TCP
    

    注意那里的admin-http 端口。

    所以为了让 Prometheus Operator 抓取这些指标,我创建了一个 PodMonitor,它涵盖了收集器和查询组件,因为它们都定义了 labels/app: jaegeradmin-http 端口:

    cat <<EOF | kubectl apply -f -
    apiVersion: monitoring.coreos.com/v1
    kind: PodMonitor
    metadata:
      name: jaeger-components
      namespace: monitoring
      labels:
        release: prometheus
    spec:
      podMetricsEndpoints:
      - path: /metrics
        port: admin-http
      namespaceSelector:
        matchNames:
        - monitoring
      selector:
        matchLabels:
            app: jaeger
    EOF
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-12-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-11
      • 2020-03-20
      相关资源
      最近更新 更多