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

Analytics for tofi and dimensions state (infrastructure state) #15

Open
alt-dima opened this issue May 3, 2024 · 2 comments · May be fixed by #17
Open

Analytics for tofi and dimensions state (infrastructure state) #15

alt-dima opened this issue May 3, 2024 · 2 comments · May be fixed by #17
Assignees
Labels
enhancement New feature or request

Comments

@alt-dima
Copy link
Owner

alt-dima commented May 3, 2024

Would be nice to have a history of the tofugu executions to know, what the last state of the applied configuration by tofi and dimensions.

For example, what sha/checksum of the tofi (tf code) was applied to -d datacenter:staging1 -d account:test-account and when and by whom?

Than it will be easy to display chart/map of the infrastructure current/last state

Document fields

  • _id = objectId
  • account_id = link to accountId
  • tofiName = name of the executed tofi
  • date = timestamp of the execution
  • command = first arg (like init, apply, destroy)
  • full_command = whole command executed by tofugu (like tofu appy -auto-approve)
@alt-dima alt-dima added the enhancement New feature or request label May 3, 2024
@alt-dima alt-dima self-assigned this May 3, 2024
@alt-dima alt-dima linked a pull request May 4, 2024 that will close this issue
@alt-dima
Copy link
Owner Author

alt-dima commented May 4, 2024

Info stored in ToasterDB like

{
  "_id": { "$oid": "66367db93509ca433fdcfb06" },
  "orgname": "demo-org",
  "workspace": "master",
  "tofiname": "vpc",
  "cmdtoexec": "tofu",
  "cmdargs": [
    "-backend-config=bucket=default-tfstates",
    "-backend-config=key=org_demo-org/account_test-account/datacenter_staging1/vpc.tfstate",
    "-backend-config=region=us-east-2"
  ],
  "cmdmainarg": "init",
  "exitcode": { "$numberInt": "1" },
  "dimensions": {
    "account": "test-account",
    "datacenter": "staging1"
  },
  "accountid": "662cab7c5e226819838b01fa",
  "datecreated": {
    "$date": { "$numberLong": "1714846798515" }
  }
}

@alt-dima
Copy link
Owner Author

alt-dima commented May 4, 2024

Will think about it more, not merging now.
Maybe it should be disabled by default and enabled via tofugu config, or somehow else (in account in ToasterDB?).

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 a pull request may close this issue.

1 participant