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 tenantmapping subcommand to map tenants (source,target) from a prometheus metric #121

Merged
merged 2 commits into from
Feb 24, 2023

Conversation

bastjan
Copy link
Contributor

@bastjan bastjan commented Feb 24, 2023

The new command should be able to map a time range (tenantmapping --begin="2023-02-24T05:20:26+01:00" --repeat-until="2023-02-24T08:20:26+01:00") from Prometheus control_api_organization_billing_entity_ref into the tenants database.

It tries to handle updated to the timerange gracefully be ending the 'last' range and appending a new one on change.

The new one has an upper bound to infinity or the next higher timerange with the same combination of source and target.

Checklist

  • Categorize the PR by setting a good title and adding one of the labels:
    bug, enhancement, documentation, change, breaking, dependency
    as they show up in the changelog
  • Update tests.
  • ⚠️ Either rebase this or Add time range to tenants #120 before merging.

@bastjan bastjan requested review from anothertobi and a team February 24, 2023 13:39
Copy link
Member

@simu simu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation LGTM, some questions inline

pkg/tenantmapping/mapping.go Show resolved Hide resolved
tenantmapping_command.go Show resolved Hide resolved
@bastjan bastjan merged commit 9cf463e into master Feb 24, 2023
@bastjan bastjan deleted the add-tenantmap-command branch February 24, 2023 14:59
@bastjan bastjan added the enhancement New feature or request label Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants