Managing workspaces
Use the procedures in this section to create and manage your Amazon Managed Service for Prometheus workspaces.
Create a workspace
Follow these steps to create a Amazon Managed Service for Prometheus workspace.
To create a workspace using the AWS CLI
Enter the following command to create the workspace. This example creates a workspace named
my-first-workspace
, but you can use a different alias if you want. Workspace aliases are friendly names that help you identify your workspaces. They do not have to be unique. Two workspaces can have the same alias, but all workspaces have unique workspace IDs, which are generated by Amazon Managed Service for Prometheus.aws amp create-workspace [ --alias
my-first-workspace
] [--tagsStatus
=Secret
,Team
=My-Team
This command returns the following data:
workspaceId
is the unique ID for this workspace. Make a note of this ID.arn
is the ARN for this workspace.status
is the current status of the workspace. Immediately after you create the workspace, this will probably beCREATING
.tags
lists the workspace's tags, if any.
-
If your
create-workspace
command returns a status ofCREATING
, you can then enter the following command to determine when the workspace is ready. Replacemy-workspace-id
with the value that thecreate-workspace
command returned forworkspaceId
.aws amp describe-workspace --workspace-id
my-workspace-id
When the
describe-workspace
command returnsACTIVE
forstatus
, the workspace is ready to use.
To create a workspace using the Amazon Managed Service for Prometheus console
Open the Amazon Managed Service for Prometheus console at https://console.aws.amazon.com/prometheus/
. Choose Create.
For Workspace alias, enter an alias for the new workspace.
Workspace aliases are friendly names that help you identify your workspaces. They do not have to be unique. Two workspaces can have the same alias, but all workspaces have unique workspace IDs, which are generated by Amazon Managed Service for Prometheus.
(Optional) To add one or more tags to the workspace, choose Add new tag. Then, in Key, enter a name for the tag. You can add an optional value for the tag in Value.
To add another tag, choose Add new tag again.
Choose Create workspace.
The workspace details page appears. This displays information including the status, ARN, workspace ID, and endpoint URLs for this workspace for both remote write and queries.
Initially, the status is probably CREATING. Wait until the status is ACTIVE before you move on to setting up your metric ingestion.
Make note of the URLs that are displayed for Endpoint - remote write URL and Endpoint - query URL. You'll need them when you configure your Prometheus server to remote write metrics to this workspace and when you query those metrics.
For information about how to ingest metrics into the workspace, see Ingest Prometheus metrics to the workspace.
Edit a workspace
You can edit a workspace to change its alias. To change the workspace alias using the AWS CLI, enter the following command.
aws amp update-workspace-alias --workspace-id
my-workspace-id
--alias "new-alias
"
To edit a workspace using the Amazon Managed Service for Prometheus console
Open the Amazon Managed Service for Prometheus console at https://console.aws.amazon.com/prometheus/
. In the upper left corner of the page, choose the menu icon and then choose All workspaces.
Choose the workspace ID of the workspace that you want to edit, and then choose Edit.
Enter a new alias for the workspace and then choose Save.
Find your workspace ARN
You can find the ARN of your Amazon Managed Service for Prometheus workspace by using either the console or the AWS CLI.
To find your workspace ARN using the Amazon Managed Service for Prometheus console
Open the Amazon Managed Service for Prometheus console at https://console.aws.amazon.com/prometheus/
. In the upper left corner of the page, choose the menu icon and then choose All workspaces.
Choose the Workspace ID of the workspace.
The workspace ARN is displayed under ARN.
To use the AWS CLI to find your workspace ARN, enter the following command.
aws amp describe-workspace --workspace-id
my-workspace-id
Find the value of arn
in the results.
Delete a workspace
When you delete a workspace, the data that has been ingested into it is not immediately deleted. It will be permanently deleted within one month.
To delete a workspace using the AWS CLI, enter the following command.
aws amp delete-workspace --workspace-id
my-workspace-id
To delete a workspace using the Amazon Managed Service for Prometheus console
Open the Amazon Managed Service for Prometheus console at https://console.aws.amazon.com/prometheus/
. In the upper left corner of the page, choose the menu icon and then choose All workspaces.
Choose the workspace ID of the workspace that you want to delete, and then choose Delete.
Enter
delete
in the confirmation box, and choose Delete.