Skip to content

Conversation

@low-on-mana
Copy link
Contributor

@low-on-mana low-on-mana commented Feb 3, 2022

…rics

Tips

What is the purpose of the pull request

As of now all metrics created by hudi has table name prefixed by default. This pr aims to put that behavior behind a configuration and allows the user to disable it.

For example lets say we have 2 hudi tables customers and loan_accounts. Right now the metrics in prometheus will come like this

customers_TimelineService_TOTAL_HANDLE_TIME{job="customers"} 589
loan_accounts_TimelineService_TOTAL_HANDLE_TIME{job="loan_accounts"} 642

Its conventional in prometheus to have consistent metric name with differences in labels. After the changes in this pr, metrics will come like this which is much simpler to plot across lets say 100s of hudi tables with each having 100s of metrics.

TimelineService_TOTAL_HANDLE_TIME{job="customers"} 589
TimelineService_TOTAL_HANDLE_TIME{job="loan_accounts"} 642

Brief change log

Added configuration hoodie.metrics.common_prefix.enable
This configuration is true by default and which doesnt change any behavior for existing users.

Verify this pull request

(Please pick either of the following options)

This pull request is a trivial rework / code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end.
  • Added HoodieClientWriteTest to verify the change.
  • Manually verified the change by running a job locally.

Committer checklist

  • Has a corresponding JIRA in PR title & commit

  • Commit message is descriptive of the change

  • CI is green

  • Necessary doc changes done or have another open PR

  • For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.

@hudi-bot
Copy link
Collaborator

hudi-bot commented Feb 3, 2022

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

Copy link
Member

@codope codope left a comment

Choose a reason for hiding this comment

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

@t0il3ts0ap Thanks for the contribution. Could you please file a JIRA and add it in the PR title?

public static final ConfigProperty<Boolean> ENABLE_COMMON_PREFIX = ConfigProperty
.key(METRIC_PREFIX + ".common_prefix.enable")
.defaultValue(true)
.sinceVersion("0.10.0")
Copy link
Member

Choose a reason for hiding this comment

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

version should be 0.11.0

@nsivabalan nsivabalan self-assigned this Feb 3, 2022
@nsivabalan
Copy link
Contributor

@rmahindra123 : can you review this patch please.

getStringOrDefault(HoodieMetricsConfig.EXECUTOR_METRICS_ENABLE, "false"));
}

public boolean isMetricsCommonPrefixEnabled() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you need another config. Check this PR: https://github.com/apache/hudi/pull/4274/files. If you want remove the infer function for METRICS_REPORTER_PREFIX, so it does not use the table name as default and the user can set a prefix using METRICS_REPORTER_PREFIX. Does it make sense?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ohh, I didnt notice while rebasing changes. I think I can use #4274. I will close this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

No problem. Thanks @t0il3ts0ap

@low-on-mana
Copy link
Contributor Author

Closing this as could use #4274.

@low-on-mana low-on-mana closed this Feb 4, 2022
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.

5 participants