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

Added log_util.py for creating structured logs for log-based metric. #1209

Merged

Conversation

rohitkumarbhagat
Copy link
Contributor

No description provided.

Copy link
Contributor

@ajaits ajaits left a comment

Choose a reason for hiding this comment

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

Thanks Rohit.

As we add more metrics for logging, please add some guidelines into util/log_util.py for

  1. what to add a new property:value as a metric:label vs what to add to message
    such as it's impact to dashboards and monitoring configs.
  2. can metric_labels have values as int, string, lists, etc
  3. is there a way to get aggregations in the monitoring dashboard (sum of log messages of a certain type+label), something like a Counter metric.

@rohitkumarbhagat
Copy link
Contributor Author

Thanks Ajai for the review. Addressed following review comments. Please review.

As we add more metrics for logging, please add some guidelines into util/log_util.py for

  1. what to add a new property:value as a metric:label vs what to add to message
    such as it's impact to dashboards and monitoring configs.
    Added
  2. can metric_labels have values as int, string, lists, etc
    Added

Added some guidelines on creating log-based metrics.

  1. is there a way to get aggregations in the monitoring dashboard (sum of log messages of a certain type+label), something like a Counter metric.

Yes, counter metrics are supported. Added a note that metric labels might not be required in counter metric.

util/log_util.py Outdated Show resolved Hide resolved
Copy link
Contributor

@ajaits ajaits left a comment

Choose a reason for hiding this comment

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

Thanks Rohit!

@rohitkumarbhagat rohitkumarbhagat enabled auto-merge (squash) January 30, 2025 11:45
@rohitkumarbhagat rohitkumarbhagat merged commit c2f3cf0 into datacommonsorg:master Jan 31, 2025
9 checks passed
@rohitkumarbhagat rohitkumarbhagat deleted the log_metric_util branch January 31, 2025 04:50
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.

3 participants