astro env metrics-export create

This command is only available on Astro.

Create a metrics export that pushes Deployment metrics to a remote endpoint, such as a Prometheus remote-write target. You can scope the metrics export to a Workspace or a Deployment.

Usage

$astro env metrics-export create

Options

OptionDescriptionPossible Values
-k,--keyThe metrics export key. Required.Any string
--endpointThe remote endpoint to push metrics to.Any valid URL
--exporter-typeThe exporter type, for example PROMETHEUS.Any valid exporter type
--auth-typeThe authentication type for the endpoint.BASIC, AUTH_TOKEN, or SIGV4
--usernameThe username for BASIC authentication.Any string
--passwordThe password for BASIC authentication. If omitted alongside --auth-type BASIC, the CLI reads it from stdin when piped, or prompts for it with the input hidden.Any string
--basic-tokenThe bearer or authentication token for AUTH_TOKEN authentication.Any string
--sigv4-assume-arnThe AWS IAM role to assume for SIGV4 authentication.Any valid IAM role ARN
--sigv4-sts-regionThe AWS STS region for SIGV4 authentication.Any valid AWS region
--headerA request header in KEY=VALUE form. Repeatable.KEY=VALUE
--labelA metric label in KEY=VALUE form. Repeatable.KEY=VALUE
--auto-linkWorkspace scope only. Automatically link the metrics export to all Deployments in the Workspace, including future ones.None
--workspace-idSet the Workspace scope. Mutually exclusive with --deployment-id. Defaults to your current Workspace from CLI context.Any valid Workspace ID
--deployment-idSet the Deployment scope. Mutually exclusive with --workspace-id.Any valid Deployment ID

Examples

$# Create a Prometheus metrics export with basic authentication
$astro env metrics-export create --workspace-id <workspace-id> \
> --key prom_main \
> --endpoint https://prom.example.com/api/v1/write \
> --exporter-type PROMETHEUS \
> --auth-type BASIC --username scraper --password "$SCRAPER_PASSWORD"