I was able to get it worked.

I've changed the following:

--> OLD not working (with FQDN):

eureka_sd_configs:
      - server: http://eureka.example.com:8761/eureka

--> NEW is working (with docker-container-name):

eureka_sd_configs:
      - server: http://eureka-node1:8761/eureka 
<http://eureka.example.com:8761/eureka>

On Friday, 6 November 2020 at 15:23:27 UTC+1 Marco Schmucki wrote:

> Hi all
>
> I've implemented the eureka_sd_configs:
>
> # my global config
> global:
>   scrape_interval:     60s # Default is every 1 minute.
>   evaluation_interval: 60s # The default is every 1 minute.
>
> # Alertmanager configuration
> alerting:
>   alertmanagers:
>   - static_configs:
>     - targets:
>       # - alertmanager:9093
>
> # Load rules once and periodically evaluate them according to the global 
> 'evaluation_interval'.
> rule_files:
>   # - "first_rules.yml"
>   # - "second_rules.yml"
>
> # A scrape configuration containing exactly one endpoint to scrape:
> # Here it's Prometheus itself.
> scrape_configs:
>   # The job name is added as a label `job=<job_name>` to any timeseries 
> scraped from this config.
>   - job_name: 'prometheus'
>     static_configs:
>     - targets: ['localhost:9090']
>   # eureka service discovery
>   - job_name: 'eureka'
>     metrics_path: '/actuator/prometheus'
>     eureka_sd_configs:
>       - server: http://eureka.example.com:8761/eureka
>
>
> The services  are shown under the register "target".
> But one service is not correct, because this service takes the default 
> "__meta_eureka_app_instance_port", but it should take the 
> "__meta_eureka_app_instance_metadata_management_port".
>
> I already tried to change it with the following without success (
> https://github.com/prometheus/prometheus/blob/release-2.22/documentation/examples/prometheus-eureka.yml
> ):
>
> 1. prometheus config:
>
> - source_labels: [__address__, 
> __meta_eureka_app_instance_metadata_prometheus_port]
>   action: replace
>   regex: ([^:]+)(?::\d+)?;(\d+)
>   replacement: $1:$2
>   target_label: __address__
>
>
> 2. service application properties:
>
> eureka.instance.metadataMap[prometheus.port]=9091  
>
>
> How can I change the port of one of the services?
>
> Many thanks for your feedback.
>
> Regards,
> Marco
>

-- 
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/9393bf36-9205-4889-919c-9c6879eef40an%40googlegroups.com.

Reply via email to