"active_user_count":"SELECT COUNT(\"users\".\"id\") FROM \"users\" WHERE (\"users\".\"state\" IN ('active')) AND (\"users\".\"user_type\" IS NULL OR \"users\".\"user_type\" IN (NULL, 6, 4))",
"edition":"EE",
"license_md5":"c701acc03844c45366dd175ef7a4e19c",
"license_id":null,
"historical_max_users":0,
"licensee":{
"Name":"John Doe1"
},
"license_user_count":null,
"license_starts_at":"1970-01-01",
"license_expires_at":"2022-02-23",
"license_plan":"starter",
"license_add_ons":{
"GitLab_FileLocks":1,
"GitLab_Auditor_User":1
},
"license_trial":null,
"license_subscription_id":"0000",
"license":{},
"settings":{
"ldap_encrypted_secrets_enabled":false,
"operating_system":"mac_os_x-11.2.2"
},
"counts":{
"assignee_lists":"SELECT COUNT(\"lists\".\"id\") FROM \"lists\" WHERE \"lists\".\"list_type\" = 3",
"boards":"SELECT COUNT(\"boards\".\"id\") FROM \"boards\"",
"ci_builds":"SELECT COUNT(\"ci_builds\".\"id\") FROM \"ci_builds\" WHERE \"ci_builds\".\"type\" = 'Ci::Build'",
"ci_internal_pipelines":"SELECT COUNT(\"ci_pipelines\".\"id\") FROM \"ci_pipelines\" WHERE (\"ci_pipelines\".\"source\" IN (1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13) OR \"ci_pipelines\".\"source\" IS NULL)",
"ci_external_pipelines":"SELECT COUNT(\"ci_pipelines\".\"id\") FROM \"ci_pipelines\" WHERE \"ci_pipelines\".\"source\" = 6",
"ci_pipeline_config_auto_devops":"SELECT COUNT(\"ci_pipelines\".\"id\") FROM \"ci_pipelines\" WHERE \"ci_pipelines\".\"config_source\" = 2",
"ci_pipeline_config_repository":"SELECT COUNT(\"ci_pipelines\".\"id\") FROM \"ci_pipelines\" WHERE \"ci_pipelines\".\"config_source\" = 1",
"ci_runners":"SELECT COUNT(\"ci_runners\".\"id\") FROM \"ci_runners\"",
@@ -805,67 +805,6 @@ We return fallback values in these cases:
| Timeouts, general failures | -1 |
| Standard errors in counters | -2 |
### UsagePing Admin APIs
#### UsageDataQueries API
> - Introduced in [GitLab 13.11](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/57016)
> - It's deployed behind a [feature flag](../../user/feature_flags.md), disabled by default.
1. Get UsagePing raw SQL queries via an API.
Only available to GitLab instance Admin users.
Get all the raw sql queries used to compute usage ping.
```plaintext
GET /usage_data/queries
```
Sample response
```json
{
"recorded_at":"2021-03-23T06:31:21.267Z",
"uuid":null,
"hostname":"localhost",
"version":"13.11.0-pre",
"installation_type":"gitlab-development-kit",
"active_user_count":"SELECT COUNT(\"users\".\"id\") FROM \"users\" WHERE (\"users\".\"state\" IN ('active')) AND (\"users\".\"user_type\" IS NULL OR \"users\".\"user_type\" IN (NULL, 6, 4))",
"edition":"EE",
"license_md5":"c701acc03844c45366dd175ef7a4e19c",
"license_id":null,
"historical_max_users":0,
"licensee":{
"Name":"John Doe1"
},
"license_user_count":null,
"license_starts_at":"1970-01-01",
"license_expires_at":"2022-02-23",
"license_plan":"starter",
"license_add_ons":{
"GitLab_FileLocks":1,
"GitLab_Auditor_User":1
},
"license_trial":null,
"license_subscription_id":"0000",
"license":{},
"settings":{
"ldap_encrypted_secrets_enabled":false,
"operating_system":"mac_os_x-11.2.2"
},
"counts":{
"assignee_lists":"SELECT COUNT(\"lists\".\"id\") FROM \"lists\" WHERE \"lists\".\"list_type\" = 3",
"boards":"SELECT COUNT(\"boards\".\"id\") FROM \"boards\"",
"ci_builds":"SELECT COUNT(\"ci_builds\".\"id\") FROM \"ci_builds\" WHERE \"ci_builds\".\"type\" = 'Ci::Build'",
"ci_internal_pipelines":"SELECT COUNT(\"ci_pipelines\".\"id\") FROM \"ci_pipelines\" WHERE (\"ci_pipelines\".\"source\" IN (1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13) OR \"ci_pipelines\".\"source\" IS NULL)",
"ci_external_pipelines":"SELECT COUNT(\"ci_pipelines\".\"id\") FROM \"ci_pipelines\" WHERE \"ci_pipelines\".\"source\" = 6",
"ci_pipeline_config_auto_devops":"SELECT COUNT(\"ci_pipelines\".\"id\") FROM \"ci_pipelines\" WHERE \"ci_pipelines\".\"config_source\" = 2",
"ci_pipeline_config_repository":"SELECT COUNT(\"ci_pipelines\".\"id\") FROM \"ci_pipelines\" WHERE \"ci_pipelines\".\"config_source\" = 1",
"ci_runners":"SELECT COUNT(\"ci_runners\".\"id\") FROM \"ci_runners\"",