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

[POC] Create a new "Obligatron" project #949

Closed
wants to merge 1 commit into from
Closed

Conversation

AshCorr
Copy link
Member

@AshCorr AshCorr commented Apr 25, 2024

What does this change?

Create a new "Obligatron" project, a step function consisting of 3 lambdas.

  • FindAllTeams: Fetches all of the teamIds from galaxies_teams and outputs it to the next step.
  • Obligation(Obligation ID): Accepts a teamId, runs some business logic related to the obligation, outputs a ObligationLambdaOutput. Invoked once per team and runs in parallel with other obligations.
  • SaveObligationResults: Accepts an array of ObligationLambdaOutput, saves the results of the previous obligation lambda to a table. This table should be able to store the history of previous results.

In theory this will let us create new obligation lambdas with ease and not have to worry about orchestrating them or saving data to the DB.

image

Why?

As part of Ops KR1 we've been trying to source tagging data from all AWS resources so that we can measure the departments adherance to the tagging obligation.

What I've been struggling with is how to transform the data we get into something useable. Right now we've got an ever expanding SQL query thats partially stored in code, and partially stored in Grafana. It feels quite unmaintainable and difficult to expand on.

What we want to do next with KR1 is start excluding certain resources from our queries, meaning its going to get ever more complicated. Now we could create even more views, and more functions in Postgres to help us with this but theres a few problems on this front:

  • Managing plpgsql code and postgres views is very painful. Every time you want to update a view or a function you need to copy over all the old code to a new migration, and make the change you wanted. plpgsql is also hard to reason and has a lot of limitations.
  • The buisiness logic for the OKR ends up being duplicated across a lot of different panels, meaning if you want to change how we calculate the Obligation you end up needing to update a lot of stuff and hope you haven't missed anything. Grafana also ends up storing code instead of it being in Github. This will probably be improved with Grafana Scenes.
  • How do we build a historical view of obligations? If every obligation is a bunch of bespoke panels, views, and dashboards with no standardisation between them are we going to have to figure out how we backdate each and every dashboard?

End goal

A possible end goal of this work might be to end up with a table like this in Grafana that is populated from the data this Step Function generates

Select Team: DevX Operations

Obligation Description Score Passing Drill Down
GU-1 All eligible AWS resources must be tagged 0.8 FALSE https://grafana/d/8ea3b5g
GU-2 No FSBP Violations 1 TRUE https://grafana/d/8ea3b5g
GU-3 Yada yada yada 0.4 FALSE https://grafana/d/8ea3b5g
GU-4 Words words words 0.3 TRUE https://grafana/d/8ea3b5g
GU-5 I'm not very creative 1 TRUE https://grafana/d/8ea3b5g

@AshCorr AshCorr force-pushed the ash/obligatron branch 2 times, most recently from bcd1514 to 9f77541 Compare April 25, 2024 09:03
@AshCorr AshCorr changed the title Create a new "Obligatron" project, which uses Create a new "Obligatron" project Apr 25, 2024
@AshCorr AshCorr force-pushed the ash/obligatron branch 11 times, most recently from 31ee6a8 to 8df21a4 Compare April 25, 2024 11:12
@AshCorr AshCorr changed the title Create a new "Obligatron" project [POC] Create a new "Obligatron" project Apr 25, 2024
@AshCorr AshCorr force-pushed the ash/obligatron branch 3 times, most recently from bf8a3c9 to 7f17029 Compare April 25, 2024 13:20
@akash1810
Copy link
Member

I think this has been superseded by #989, and can be closed?

@AshCorr AshCorr closed this May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants