Hi, so I added this section to match all namespaces:
```
kubernetes_sd_configs: 
 - role: endpoints kubeconfig_file: "" 
   follow_redirects: true 
   namespaces: 
     names: 
         - example1
         - example2
         - example3 
```
as well as 
```
authorization: 
     type: Bearer 
     credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token
```
I turned on debug logging, and i'm getting 
```
ts=2023-02-20T19:08:30.169Z caller=scrape.go:1292 level=debug 
component="scrape manager" scrape_pool=drop_response_metrics 
target=http://10.10.188.252:25672/metrics msg="Scrape failed" err="Get 
\"http://10.10.188.252:25672/metrics\": EOF"
ts=2023-02-20T19:08:30.465Z caller=scrape.go:1292 level=debug 
component="scrape manager" scrape_pool=drop_response_metrics 
target=http://10.10.152.96:10043/metrics msg="Scrape failed" err="server 
returned HTTP status 500 Internal Server Error"
ts=2023-02-20T19:08:30.510Z caller=scrape.go:1292 level=debug 
component="scrape manager" scrape_pool=drop_response_metrics 
target=http://10.10.241.97:9100/metrics msg="Scrape failed" err="server 
returned HTTP status 400 Bad Request"
```

The metrics are still not dropped
On Monday, February 20, 2023 at 7:14:23 AM UTC-8 Stuart Clark wrote:

> On 17/02/2023 22:02, Jihui Yang wrote:
>
> I'm using prometheus-operator's addionalScrapeConfigs 
> <https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/additional-scrape-config.md>
>  to 
> add metric drop rules. Example: 
>
> ```
> - job_name: drop_response_metrics 
>   honor_timestamps: true 
>   scrape_interval: 30s 
>   scrape_timeout: 10s 
>   metrics_path: /metrics 
>   scheme: http 
>   follow_redirects: true 
>   metric_relabel_configs: 
>   - source_labels: [__name__] 
>     separator: ; 
>     regex: 
> (response_total|response_latency_ms_count|response_latency_ms_sum) 
>     replacement: $1 
>     action: drop
> ```
>
> The config is successfully loaded to prometheus and I can view it in 
> `/config` endpoint. But for some reason I still can see the metrics. can 
> you let me know what to do?
>
> Is that the full config? I'm not seeing a Service Discovery section (e.g. 
> Kubernetes or file based) to tell Prometheus where to scrape from.
>
> -- 
> Stuart Clark
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/9b59f300-5446-42c2-bf31-cd964dab0c24n%40googlegroups.com.

Reply via email to