Summary
When deploying content to Posit Connect via Publisher, there is currently no way to configure metrics_collection_enabled for the content item. This means users must manually enable resource metrics collection after deployment via the Connect Dashboard or API.
Problem
Connect supports per-content resource metrics (CPU, memory, connection counts) via the metrics_collection_enabled field on content items. This can be set at creation time via POST /v1/content or updated afterward via PATCH /v1/content/{guid}. However, Publisher's configuration files (in .posit/publish/) don't expose this setting, so users deploying via Publisher cannot enable metrics collection as part of their deployment workflow.
Proposed Solution
Add support for a configuration option (e.g., in the .posit/publish/*.toml configuration file) that maps to the metrics_collection_enabled field in the Connect API. When deploying, Publisher would include this field in the content creation/update API call.
Example configuration:
[connect.runtime]
metrics_collection_enabled = true
Workarounds
- Set
Applications.MetricsCollectionEnabled = true server-wide in rstudio-connect.gcfg
- Manually call
PATCH /v1/content/{guid} after deployment
- Use the Connect Dashboard to enable metrics after deployment
References
Summary
When deploying content to Posit Connect via Publisher, there is currently no way to configure
metrics_collection_enabledfor the content item. This means users must manually enable resource metrics collection after deployment via the Connect Dashboard or API.Problem
Connect supports per-content resource metrics (CPU, memory, connection counts) via the
metrics_collection_enabledfield on content items. This can be set at creation time viaPOST /v1/contentor updated afterward viaPATCH /v1/content/{guid}. However, Publisher's configuration files (in.posit/publish/) don't expose this setting, so users deploying via Publisher cannot enable metrics collection as part of their deployment workflow.Proposed Solution
Add support for a configuration option (e.g., in the
.posit/publish/*.tomlconfiguration file) that maps to themetrics_collection_enabledfield in the Connect API. When deploying, Publisher would include this field in the content creation/update API call.Example configuration:
Workarounds
Applications.MetricsCollectionEnabled = trueserver-wide inrstudio-connect.gcfgPATCH /v1/content/{guid}after deploymentReferences