Closed pnowy closed 5 years ago
Hi pnowy, I recommend to supply your own InstanceInfoMapper
on the Eureka server for this use case. I explicitly made this bean a @ConditionalOnMissingBean
, so one can easily use a custom implementation. This is also the way to go if you want to set service tags based on your node metadata.
Hi @tine2k, thanks for pointing this out!
I was just about filing a issue with the sample configuration, that could be easily improved to support this use case as well:
It is possible to relabel address like below, to use management.port instead of ServicePort for scraping.
- source_labels: [__meta_consul_address, __meta_consul_metadata_management_port]
separator: ':'
regex: (.*)
target_label: __address__
replacement: $1
action: replace
Note: management.port is provided by default for all services, which makes the above a safe default
Well, finally I've dropped this adapter and moved to k8s endpoints 👍
I think that in the situation when we have the different management port that default application port we should replace
ServicePort
to that management port in order scrape metrics correctly. We could assume that in this configuration the prometheus actuator entries will be exposed on the management port and this is appropriate instance port to scrape metrics from. What do you think about that?Example API response: