Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose chaos controller metrics in helm chart #228

Merged
merged 3 commits into from Feb 13, 2020

Conversation

yeya24
Copy link
Contributor

@yeya24 yeya24 commented Feb 12, 2020

Signed-off-by: yeya24 yb532204897@gmail.com

What problem does this PR solve?

What is changed and how does it work?

This is a prerequisite of adding Prometheus to chaos-mesh. Exposing 8080 in chaos controller-manager enables Prometheus to get metrics from controller-manager.

Check List

Tests

  • Unit test
  • E2E test
  • Manual test (add detailed scripts or steps below)
  • No code

Code changes

  • Has Go code change
  • Has CI related scripts change
  • Has Terraform scripts change

Side effects

  • Breaking backward compatibility

Related changes

  • Need to update the documentation

Does this PR introduce a user-facing change?:

Change controller-manager default metrics port to 10080

Signed-off-by: yeya24 <yb532204897@gmail.com>
# targetPort: http
# protocol: TCP
# name: http
- port: 8080
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I remove the port var here since I think it is useless. We can just use a hardcode 8080 here

@codecov-io
Copy link

codecov-io commented Feb 12, 2020

Codecov Report

Merging #228 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #228   +/-   ##
=======================================
  Coverage   43.64%   43.64%           
=======================================
  Files          18       18           
  Lines         685      685           
=======================================
  Hits          299      299           
  Misses        353      353           
  Partials       33       33

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aaeb11b...336da1e. Read the comment docs.

@zhouqiang-cl zhouqiang-cl added this to Review in progress in Weekly Plan 2020-02-08 ~ 2020-02-15 Feb 13, 2020
containerPort: 9443 # Customize containerPort
- name: http
containerPort: 8080
Copy link
Member

Choose a reason for hiding this comment

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

Can we switch to an infrequently used port? eg: 20180

Copy link
Contributor Author

Choose a reason for hiding this comment

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

May I ask any difference between 8080 and 20180? Since we are not using hostport here and any access to controller-manager is via Service. So I think any port is okay. I am not sure if I miss something.

Copy link
Member

Choose a reason for hiding this comment

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

I think 8080 is used for common service and this port may be used by chaos-dashboard or the other services. At here, we just need to export our metric.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Metric is also an HTTP endpoint. And the default value is 8080 as well https://github.com/pingcap/chaos-mesh/blob/09afa9d7074b88bdb143e6f8bcbdd9e7b69c4b3c/cmd/controller-manager/main.go#L67. Do you think we need to change it?

Copy link
Member

Choose a reason for hiding this comment

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

I think we can change it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK. I will update them in this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated. Please take a look

Signed-off-by: yeya24 <yb532204897@gmail.com>
Copy link
Member

@cwen0 cwen0 left a comment

Choose a reason for hiding this comment

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

LGTM

Weekly Plan 2020-02-08 ~ 2020-02-15 automation moved this from Review in progress to Reviewer approved Feb 13, 2020
Copy link
Member

@YangKeao YangKeao left a comment

Choose a reason for hiding this comment

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

LGTM

@cwen0 cwen0 merged commit c281c88 into chaos-mesh:master Feb 13, 2020
Weekly Plan 2020-02-08 ~ 2020-02-15 automation moved this from Reviewer approved to Done Feb 13, 2020
@yeya24 yeya24 deleted the expose-controller branch February 13, 2020 03:45
sjwsl pushed a commit to sjwsl/chaos-mesh that referenced this pull request May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

6 participants