-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add information to README about "too many labels" and possible solutions #278
Comments
Since dropping labels in Prometheus seems to create new problems, I've added customizable label filtering on I am using the config file to define filters, i.e.: label_filters:
- metric: "^istio_(request|response|tcp).*"
allow:
- app
- destination_canonical_service
- instance
- job
- kubernetes_namespace
- kubernetes_pod_name
- response_code
- source_canonical_service |
Hello ! I'm facing the exact same issue ! Here are the steps to reproduce
so far so good, this is standard istio installation, with some dummy istio-sidecar metrics from the bookinfo services and a prometheus instance. The istio metrics are visible in prometheus, scraping is working as expected. Then the goal is to deploy the A service account for the sidecar is created, and the service account key exported as a kubernetes secret, e.g. $ gcloud iam service-accounts create prometheus-stackdriver --display-name prometheus-stackdriver-service-account
$ PROMETHEUS_STACKDRIVER_SA_EMAIL=$(gcloud iam service-accounts list --filter="displayName:prometheus-stackdriver-service-account" --format='value(email)')
$ gcloud projects add-iam-policy-binding ${PROJECT_ID} --role roles/monitoring.metricWriter --member serviceAccount:${PROMETHEUS_STACKDRIVER_SA_EMAIL}
$ gcloud iam service-accounts keys create prometheus-stackdriver-service-account.json --iam-account ${PROMETHEUS_STACKDRIVER_SA_EMAIL}
$ kubectl -n istio-system create secret generic prometheus-stackdriver-service-account --from-file=key.json=prometheus-stackdriver-service-account.json then, the following patch is applied to the prometheus (istio) deployment to add the # prometheus-patch.yaml
spec:
template:
spec:
volumes:
- name: google-cloud-key
secret:
secretName: prometheus-stackdriver-service-account
containers:
- name: sidecar
image: gcr.io/stackdriver-prometheus/stackdriver-prometheus-sidecar:0.8.2
imagePullPolicy: Always
args:
- "--stackdriver.project-id=XXX"
- "--prometheus.wal-directory=/data/wal"
- "--stackdriver.kubernetes.location=XXX"
- "--stackdriver.kubernetes.cluster-name=XXX"
- "--log.level=debug"
ports:
- name: sidecar
containerPort: 9091
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /var/secrets/google/key.json
volumeMounts:
- name: storage-volume
mountPath: /data
- name: google-cloud-key
mountPath: /var/secrets/google with e.g. $ kubectl -n istio-system patch deployment prometheus --type strategic --patch="$(cat prometheus-patch.yaml)" now looking at the logs of the
At this point, just like @7adietri, I'm looking at a light way to transform those istio metrics so that they can be pushed to cloud monitoring. Ideally, the solution should be easily maintainable. From the Quotas and limits page for custom metrics, it looks like the maximum number of labels is 10. |
I have had success in the past as a GCP customer that opening a support case asking for this PR to be reviewed and merged has helped get a response as I am currently running into this exact issue. Opening a support case now :) |
@7adietri, could you please be more specific about the issues you ran into with |
@igorpeshansky Ok, so this is a typical error message (only visible at
Definitely more than 10 labels. Lets start with removing all the metric_relabel_configs:
- regex: "^(source|destination)_.*"
action: labeldrop Looks good in the Prometheus UI:
But in the sidecar log, new error messages start appearing:
So already this isn't working with the sidecar, and I'm not even close to 10 labels. On the other hand, everything works perfectly fine when I switch to a sidecar image built from #283 and use the following metric_label_filters:
- metric: "^istio_(request|response|tcp).*"
allow:
- istio_canonical_name
- istio_canonical_revision
- reporter
- request_protocol
- response_code
- response_flags (The |
I've deployed the sidecar on a cluster with Istio/Knative, and some metrics aren't showing up in the Metrics Explorer. The sidecar log didn't reveal anything at first, only after turning on
debug
logging did I see a ton oftoo many labels
errors. (This in itself seems like a bug, or worthy of mentioning in the README.) According to the error messages, the problematic metrics have almost 40 labels, thanks to Istio/Knative.So I tried to configure Prometheus via
metric_relabel_configs
to drop some labels, but so far many labels cannot be removed without causingtarget not found
errors in the sidecar log (and metrics still not showing up). I'm not sure why i.e.security_istio_io_tlsMode
is a critical label to have.Do you have a suggested approach to reducing the amount of labels and keeping the sidecar happy?
The text was updated successfully, but these errors were encountered: