Billing integration add tags#15950
Conversation
🚀 Benchmarks reportTo see the full report comment with |
|
We definitely have people using this for gov cloud. Can we expose that as a configurable parameter (separate from the main base URL if needed ) ? |
|
The functionality works on ECH deployments, but, for some reason we cannot add tags on Serverless projects: |
|
I tried patching the code to be configurable, but doesn't seem to work with govcloud still. |
JohannesMahne
left a comment
There was a problem hiding this comment.
I tested the positive flows, and the tags are coming through nicely.
Please just check the 2 questions I had on the edge cases.
|
Hi! We just realized that we haven't looked into this PR in a while. We're sorry! We're labeling this issue as |
💚 Build Succeeded
History
|
|
@asazallesmilner - would you mind reviewing this PR again? |
| - name: deployment_tags | ||
| type: keyword | ||
| description: Tags associated with the Elasticsearch Service deployment. |
There was a problem hiding this comment.
| - name: deployment_tags | |
| type: keyword | |
| description: Tags associated with the Elasticsearch Service deployment. | |
| - name: deployment_tags | |
| type: keyword | |
| description: >- | |
| Tags associated with the Elasticsearch Service deployment, stored as | |
| "key:value" strings. Reflects current tags at collection time. |
| bytes(deployments_resp.Body).decode_json().as(deployments_body, | ||
| zip( | ||
| deployments_body.deployments.map(d, | ||
| d.resources.elasticsearch[0].id |
There was a problem hiding this comment.
Could you double-check if this must be replaced as follows
zip(
deployments_body.deployments.map(d, d.id), // ← Use deployment ID
deployments_body.deployments.map(d, d.metadata.collate("tags"))
)
asazallesmilner
left a comment
There was a problem hiding this comment.
LGTM. Work for both cloud.elastic.co and console.us-gov-east-1.aws.elastic-cloud.com.
Should we add docs for the urls to use for govcloud?
Billing endpoint: https://billing.us-gov-east-1.aws.elastic-cloud.com and Tags endpoint: https://console.us-gov-east-1.aws.elastic-cloud.com/api/v1/deployments/_search
|
Package ess_billing - 1.7.0 containing this change is available at https://epr.elastic.co/package/ess_billing/1.7.0/ |
* Working tag pull * Fixed deployment identification: elasticsearch_id is used rather than deployment.id * Added changelog entry * Added dep_search_url parameter to control tag fetch
Proposed commit message
This adds a toggle button on the billing integration allowing the collection of deployment tags, which are then added to each billing object related to the corresponding deployment. In case the toggle isn't activated, the old behavior is kept identical
Considerations
There are some caveats:
key:valuestrings, rather than nested objects to prevent mapping explosion.Checklist
changelog.ymlfile.Author's Checklist
Validate that the caveats are accepted
-> moved to configurable parameter for deployment search
Evaluate whether we want to extend dashboards
Evaluate whether we want to make the tag pull behavior default, and remove the control of the user over the setting altogether.
-> Kept default behavior
How to test this PR locally
elastic-package stack up -v -dAdd deployment tagstoggle.Related issues
None
Screenshots