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

Add metrics logs observer #120

Merged

Conversation

NipunaMadhushan
Copy link
Contributor

Purpose

We need to implement log based metrics for Ballerina as a requirement for all WSO2 on-prem and SaaS products that need to use the same stack for observability. In order to retrieve metrics data using OpenSearch, we need to provide log based metrics which contain a format as follows.

[Time Stamp] protocol:<protocol_type>, tagKey1:tagValue1, tagKey2:tagValue2, .. | response_time:<value_in_seconds>

We need to add a new Ballerina observer for metrics logs observation.

Fixes ballerina-platform/ballerina-lang#43614

Examples

Checklist

  • Linked to an issue
  • Updated the changelog
  • Added tests

@@ -94,6 +96,15 @@ public static BError enableTracing(BString providerName) {
}
}

public static BError enableMetricsLogging(Environment env, BString providerName) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Return type should be Object

@NipunaMadhushan NipunaMadhushan changed the base branch from java21 to metrics-logs December 20, 2024 04:42
@NipunaMadhushan NipunaMadhushan merged commit 3c54658 into ballerina-platform:metrics-logs Dec 20, 2024
4 checks passed
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.

2 participants