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

support metric namespace #232

Merged
merged 3 commits into from
Sep 28, 2022

Conversation

Nicholaswang
Copy link

Description

support metric namespace option in config

Pull request type

Please check the type of change your PR introduces:

  • Feature

Checklist

  • Linter passes correctly
  • Add tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary

Does this introduce a breaking change?

  • No

metrics.go Outdated
func getNamespace(cfg *config.Config) string {
namespace := ""
if cfg.EnableMetricNamespace {
namespace = "chproxy"
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO, this field can be configurable. This chproxy value can be the default. If someone needs to use a different value than the default, they will be able to set it in the config.

Copy link
Author

Choose a reason for hiding this comment

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

Actually, I agree with you. Would it be better to use another option MetricNamespace string?

Copy link
Author

@Nicholaswang Nicholaswang Sep 19, 2022

Choose a reason for hiding this comment

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

Or providing EnableMetricNamespace bool and MetricNamespace string together?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. I think so

Copy link
Author

Choose a reason for hiding this comment

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

To confirm:
1)providing EnableMetricNamespace bool and MetricNamespace string combined
2) providing MetricNamespace string only
Which option do you prefer? @sigua-cs

@Nicholaswang
Copy link
Author

adding Namespace string option in Server/Metrics struct

@sigua-cs
Copy link
Contributor

Hello @Nicholaswang , I reviewed the PR and tested it locally. Looks good.
One more thing I would ask you to add. Please add to the testdata config example, which includes the namespace entity.

@Nicholaswang
Copy link
Author

Hello @Nicholaswang , I reviewed the PR and tested it locally. Looks good. One more thing I would ask you to add. Please add to the testdata config example, which includes the namespace entity.

sure

@sigua-cs sigua-cs merged commit 2c10fb7 into ContentSquare:master Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants