Skip to content

Conversation

@khanhtc1202
Copy link
Member

What this PR does / why we need it:

  • Add pipedID as label of piped's metrics
  • Replace Ping service with ReportStat service

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

NONE

Copy link
Collaborator

@pipecd-bot pipecd-bot left a comment

Choose a reason for hiding this comment

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

GO_LINTER

Some issues were detected while linting go source files in your changes.

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.24%. This pull request decreases coverage by -0.10%.

File Function Base Head Diff
pkg/app/api/grpcapi/piped_api.go PipedAPI.ReportStat -- 0.00% +0.00%
pkg/app/piped/statsreporter/reporter.go reporter.Run 0.00% 0.00% +0.00%
pkg/app/piped/statsreporter/reporter.go reporter.report 0.00% 0.00% +0.00%
pkg/app/piped/statsreporter/reporter.go reporter.collect 0.00% -- +-0.00%
pkg/app/piped/statsreporter/reporter.go parsePrometheusMetrics 95.45% -- -95.45%


// Ping is periodically sent to report its realtime status/stats to control-plane.
// The received stats will be pushed to the metrics collector.
// Note: This service is deprecated, use ReportStat instead.
Copy link
Member

Choose a reason for hiding this comment

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

nit: "This rpc"

// TODO: Add piped version as label.
prometheus.WrapRegistererWith(
prometheus.Labels{"piped": pipedID},
r,
Copy link
Member

Choose a reason for hiding this comment

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

Nice. One thing we have to update is fixing cli to use this wrapped register instead of the default one.
https://github.com/pipe-cd/pipe/blob/master/pkg/cli/cmd.go#L121

But that can be done in another PR.

Copy link
Member Author

@khanhtc1202 khanhtc1202 Jul 6, 2021

Choose a reason for hiding this comment

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

Nice catch, lets me address another missing in this PR 🙏
ref: 0eb829f

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.24%. This pull request decreases coverage by -0.10%.

File Function Base Head Diff
pkg/app/api/grpcapi/piped_api.go PipedAPI.ReportStat -- 0.00% +0.00%
pkg/app/piped/statsreporter/reporter.go reporter.Run 0.00% 0.00% +0.00%
pkg/app/piped/statsreporter/reporter.go reporter.report 0.00% 0.00% +0.00%
pkg/app/piped/statsreporter/reporter.go reporter.collect 0.00% -- +-0.00%
pkg/app/piped/statsreporter/reporter.go parsePrometheusMetrics 95.45% -- -95.45%

}

message ReportStatResponse {
int64 ping_interval = 1;
Copy link
Member

Choose a reason for hiding this comment

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

nit: report_interval

Copy link
Member Author

Choose a reason for hiding this comment

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

addressed by 2bb3bcb 🙏

@nghialv
Copy link
Member

nghialv commented Jul 6, 2021

Nice. I have just left a nit.
/lgtm

@pipecd-bot pipecd-bot added the lgtm label Jul 6, 2021
}

message ReportStatRequest {
bytes piped_stats = 1 [(validate.rules).bytes.min_len = 1];
Copy link
Member

Choose a reason for hiding this comment

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

Nice. For those who look at this first will be more likely to wonder why it's represented as a byte sequence. I feel like it should be commented like: "Metrics byte sequence in OpenMetrics format"

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 Lets me adopt your idea, thx 🙆‍♂️

Copy link
Member Author

Choose a reason for hiding this comment

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

addressed by 2bb3bcb 🙏

@pipecd-bot pipecd-bot removed the lgtm label Jul 6, 2021
@pipecd-bot
Copy link
Collaborator

TODO

The following ISSUES will be created once got merged. If you want me to skip creating the issue, you can use /todo skip command.

Details

1. Add piped version as label.

https://github.com/pipe-cd/pipe/blob/2bb3bcb399c6d2f09f3bc0b8417038270b8829b3/pkg/app/piped/cmd/piped/piped.go#L621-L624

This was created by todo plugin since "TODO:" was found in 2bb3bcb when #2181 was merged. cc: @khanhtc1202.

@nakabonne
Copy link
Member

/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by nakabonne.

Approvers can cancel the approval by writing /approve cancel in a comment. Any additional commits also will change this pull request to be not-approved.

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 32.24%. This pull request decreases coverage by -0.10%.

File Function Base Head Diff
pkg/app/api/grpcapi/piped_api.go PipedAPI.ReportStat -- 0.00% +0.00%
pkg/app/piped/statsreporter/reporter.go reporter.report 0.00% 0.00% +0.00%
pkg/app/piped/statsreporter/reporter.go reporter.Run 0.00% 0.00% +0.00%
pkg/app/piped/statsreporter/reporter.go reporter.collect 0.00% -- +-0.00%
pkg/app/piped/statsreporter/reporter.go parsePrometheusMetrics 95.45% -- -95.45%

@pipecd-bot pipecd-bot merged commit dfb10de into master Jul 6, 2021
@pipecd-bot pipecd-bot deleted the add-piped-label branch July 6, 2021 01:59
pipecd-bot pushed a commit that referenced this pull request Jul 6, 2021
**What this PR does / why we need it**:
- address #2181 (comment)
- fix #2182
- remove unnecessary validation in ReportStatRequest message. We should always allow the report stat to be push to the control-plane, the validation better is handled by control-plane.

**Which issue(s) this PR fixes**:

Fixes #2182 

**Does this PR introduce a user-facing change?**:
<!--
If no, just write "NONE" in the release-note block below.
-->
```release-note
NONE
```

This PR was merged by Kapetanios.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants