You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/01/09 11:47:58 UTC

[GitHub] [servicecomb-service-center] aseTo2016 opened a new pull request #617: add framework info in prometheus

aseTo2016 opened a new pull request #617: add framework info in prometheus
URL: https://github.com/apache/servicecomb-service-center/pull/617
 
 
   Follow this checklist to help us incorporate your contribution quickly and easily:
   
    - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it).  Trivial changes like typos do not require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.
    - [ ] Each commit in the pull request should have a meaningful subject line and body.
    - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue.
    - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    - [ ] Run `go build` `go test` `go fmt` `go vet` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
    - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-service-center] codecov-io commented on issue #617: add framework info in prometheus

Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #617: add framework info in prometheus
URL: https://github.com/apache/servicecomb-service-center/pull/617#issuecomment-572531646
 
 
   # [Codecov](https://codecov.io/gh/apache/servicecomb-service-center/pull/617?src=pr&el=h1) Report
   > Merging [#617](https://codecov.io/gh/apache/servicecomb-service-center/pull/617?src=pr&el=desc) into [master](https://codecov.io/gh/apache/servicecomb-service-center/commit/b491ff5328cbfb9e3ea1252be7e815a2e36a277f?src=pr&el=desc) will **decrease** coverage by `12.72%`.
   > The diff coverage is `64.85%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/graphs/tree.svg?width=650&token=GAaF7zrg8R&height=150&src=pr)](https://codecov.io/gh/apache/servicecomb-service-center/pull/617?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master     #617       +/-   ##
   ===========================================
   - Coverage   70.24%   57.52%   -12.73%     
   ===========================================
     Files          26      205      +179     
     Lines        3784    15796    +12012     
   ===========================================
   + Hits         2658     9086     +6428     
   - Misses        938     6062     +5124     
   - Partials      188      648      +460
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/servicecomb-service-center/pull/617?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [pkg/chain/chain.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/diff?src=pr&el=tree#diff-cGtnL2NoYWluL2NoYWluLmdv) | `100% <ø> (ø)` | |
   | [pkg/validate/rule.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/diff?src=pr&el=tree#diff-cGtnL3ZhbGlkYXRlL3J1bGUuZ28=) | `89.47% <ø> (ø)` | |
   | [pkg/backoff/backoff.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/diff?src=pr&el=tree#diff-cGtnL2JhY2tvZmYvYmFja29mZi5nbw==) | `100% <ø> (ø)` | |
   | [pkg/client/sc/websocket.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/diff?src=pr&el=tree#diff-cGtnL2NsaWVudC9zYy93ZWJzb2NrZXQuZ28=) | `0% <0%> (ø)` | |
   | [pkg/client/sc/watch.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/diff?src=pr&el=tree#diff-cGtnL2NsaWVudC9zYy93YXRjaC5nbw==) | `0% <0%> (ø)` | |
   | [pkg/client/sc/apis.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/diff?src=pr&el=tree#diff-cGtnL2NsaWVudC9zYy9hcGlzLmdv) | `0% <0%> (ø)` | |
   | [pkg/client/sc/schema.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/diff?src=pr&el=tree#diff-cGtnL2NsaWVudC9zYy9zY2hlbWEuZ28=) | `0% <0%> (ø)` | |
   | [pkg/client/sc/microservice.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/diff?src=pr&el=tree#diff-cGtnL2NsaWVudC9zYy9taWNyb3NlcnZpY2UuZ28=) | `0% <0%> (ø)` | |
   | [pkg/queue/uniqueue.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/diff?src=pr&el=tree#diff-cGtnL3F1ZXVlL3VuaXF1ZXVlLmdv) | `87.5% <0%> (ø)` | |
   | [pkg/client/sc/config.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/diff?src=pr&el=tree#diff-cGtnL2NsaWVudC9zYy9jb25maWcuZ28=) | `0% <0%> (ø)` | |
   | ... and [253 more](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/servicecomb-service-center/pull/617?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/servicecomb-service-center/pull/617?src=pr&el=footer). Last update [b491ff5...05fc51e](https://codecov.io/gh/apache/servicecomb-service-center/pull/617?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-service-center] codecov-io edited a comment on issue #617: add framework info in prometheus

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on issue #617: add framework info in prometheus
URL: https://github.com/apache/servicecomb-service-center/pull/617#issuecomment-572531646
 
 
   # [Codecov](https://codecov.io/gh/apache/servicecomb-service-center/pull/617?src=pr&el=h1) Report
   > :exclamation: No coverage uploaded for pull request base (`master@793e768`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
   > The diff coverage is `28.72%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/graphs/tree.svg?width=650&token=GAaF7zrg8R&height=150&src=pr)](https://codecov.io/gh/apache/servicecomb-service-center/pull/617?src=pr&el=tree)
   
   ```diff
   @@           Coverage Diff            @@
   ##             master    #617   +/-   ##
   ========================================
     Coverage          ?   57.3%           
   ========================================
     Files             ?     205           
     Lines             ?   15877           
     Branches          ?       0           
   ========================================
     Hits              ?    9099           
     Misses            ?    6127           
     Partials          ?     651
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/servicecomb-service-center/pull/617?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [server/service/event/instance\_event\_handler.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/diff?src=pr&el=tree#diff-c2VydmVyL3NlcnZpY2UvZXZlbnQvaW5zdGFuY2VfZXZlbnRfaGFuZGxlci5nbw==) | `5.79% <ø> (ø)` | |
   | [pkg/gopool/goroutines.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/diff?src=pr&el=tree#diff-cGtnL2dvcG9vbC9nb3JvdXRpbmVzLmdv) | `100% <ø> (ø)` | |
   | [...rver/service/event/schema\_summary\_event\_handler.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/diff?src=pr&el=tree#diff-c2VydmVyL3NlcnZpY2UvZXZlbnQvc2NoZW1hX3N1bW1hcnlfZXZlbnRfaGFuZGxlci5nbw==) | `25% <ø> (ø)` | |
   | [server/core/proto/types.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/diff?src=pr&el=tree#diff-c2VydmVyL2NvcmUvcHJvdG8vdHlwZXMuZ28=) | `0% <ø> (ø)` | |
   | [server/plugin/pkg/quota/counter/event.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/diff?src=pr&el=tree#diff-c2VydmVyL3BsdWdpbi9wa2cvcXVvdGEvY291bnRlci9ldmVudC5nbw==) | `69.04% <ø> (ø)` | |
   | [...ver/service/event/dependency\_rule\_event\_handler.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/diff?src=pr&el=tree#diff-c2VydmVyL3NlcnZpY2UvZXZlbnQvZGVwZW5kZW5jeV9ydWxlX2V2ZW50X2hhbmRsZXIuZ28=) | `100% <ø> (ø)` | |
   | [server/plugin/pkg/discovery/etcd/indexer\_cache.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/diff?src=pr&el=tree#diff-c2VydmVyL3BsdWdpbi9wa2cvZGlzY292ZXJ5L2V0Y2QvaW5kZXhlcl9jYWNoZS5nbw==) | `88.23% <ø> (ø)` | |
   | [server/service/event/service\_event\_handler.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/diff?src=pr&el=tree#diff-c2VydmVyL3NlcnZpY2UvZXZlbnQvc2VydmljZV9ldmVudF9oYW5kbGVyLmdv) | `11.76% <ø> (ø)` | |
   | [server/service/event/domain\_event\_handler.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/diff?src=pr&el=tree#diff-c2VydmVyL3NlcnZpY2UvZXZlbnQvZG9tYWluX2V2ZW50X2hhbmRsZXIuZ28=) | `36.36% <ø> (ø)` | |
   | [server/service/event/rule\_event\_handler.go](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/diff?src=pr&el=tree#diff-c2VydmVyL3NlcnZpY2UvZXZlbnQvcnVsZV9ldmVudF9oYW5kbGVyLmdv) | `8.16% <ø> (ø)` | |
   | ... and [10 more](https://codecov.io/gh/apache/servicecomb-service-center/pull/617/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/servicecomb-service-center/pull/617?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/servicecomb-service-center/pull/617?src=pr&el=footer). Last update [793e768...74b0318](https://codecov.io/gh/apache/servicecomb-service-center/pull/617?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-service-center] tianxiaoliang commented on a change in pull request #617: add framework info in prometheus

Posted by GitBox <gi...@apache.org>.
tianxiaoliang commented on a change in pull request #617: add framework info in prometheus
URL: https://github.com/apache/servicecomb-service-center/pull/617#discussion_r365510541
 
 

 ##########
 File path: server/service/event/instance_event_handler.go
 ##########
 @@ -44,14 +44,26 @@ func (h *InstanceEventHandler) OnEvent(evt discovery.KvEvent) {
 	providerId, providerInstanceId, domainProject := apt.GetInfoFromInstKV(evt.KV.Key)
 	idx := strings.Index(domainProject, "/")
 	domainName := domainProject[:idx]
+	projectName := domainProject[idx+1:]
+
+	var add float64 = 1
 	switch action {
 	case pb.EVT_INIT:
-		metrics.ReportInstances(domainName, 1)
+		metrics.ReportInstances(domainName, add)
+		ms := serviceUtil.GetServiceFromCache(domainProject, providerId)
+		if ms == nil {
+			log.Warnf("caught [%s] instance[%s/%s] event, endpoints %v, get cached provider's file failed",
+				action, providerId, providerInstanceId, instance.Endpoints)
+			return
+		}
+		frameworkName, frameworkVersion := getFramework(ms)
+		metrics.ReportFramework(domainName, projectName, frameworkName, frameworkVersion, add)
 		return
 	case pb.EVT_CREATE:
-		metrics.ReportInstances(domainName, 1)
 
 Review comment:
   这个magic number搞成const

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-service-center] coveralls commented on issue #617: add framework info in prometheus

Posted by GitBox <gi...@apache.org>.
coveralls commented on issue #617: add framework info in prometheus
URL: https://github.com/apache/servicecomb-service-center/pull/617#issuecomment-572531601
 
 
   
   [![Coverage Status](https://coveralls.io/builds/28002106/badge)](https://coveralls.io/builds/28002106)
   
   Coverage increased (+0.01%) to 59.95% when pulling **05fc51ea3d42c30141cfabf61ad1118277f6da3f on aseTo2016:master** into **fc3f5a0e7109ffb163fd01b1e4020559b07c9b2e on apache:master**.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-service-center] coveralls edited a comment on issue #617: add framework info in prometheus

Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on issue #617: add framework info in prometheus
URL: https://github.com/apache/servicecomb-service-center/pull/617#issuecomment-572531601
 
 
   
   [![Coverage Status](https://coveralls.io/builds/28044107/badge)](https://coveralls.io/builds/28044107)
   
   Coverage decreased (-0.1%) to 59.831% when pulling **74b0318030e353a5aa28390c9ace5f86e47fa4e5 on aseTo2016:master** into **d9eceb7e488f997b4e1b12975806d35e5329ad58 on apache:master**.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [servicecomb-service-center] tianxiaoliang merged pull request #617: add framework info in prometheus

Posted by GitBox <gi...@apache.org>.
tianxiaoliang merged pull request #617: add framework info in prometheus
URL: https://github.com/apache/servicecomb-service-center/pull/617
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services