Skip to content

Conversation

@wxbty
Copy link
Member

@wxbty wxbty commented May 6, 2023

What is the purpose of the change

micrometer provides a default global CompositeMeterRegistry, generally, dubbo can use it directly. Considering the isolation of multiple applications, provide configuration options and use a separate Registry for dubbo

Brief changelog

Use CompositeMeterRegistry according to the following priority

  1. If useGlobalRegistry is configured, use the micrometer global CompositeMeterRegistry
  2. If there is a spring actuator, use spring's CompositeMeterRegistry
  3. Dubbo's own CompositeMeterRegistry is used by default

@codecov-commenter
Copy link

codecov-commenter commented May 6, 2023

Codecov Report

Merging #12238 (5340d73) into 3.2 (808bc96) will decrease coverage by 0.32%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##                3.2   #12238      +/-   ##
============================================
- Coverage     69.69%   69.37%   -0.32%     
+ Complexity      317        2     -315     
============================================
  Files          3430     1604    -1826     
  Lines        161233    66192   -95041     
  Branches      26990     9712   -17278     
============================================
- Hits         112372    45923   -66449     
+ Misses        39025    15828   -23197     
+ Partials       9836     4441    -5395     

see 1858 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@songxiaosheng songxiaosheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

稍等 我看下dubbo指标同步springboot那里 用全局的时候 如果springboot端点中的指标也是全局的会不会有啥冲突

@wxbty
Copy link
Member Author

wxbty commented May 7, 2023

稍等 我看下dubbo指标同步springboot那里 用全局的时候 如果springboot端点中的指标也是全局的会不会有啥冲突

看springboot actuator源码,是new的一个,在CompositeMeterRegistryConfiguration类

@Bean
@Primary
CompositeMeterRegistry compositeMeterRegistry(Clock clock, List<MeterRegistry> registries) {
    return new CompositeMeterRegistry(clock, registries);
}

@songxiaosheng
Copy link
Member

可以,那现在一共有三个micrometer,spring,dubbo dubbo可以复用micrometer的 现在是定时任务同步dubbo数据到spring 如果有配置能复用spring的我们就可以把那个定时任务去掉了

@AlbumenJ
Copy link
Member

It would be better to add scope model id to prometheus tag to prevent data conflict.

@AlbumenJ
Copy link
Member

image

@wxbty
Copy link
Member Author

wxbty commented May 10, 2023

It would be better to add scope model id to prometheus tag to prevent data conflict.

Optimized by #12288

@wxbty
Copy link
Member Author

wxbty commented May 10, 2023

可以,那现在一共有三个micrometer,spring,dubbo dubbo可以复用micrometer的 现在是定时任务同步dubbo数据到spring 如果有配置能复用spring的我们就可以把那个定时任务去掉了

ok

@wxbty wxbty requested a review from songxiaosheng May 11, 2023 11:38
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Copy link
Member

@songxiaosheng songxiaosheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@songxiaosheng songxiaosheng merged commit 865e683 into apache:3.2 May 16, 2023
@wxbty wxbty deleted the metrics_option branch May 16, 2023 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants