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

Remove dimension TAGS from aws metricbeat module documentation for billing #23546

Merged
merged 2 commits into from
Jan 26, 2021

Conversation

jguay
Copy link
Contributor

@jguay jguay commented Jan 18, 2021

https://github.com/elastic/beats/blob/7.11/x-pack/metricbeat/module/aws/billing/billing.go#L34-L42 :

	// This list is from https://github.com/aws/aws-sdk-go-v2/blob/master/service/costexplorer/api_enums.go#L60-L90
	supportedDimensionKeys = []string{
		"AZ", "INSTANCE_TYPE", "LINKED_ACCOUNT", "OPERATION", "PURCHASE_TYPE",
		"REGION", "SERVICE", "USAGE_TYPE", "USAGE_TYPE_GROUP", "RECORD_TYPE",
		"OPERATING_SYSTEM", "TENANCY", "SCOPE", "PLATFORM", "SUBSCRIPTION_ID",
		"LEGAL_ENTITY_NAME", "DEPLOYMENT_OPTION", "DATABASE_ENGINE",
		"CACHE_ENGINE", "INSTANCE_TYPE_FAMILY", "BILLING_ENTITY",
		"RESERVATION_ID",
	}

https://github.com/elastic/beats/blob/master/x-pack/metricbeat/module/aws/billing/_meta/docs.asciidoc mentions TAGS :

group_by_dimension_keys: A list of keys used in Cost Explorer to group by dimensions. Valid values are AZ, INSTANCE_TYPE, LEGAL_ENTITY_NAME, LINKED_ACCOUNT, OPERATION, PLATFORM, PURCHASE_TYPE, SERVICE, TAGS, TENANCY, and USAGE_TYPE.

https://github.com/aws/aws-sdk-go-v2/blob/main/service/costexplorer/types/enums.go#L171-L203 :

func (Dimension) Values() []Dimension {
	return []Dimension{
		"AZ",
		"INSTANCE_TYPE",
		"LINKED_ACCOUNT",
		"LINKED_ACCOUNT_NAME",
		"OPERATION",
		"PURCHASE_TYPE",
		"REGION",
		"SERVICE",
		"SERVICE_CODE",
		"USAGE_TYPE",
		"USAGE_TYPE_GROUP",
		"RECORD_TYPE",
		"OPERATING_SYSTEM",
		"TENANCY",
		"SCOPE",
		"PLATFORM",
		"SUBSCRIPTION_ID",
		"LEGAL_ENTITY_NAME",
		"DEPLOYMENT_OPTION",
		"DATABASE_ENGINE",
		"CACHE_ENGINE",
		"INSTANCE_TYPE_FAMILY",
		"BILLING_ENTITY",
		"RESERVATION_ID",
		"RESOURCE_ID",
		"RIGHTSIZING_TYPE",
		"SAVINGS_PLANS_TYPE",
		"SAVINGS_PLAN_ARN",
		"PAYMENT_OPTION",
	}
}

I think we just need to remove TAGS from the documentation, when used metricbeat won't start with this error

ERROR  instance/beat.go:956  Exiting: 1 error: error unpack raw module config using UnpackConfig: costexplorer GetCostAndUsageRequest does not support dimension key: TAGS accessing '0.cost_explorer_config' (source:'/usr/share/metricbeat/modules.d/aws.yml')

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jan 18, 2021
@cla-checker-service
Copy link

cla-checker-service bot commented Jan 18, 2021

💚 CLA has been signed

@jguay jguay changed the title Remove dimension TAGS from aws metricbeat module documentation Remove dimension TAGS from aws metricbeat module documentation for billing Jan 18, 2021
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jan 18, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #23546 updated

    • Start Time: 2021-01-22T16:41:59.777+0000
  • Duration: 22 min 58 sec

  • Commit: 3419a36

❕ Flaky test report

No test was executed to be analysed.

@kaiyan-sheng kaiyan-sheng added the Team:Platforms Label for the Integrations - Platforms team label Jan 18, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Platforms)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jan 18, 2021
@kaiyan-sheng kaiyan-sheng added the needs_backport PR is waiting to be backported to other branches. label Jan 18, 2021
@kaiyan-sheng kaiyan-sheng self-assigned this Jan 18, 2021
@jguay jguay requested review from kaiyan-sheng and removed request for kaiyan-sheng January 18, 2021 16:36
https://github.com/elastic/beats/blob/7.11/x-pack/metricbeat/module/aws/billing/billing.go#L34-L42 :
```
	// This list is from https://github.com/aws/aws-sdk-go-v2/blob/master/service/costexplorer/api_enums.go#L60-L90
	supportedDimensionKeys = []string{
		"AZ", "INSTANCE_TYPE", "LINKED_ACCOUNT", "OPERATION", "PURCHASE_TYPE",
		"REGION", "SERVICE", "USAGE_TYPE", "USAGE_TYPE_GROUP", "RECORD_TYPE",
		"OPERATING_SYSTEM", "TENANCY", "SCOPE", "PLATFORM", "SUBSCRIPTION_ID",
		"LEGAL_ENTITY_NAME", "DEPLOYMENT_OPTION", "DATABASE_ENGINE",
		"CACHE_ENGINE", "INSTANCE_TYPE_FAMILY", "BILLING_ENTITY",
		"RESERVATION_ID",
	}
```

https://github.com/elastic/beats/blob/master/x-pack/metricbeat/module/aws/billing/_meta/docs.asciidoc :
> group_by_dimension_keys: A list of keys used in Cost Explorer to group by dimensions. Valid values are AZ, INSTANCE_TYPE, LEGAL_ENTITY_NAME, LINKED_ACCOUNT, OPERATION, PLATFORM, PURCHASE_TYPE, SERVICE, **TAGS,** TENANCY, and USAGE_TYPE.

https://github.com/aws/aws-sdk-go-v2/blob/main/service/costexplorer/types/enums.go#L171-L203 :
```
func (Dimension) Values() []Dimension {
	return []Dimension{
		"AZ",
		"INSTANCE_TYPE",
		"LINKED_ACCOUNT",
		"LINKED_ACCOUNT_NAME",
		"OPERATION",
		"PURCHASE_TYPE",
		"REGION",
		"SERVICE",
		"SERVICE_CODE",
		"USAGE_TYPE",
		"USAGE_TYPE_GROUP",
		"RECORD_TYPE",
		"OPERATING_SYSTEM",
		"TENANCY",
		"SCOPE",
		"PLATFORM",
		"SUBSCRIPTION_ID",
		"LEGAL_ENTITY_NAME",
		"DEPLOYMENT_OPTION",
		"DATABASE_ENGINE",
		"CACHE_ENGINE",
		"INSTANCE_TYPE_FAMILY",
		"BILLING_ENTITY",
		"RESERVATION_ID",
		"RESOURCE_ID",
		"RIGHTSIZING_TYPE",
		"SAVINGS_PLANS_TYPE",
		"SAVINGS_PLAN_ARN",
		"PAYMENT_OPTION",
	}
}
```

I think we just need to remove TAGS from the documentation, when used metricbeat won't start with
```
ERROR  instance/beat.go:956  Exiting: 1 error: error unpack raw module config using UnpackConfig: costexplorer GetCostAndUsageRequest does not support dimension key: TAGS accessing '0.cost_explorer_config' (source:'/usr/share/metricbeat/modules.d/aws.yml')
```
@kaiyan-sheng
Copy link
Contributor

@jguay Thank you for fixing this!! I will merge this PR and backport it to 7.11 and 7.x.

kaiyan-sheng added a commit that referenced this pull request Jan 27, 2021
…lling (#23546) (#23704)

(cherry picked from commit f4416cb)

Co-authored-by: Julien Guay <guay_j@yahoo.fr>
kaiyan-sheng added a commit that referenced this pull request Jan 27, 2021
…lling (#23546) (#23703)

(cherry picked from commit f4416cb)

Co-authored-by: Julien Guay <guay_j@yahoo.fr>
kaiyan-sheng added a commit that referenced this pull request Jan 27, 2021
…lling (#23546) (#23701)

(cherry picked from commit f4416cb)

Co-authored-by: Julien Guay <guay_j@yahoo.fr>
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…lling (elastic#23546) (elastic#23704)

(cherry picked from commit fbba27d)

Co-authored-by: Julien Guay <guay_j@yahoo.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug docs Metricbeat Metricbeat Team:Platforms Label for the Integrations - Platforms team v7.10.3 v7.11.0 v7.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants