Skip to content

msg="target not found" for standard kube-state-metrics #279

Open
@forestoden

Description

@forestoden

I am trying to set up the stackdriver-prometheus-sidecar to push a few CronJob/Job metrics from kube-state-metrics to Stackdriver. I'm running into an issue where no matter what I do, all of the metrics report

level=debug ts=2021-04-06T22:10:39.947Z caller=series_cache.go:369 component="Prometheus reader" msg="target not found" labels="{__name__=\"kube_cronjob_next_schedule_time\",container=\"kube-state-metrics\",cronjob=\"cronjob\",endpoint=\"http\",instance=\"10.8.6.2:8080\",job=\"kube-state-metrics\",namespace=\"production\",pod=\"kube-prometheus-stack-kube-state-metrics-bbf56d7f5-dss8c\",service=\"kube-prometheus-stack-kube-state-metrics\"}"

Here is my config for the sidecar:

  - args:
    - --stackdriver.project-id=<project>
    - --prometheus.wal-directory=/prometheus/wal
    - --stackdriver.kubernetes.location=us-central1
    - --stackdriver.kubernetes.cluster-name=<cluster>
    - --include=kube_cronjob_next_schedule_time{namespace="production"}
    - --log.level=debug
    image: gcr.io/stackdriver-prometheus/stackdriver-prometheus-sidecar:0.8.2

I am using the Prometheus operator, with Prometheus version 2.18. I tried a couple different versions (up to 2.22) with no luck.

I am not seeing any metrics get to Stackdriver, I've tried adding --stackdriver.store-in-files-directory=/prometheus/sd and see a file get created but nothing is written to it, so it doesn't seem like a permissions issue there.

For the --include flag, I've tried a number of different ways with no luck.

I found #104 which highlights a similar log message but I think that use case is a bit more complex than this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions