Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tags dimension #227

Merged
merged 39 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
9178aa0
Add Tags dimension
cnharris10 Oct 18, 2023
58a9950
Update tags.md
cnharris10 Oct 21, 2023
8faeb19
Update tags.md
cnharris10 Oct 23, 2023
0de1996
Merge branch 'working_draft' into 226-tags-dimension
cnharris10 Oct 26, 2023
1ab730b
Update specification/dimensions/tags.md
cnharris10 Oct 30, 2023
ed570ce
Update specification/dimensions/tags.md
cnharris10 Oct 30, 2023
8d8f034
Update specification/dimensions/tags.md
cnharris10 Oct 30, 2023
f331ad3
Update specification/dimensions/tags.md
cnharris10 Oct 30, 2023
1081864
Update tags.md
cnharris10 Oct 30, 2023
6ffafd8
Update tags.md
cnharris10 Oct 30, 2023
ab010c8
Update tags.md
cnharris10 Oct 30, 2023
baa26bb
Update tags.md
cnharris10 Oct 30, 2023
07168d6
Update tags.md
cnharris10 Oct 31, 2023
cdcf5bf
Format fixes
cnharris10 Oct 31, 2023
02b50ab
Replaced highlighting with bold text
cnharris10 Oct 31, 2023
765fd36
Ensure not breaks within the Tags table Column
cnharris10 Oct 31, 2023
47ef458
Update tags.md
cnharris10 Nov 1, 2023
a851a5f
Update tags.md
cnharris10 Nov 1, 2023
0395927
Update tags.md
cnharris10 Nov 3, 2023
e934741
Update tags.md
cnharris10 Nov 3, 2023
d256078
Update tags.md
cnharris10 Nov 3, 2023
03af758
Update specification/dimensions/tags.md
cnharris10 Nov 6, 2023
7d1e66e
Update tags.md
cnharris10 Nov 6, 2023
498239a
Update specification/dimensions/tags.md
cnharris10 Nov 6, 2023
d029e6e
Update specification/dimensions/tags.md
cnharris10 Nov 6, 2023
c22877f
Update tags.md
cnharris10 Nov 6, 2023
7ad1425
Update tags.md
cnharris10 Nov 6, 2023
1b2fea0
Update tags.md
cnharris10 Nov 6, 2023
5d62fe4
Merge branch 'working_draft' into 226-tags-dimension
cnharris10 Nov 6, 2023
d5fa82a
Update tags.md
cnharris10 Nov 7, 2023
4b023d5
Update tags.md
cnharris10 Nov 7, 2023
e719bb5
Update tags.md
cnharris10 Nov 7, 2023
e4bcfae
Update tags.md
cnharris10 Nov 7, 2023
0c84ff8
Update tags.md
cnharris10 Nov 7, 2023
24df32d
Update tags.md
cnharris10 Nov 7, 2023
dab9254
Update specification/dimensions/tags.md
cnharris10 Nov 7, 2023
3b44e6b
Update tags.md
cnharris10 Nov 7, 2023
ac21cf6
Update specification/dimensions/tags.md
cnharris10 Nov 7, 2023
f37f550
Update tags.md
cnharris10 Nov 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions specification/dimensions/dimensions.mdpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ dimensions to categorize, filter, and reveal details in your data when grouped w
!INCLUDE "servicename.md",1
!INCLUDE "subaccountid.md",1
!INCLUDE "subaccountname.md",1
!INCLUDE "tags.md",1

[FODOFC]: https://www.finops.org/framework/capabilities/
76 changes: 76 additions & 0 deletions specification/dimensions/tags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Tags

The Tags column represents the set of finalized user-defined and/or provider-defined tags assigned to Tag Sources. Tags are commonly used for scenarios like adding business context to billing data to identify and accurately allocate charges.
cnharris10 marked this conversation as resolved.
Show resolved Hide resolved

A tag becomes 'finalized' when a single value is selected from a set of possible tag values assigned to the tag key at different levels of a resource grouping hierarchy (if supported by the Provider).

The Tags column adheres to the following requirements:

* The Tags column MUST contain user-defined and/or provider-defined tags.
* The Tags column MUST only contain finalized tags.
* The Tags column MUST be in Key-Value Format.
* A Tag without a specified value MUST have its value set to null.
cnharris10 marked this conversation as resolved.
Show resolved Hide resolved
cnharris10 marked this conversation as resolved.
Show resolved Hide resolved
* Providers MUST NOT alter user-defined Tag keys or values.
cnharris10 marked this conversation as resolved.
Show resolved Hide resolved

Provider-defined Tags additionally adhere to the following requirements:

* Provider-defined tags MUST be prefixed with a provider-specified tag key prefix.
* Providers SHOULD publish all provider-specified tag key prefixes within their respective documentation.

## Provider-Defined vs. User-Defined Tags

The following is an example of one user-defined tag and one provider-defined tag, respectively, with tag key, `foo`. The first tag, which is user-defined, is not prefixed. The second tag is prefixed with marketplace/ which the provider has specified as a reserved tag key prefix.

```json
{
"foo":"bar",
"marketplace/foo": "bar"
}
```

## Finalized Tags

A tag can either be static or dynamic. If a tag is static, its value is immutable. If a tag is dynamic, its value is determined by a set of predefined user or provider rules. A finalized tag is the final result of any static or dynamic Tag.
cnharris10 marked this conversation as resolved.
Show resolved Hide resolved
cnharris10 marked this conversation as resolved.
Show resolved Hide resolved

As a example, let's assume 1 sub account exists with 1 virtual machine with the following details:

* Sub Account
* id: *my-sub-account*
* user-defined tags: *team:ops*, *env:prod*
* Virtual Machine
* id: *my-vm*
* user-defined tags: *team:web*
cnharris10 marked this conversation as resolved.
Show resolved Hide resolved

The table below represents a finalized cost and usage dataset with these resources. It also shows the finalized state after all resource-oriented, tag inheritance rules are processed.

| ResourceType | ResourceId | Tags |
| :---------------| :--------------| :-------------------------------------------|
| Sub Account | my-sub-account | { "team": "ops", "env": "prod" } |
| Virtual Machine | my-vm | { "team": "web", *"env": "prod"* } |

Because the the Virtual Machine Resource did not have an `env` tag, it inherited tag, `env:prod` (italicized), from its parent Sub Account. Conversely, because the Virtual Machine Resource already has a `team` tag (`team:web`), it did not inherit `team:ops` from its parent Sub Account.

## Column ID

Tags

## Display Name

Tags

## Description

The set of finalized tags assigned to Tag Sources.
cnharris10 marked this conversation as resolved.
Show resolved Hide resolved

## Content Constraints

| Constraint | Value |
|:----------------|:-----------------|
| Column required | True |
| Data type | JSON |
| Allows nulls | True |
| Value format | Key-Value Format |

## Introduced (version)

1.0
46 changes: 46 additions & 0 deletions supporting_content/dimensions/tags.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Column: Tags

## Example provider mappings

Current resource types found or extracted from available data sets:

| Provider | Dataset | Column | Hierarchical Resources | Supports Inheritance?
| :-------- | :---------------------- | :-------------------------------------------| :-------------------------------------------| :----------
| AWS | CUR | resourceTags/user:\*, costCategories/\* | Organization, Organizational Unit(s), Account | No
| GCP | BigQuery Billing Export | tags, labels, system_labels, project.labels | Folder(s), Project | Yes
| Microsoft | Cost details | Tags | Billing Account, Billing Profile, Invoice Section, Department, Enrollment Account, Management Group, Subscription, Resource Group | Yes

## Discussion Topics

Discussion / Scratch space:
- Finalized section may or may not be necessary because providers would only provide finalized tags
- Remove 'finalized' from first sentence of Tags
- User-defined tags should not have a prefix
- Provider can create and account for a reserved prefix set
- Providers should publish known prefixes somewhere
- Refer to Numeric Attribute language around provider-publishing guidelines
- Separator poll?
- Double forward slash (Chris Harris)
- Pipe (Shawn Alpay)
- 2 columns: EffectiveTags and RawTags (better names to be decided)
- Tags
- Providers must account for collisions
- If inheritance exists for a set of tags, provide the “winning” tag
- If inheritance does not exist for a tag, provide all namespaced tags (i.e. costCategory/foo, resourceTags/user:foo)
- MUST adhere to the Key-Value attribute spec

- Questions:
- Inheritance (e.g., source)?
- Merging different datasets (e.g., source)?
- Do we split effective tags and raw tags or merge them together with a predefined key format (e.g., “<source>/<key>”)?
- Simple JSON key/value pair or array of JSON objects?
- What does it look like interpreting labels using Excel formulas only? Would users be required to dl a plugin, use vbscript, etc.
- Excel: https://support.microsoft.com/en-au/office/parse-text-as-json-or-xml-power-query-7436916b-210a-4299-83dd-8531a1d5e945 (supports {"foo": "bar"} approach)
- Sheets: Seems to require scripting
- How do we fit into the top 3 clouds?
- Should we give an opinion around requiring k/v tags?
- Create a poll around calling the dimension “Tags” or “Labels”?
- “Custom Tags/Labels”?
- One key/value pair for all tags “tags”: [ … ]
- Which raw format do we go with?