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

Docs: Update value_extractor usage in logs-based metrics #14339

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sahya
Copy link

@sahya sahya commented Apr 17, 2023

What

This pull request updates the usage of value_extractor in logs-based metrics for distribution value type. The changes include:

  • Added clarification that value_extractor is required for distribution logs-based metrics
  • Provided examples for EXTRACT(field) and REGEXP_EXTRACT(field, regex)
  • Clarified the arguments for value_extractor - "field" and "regex"
  • Mentioned the requirement of correct regular expression for the "regex" argument
  • Highlighted the requirement of value_extractor and bucket_options for DISTRIBUTION value type logs-based metrics

These changes aim to improve the understanding and usage of value_extractor in logs-based metrics. Kindly review and provide feedback. Thank you.

Why

When defining a distribution logs-based metric today, I encountered a confusing explanation and error. It was as follows.

  • Unsure how to write REGEXP_EXTRACT.
  • When defining a distribution logs-based metric, it is unsure what optional fields are mandatory.
  • Error with capture group due to Google's API, even though the capture group is correct. The regular expression was written inaccurately.

Therefore, I just create this pull request. I would be happy if this PR becomes a guide to help someone not get lost on the road about this section.

If you find any incorrect notations in the documentation, such as backquotes or double quotes, I would appreciate it if you could correct them.

@github-actions
Copy link

** WARNING **: This repository is generated by https://github.com/GoogleCloudPlatform/magic-modules. Any changes made directly to this repository will likely be overwritten. If you have further questions, please feel free to ping your reviewer or, internal employees, reach out to one of the engineers. Thank you!

Summary of changes:
* Added clarification that value_extractor is required for distribution logs-based metrics
* Provided examples for EXTRACT(field) and REGEXP_EXTRACT(field, regex)
* Clarified the arguments for value_extractor - "field" and "regex"
* Mentioned the requirement of correct regular expression for the "regex" argument
Highlighted the requirement of `bucket_options` and `value_extractor` for DISTRIBUTION value type logs-based metrics
@sahya sahya force-pushed the feature/describe_value_extractor branch from 37cc18a to 2f4dab6 Compare April 17, 2023 18:23
@sahya sahya marked this pull request as ready for review April 17, 2023 18:23
@github-actions github-actions bot requested a review from melinath April 17, 2023 18:24
Copy link
Collaborator

@melinath melinath left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! This file is managed by Magic Modules, so you'll need to contribute there: https://github.com/GoogleCloudPlatform/magic-modules Instructions are in the README.

@sahya
Copy link
Author

sahya commented Jan 4, 2024

@sahya
Copy link
Author

sahya commented Jan 4, 2024

@melinath
Hi, I could not find the method So I have no choice.
Excuse, me. Could you please create my intention changes from you?

@melinath
Copy link
Collaborator

melinath commented Jan 4, 2024

Hi @sahya - Unfortunately I won't be able to migrate your proposed change myself. However, I can hopefully point you in the right direction! It looks like this resource is generated using magic modules, so the documentation is all coming from this file: https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/products/logging/Metric.yaml

For information about how to preview the results, see our new docsite: https://googlecloudplatform.github.io/magic-modules/develop/resource/#add-documentation

@sahya
Copy link
Author

sahya commented Jan 4, 2024

@melinath I really appreciate your help! What the thing is really very helpful. I will give it a try when I have some time.

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.

None yet

2 participants