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 /installed_extensions endpoint to collect statistics about extension usage. #8917

Merged
merged 2 commits into from
Oct 9, 2024

Conversation

lubennikovaav
Copy link
Contributor

@lubennikovaav lubennikovaav commented Sep 4, 2024

Add /installed_extensions endpoint to collect
statistics about extension usage.
It returns a list of installed extensions in the format:

{
  "extensions": [
    {
      "extname": "extension_name",
      "versions": ["1.0", "1.1"],
      "n_databases": 5,
    }
  ]
}

Copy link

github-actions bot commented Sep 4, 2024

5120 tests run: 4913 passed, 0 failed, 207 skipped (full report)


Flaky tests (3)

Postgres 17

Postgres 16

  • test_cannot_create_endpoint_on_non_uploaded_timeline: release-arm64

Postgres 15

Code coverage* (full report)

  • functions: 31.4% (7510 of 23947 functions)
  • lines: 49.5% (60295 of 121746 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
29f4e1a at 2024-10-09T11:32:00.283Z :recycle:

compute_tools/src/extensions.rs Outdated Show resolved Hide resolved
compute_tools/src/extensions.rs Outdated Show resolved Hide resolved
compute_tools/src/compute.rs Outdated Show resolved Hide resolved
compute_tools/src/extensions.rs Outdated Show resolved Hide resolved
compute_tools/src/extensions.rs Outdated Show resolved Hide resolved
compute_tools/src/extensions.rs Outdated Show resolved Hide resolved
@lubennikovaav lubennikovaav marked this pull request as ready for review September 19, 2024 13:04
@lubennikovaav lubennikovaav requested review from a team as code owners September 19, 2024 13:04
@lubennikovaav lubennikovaav changed the title Add /extensions endpoint to collect statistics about extension usage. Add /installed_extensions endpoint to collect statistics about extension usage. Sep 19, 2024
Copy link
Member

@ololobus ololobus left a comment

Choose a reason for hiding this comment

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

Left a bunch of comments. My main concern is that as we deal a lot with third party code and formatting, we'd better handle all errors gracefully and only use expect/unwrap for stuff that 'should never happen' -- mutexes, runtimes, etc.

compute_tools/src/installed_extensions.rs Show resolved Hide resolved
compute_tools/src/installed_extensions.rs Outdated Show resolved Hide resolved
compute_tools/src/compute.rs Show resolved Hide resolved
compute_tools/src/http/api.rs Show resolved Hide resolved
compute_tools/src/http/api.rs Outdated Show resolved Hide resolved
compute_tools/src/installed_extensions.rs Outdated Show resolved Hide resolved
compute_tools/src/installed_extensions.rs Outdated Show resolved Hide resolved
test_runner/regress/test_installed_extensions.py Outdated Show resolved Hide resolved
compute_tools/src/installed_extensions.rs Show resolved Hide resolved
compute_tools/src/compute.rs Outdated Show resolved Hide resolved
compute_tools/src/installed_extensions.rs Show resolved Hide resolved
compute_tools/src/installed_extensions.rs Outdated Show resolved Hide resolved
@hlinnaka
Copy link
Contributor

How is the new API endpoint going to be called? Who's going to call it and when?

Did you consider exporting this information as a prometheus metric, instead?

@lubennikovaav
Copy link
Contributor Author

How is the new API endpoint going to be called? Who's going to call it and when?

In my idea the caller will be cplane, similar to GetStartupMetrics.

Did you consider exporting this information as a prometheus metric, instead?

Is it possible to add arbitrary hashmap as prometheus metric? I thought, it only supports prometheus metric types.

libs/compute_api/src/responses.rs Outdated Show resolved Hide resolved
test_runner/regress/test_installed_extensions.py Outdated Show resolved Hide resolved
test_runner/regress/test_installed_extensions.py Outdated Show resolved Hide resolved
compute_tools/src/http/openapi_spec.yaml Outdated Show resolved Hide resolved
compute_tools/src/installed_extensions.rs Outdated Show resolved Hide resolved
compute_tools/src/installed_extensions.rs Show resolved Hide resolved
compute_tools/src/http/openapi_spec.yaml Outdated Show resolved Hide resolved
statistics about extension usage.

It returns a list of installed extensions in the format:
```json
{
    "extensions": [
    {
        "extname": "extension_name",
        "versions": ["1.0", "1.1"],
        "n_databases": 5,
    }
    ]
}
```
@lubennikovaav lubennikovaav merged commit 63e7fab into main Oct 9, 2024
80 checks passed
@lubennikovaav lubennikovaav deleted the track_extensions branch October 9, 2024 12:32
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