Session level cost attribution - Amazon Athena
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Session level cost attribution

From Apache Spark version 3.5 release version onward, Athena allows tracking costs for each session. You can define cost allocation tags when starting a session and the reported costs for a session will appear in Cost Explorer or on Amazon Billing cost allocation reports. You can also apply cost allocation tags at the Workgroup level and those get copied over to any sessions started on that workgroup.

Using Session Level Cost Attribution

By default, any cost allocation tags specified at the workgroup level is copied over to interactive sessions started on that workgroup.

To disable tags to be copied from the Workgroup when starting an interactive session from the Amazon CLI:

aws athena start-session \ --region "REGION" \ --work-group "WORKGROUP" \ --tags '[ { "Key": "tag_key", "Value": "tag_value" } ]' \ --no-copy-work-group-tags

To enable tags to be copied from the Workgroup when starting an interactive session from the Amazon CLI:

aws athena start-session \ --region "REGION" \ --work-group "WORKGROUP" \ --copy-work-group-tags

Considerations and Limitations

  • Session tags overrides workgroup tags with the same keys.