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 Openmetric reporting for MI dataservices #2929

Merged
merged 2 commits into from
Nov 22, 2023
Merged

Conversation

chanikag
Copy link
Contributor

@chanikag chanikag commented Aug 7, 2023

This is to fix #3134

To run,
On Windows: micro-integrator.bat -DenablePrometheusApi
For Linux/MacOS/CentOS : ./micro-integrator.sh -DenablePrometheusApi

Screenshot 2023-08-07 at 9 44 46 AM Screenshot 2023-08-07 at 9 38 18 AM

Purpose

Describe the problems, issues, or needs driving this feature/fix and include links to related issues in the following format: Resolves issue1, issue2, etc.

Goals

Describe the solutions that this feature/fix will introduce to resolve the problems described above

Approach

Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email [email protected] to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here.

User stories

Summary of user stories addressed by this change>

Release note

Brief description of the new feature or bug fix as it will appear in the release notes

Documentation

Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact

Training

Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable

Certification

Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to [email protected] and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why.

Marketing

Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable

Automation tests

  • Unit tests

    Code coverage information

  • Integration tests

    Details about the test cases and coverage

Security checks

Samples

Provide high-level details about the samples related to this feature

Related PRs

List any other related PRs

Migrations (if applicable)

Describe migration steps and platforms on which migration has been tested

Test environment

List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested

Learning

Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.

This is to fix https://github.com/wso2/api-manager/issues/2032

To run,
On Windows: micro-integrator.bat -DenablePrometheusApi
For Linux/MacOS/CentOS : ./micro-integrator.sh -DenablePrometheusApi

private static MetricReporter metricReporter = null;

public static MetricReporter getMetricReporter() {

Choose a reason for hiding this comment

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

This is not thread safe. If this is being used by multiple places, then you need to handle it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tishan89, this is called at the server startup by the axis2 handler and the synapse handler. Won't be called by multiple threads at the same time. Further, that won;t modify anything.

tishan89
tishan89 previously approved these changes Aug 17, 2023
reporterInstance = loadDefaultPrometheusReporter();
}
} else {
reporterInstance = loadDefaultPrometheusReporter();
Copy link
Member

Choose a reason for hiding this comment

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

Shall we add a log here, something like: "Loading the default PrometheusReporter class"

@chanikag chanikag merged commit ff6df75 into wso2:master Nov 22, 2023
1 of 6 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.

Add Openmetric reporting for MI dataservices
3 participants