Test and Publish a Metric Extension Template

You can test a Metric Extension Template against a Managed Database to verify that its SQL query returns the expected metrics and dimensions. Publish the template to make it available for creating Metric Extensions.

Before testing, ensure that the selected database user has the privileges required to run the SQL query. To change the query or other template settings, click Edit in the draft template’s Actions menu, make the changes, and click Save changes.

Note

Testing a template does not publish metrics to the Monitoring service or verify the permissions required for scheduled metric publication.

Test a Metric Extension Template

  1. Go to the Metric Extension Templates page.
  2. Ensure that the correct compartment is selected in the Compartment applied filter.
  3. Click the Actions icon (Actions) for the template and click Test.
  4. In the Test Metric Extension template panel:
    1. Review the query displayed in the SQL query for this test field.
    2. If the SQL query uses bind variables, enter the values to use for the test. Default values are prefilled when available and can be changed. Provide a value for each required variable.
    3. Select the test database:
      1. Managed database compartment: Select the compartment that contains the Managed Database.
      2. Managed database: Select the Managed Database against which you want to test the template.
    4. Select one of the following credential options:
      • Preferred credentials: Use the preferred credentials configured for the selected database. This option is displayed only if preferred credentials are configured.
      • Default monitoring credentials: Use the monitoring credential used by Database Management for the selected database.
      • Named credentials: Select the credential scope (Resource credentials or Global credentials), compartment, and named credential to use for the test.
    5. Optionally, review the Previous test result section, if available. Click View all test executions to view the test history.
    6. Click Run test.
    7. Review the test status and returned metrics, dimensions, and values. If the test fails, review the error message, resolve the issue, and run the test again.

You can also view the test history by clicking the template name on the Metric Extension Templates page, and then clicking the Test executions tab.

Publish a Metric Extension Template

After testing the template and verifying its results, publish it.

Note

After a template is published, only its name and description can be edited. To change the SQL query or other collection settings, clone the template and update the copy.
  1. Go to the Metric Extension Templates page.
  2. Ensure that the correct compartment is selected in the Compartment applied filter.
  3. Click the Actions icon (Actions) for the draft template and click Publish.
  4. In the Publish Metric Extension template dialog box, review the information.

    A normal publish requires the latest retained test execution to succeed and the template to remain unchanged since that test. If no retained test result is available, the latest retained test did not succeed, or the template was changed after the test, the dialog box displays a warning and makes Force publish available. Force publish bypasses the successful-test and unchanged-template checks. Use Force publish only after reviewing the template and test results.

    Click Publish, or click Force publish if you've reviewed the warning and want to proceed.

The template’s status changes to Published, and its version is displayed on the Metric Extension Templates page.