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

Adding Advisor and Resource Graph recommendations exports to Hubs #1130

Open
wants to merge 20 commits into
base: features/recs
Choose a base branch
from

Conversation

helderpinto
Copy link
Member

πŸ› οΈ Description

This is the first PR in a series of PRs that will add Advisor and Resource Graph recommendations exports to Hubs. This PR includes the initial Advisor/ARG recommendations export and the schema for recommendations. It is compatible with Data Explorer ingestion. For this PR, we also fixed Western Europe timezones.

The upcoming PRs will address documentation, reporting, and granting permissions to the ADF identity at a higher scope, for the recommendations exports to succeed. Currently, Reader permissions have to be granted manually at the subscription or management group level.

πŸ“‹ Checklist

πŸ”¬ How did you test this change?

  • 🀏 Lint tests
  • 🀞 PS -WhatIf / az validate
  • πŸ‘ Manually deployed + verified
  • πŸ’ͺ Unit tests
  • πŸ™Œ Integration tests

πŸ™‹β€β™€οΈ Do any of the following that apply?

  • 🚨 This is a breaking change.
  • 🀏 The change is less than 20 lines of code.

πŸ“‘ Did you update docs/changelog.md?

  • βœ… Updated changelog (required for dev PRs)
  • ➑️ Will add log in a future PR (feature branch PRs only)
  • ❎ Log not needed (small/internal change)

πŸ“– Did you update documentation?

  • βœ… Public docs in docs (required for dev)
  • βœ… Internal dev docs in src (required for dev)
  • ➑️ Will add docs in a future PR (feature branch PRs only)
  • ❎ Docs not needed (small/internal change)

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention πŸ‘‹ Issue or PR needs to be reviewed by the author or it will be closed due to no activity and removed Needs: Review πŸ‘€ PR that is ready to be reviewed labels Dec 19, 2024
Co-authored-by: Michael Flanakin <flanakin@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Review πŸ‘€ PR that is ready to be reviewed and removed Needs: Attention πŸ‘‹ Issue or PR needs to be reviewed by the author or it will be closed due to no activity labels Dec 20, 2024
@helderpinto helderpinto changed the base branch from dev to features/recs December 20, 2024 15:09
@helderpinto
Copy link
Member Author

@flanakin, the ADF pipeline was refactored to become query type-agnostic. It is now prepared to deal with other query types in the future. There are still some unresolved conversations. Feel free to ping me offline or let's set up a meeting to discuss this further.

@@ -799,6 +863,24 @@ resource dataset_ftkReleaseFile 'Microsoft.DataFactory/factories/datasets@2018-0
}
}

resource dataset_resourcegraph 'Microsoft.DataFactory/factories/datasets@2018-06-01' = {
name: 'resourcegraph'
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Do we want to standardize on camelcasing? I think we have some inconsistent casing right now and some of that can't be fixed but do we have a strong preference on which way we go?

Suggested change
name: 'resourcegraph'
name: 'resourceGraph'

frequency: 'Hour'
interval: 24
startTime: '2023-01-01T01:01:00'
frequency: 'Day'
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would keep this as hourly so customers can easily change it to be every 12 hours or whatever frequency they prefer.

Comment on lines +1070 to +1071
{
// Get Config
Copy link
Collaborator

Choose a reason for hiding this comment

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

Undo all of these. We want them to be on the same line as the { so they are visible when collapsed.

type: 'DatasetReference'
parameters: {
fileName: 'settings.json'
folderPath: '${configContainerName}/queries'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thinking out loud: We will need configuration for CM exports as well. Should we follow this same pattern? And if so, is "queries" the right folder name? Should we use something more generic, like "datasets" or maybe something else? I'm not too picky. Just asking to be forward-looking.

typeProperties: {
variableName: 'blobExportTimestamp'
value: {
value: '@concat(utcNow(\'yyyy\'),\'/\',utcNow(\'MM\'),\'/\',utcNow(\'dd\'),\'/\')'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to account for data that we don't want to duplicate by day? Do we anticipate hourly, monthly, or even no historical scenarios? Happy to handle that later. I just want to make sure we have a plan for how we'll handle it that doesn't require moving data around. That tends to be painful.

@@ -1519,18 +1635,41 @@ Recommendations_transform_v1_0()

// Recommendations_final_v1_0 table
.create-merge table Recommendations_final_v1_0 (
Copy link
Collaborator

Choose a reason for hiding this comment

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

This table shouldn't change

'reservationdetails_2023-03-01': loadTextContent('../schemas/reservationdetails_2023-03-01.json')
'reservationrecommendations_2023-05-01_ea': loadTextContent('../schemas/reservationrecommendations_2023-05-01_ea.json')
'reservationrecommendations_2023-05-01_mca': loadTextContent('../schemas/reservationrecommendations_2023-05-01_mca.json')
'reservationtransactions_2023-05-01_ea': loadTextContent('../schemas/reservationtransactions_2023-05-01_ea.json')
'reservationtransactions_2023-05-01_mca': loadTextContent('../schemas/reservationtransactions_2023-05-01_mca.json')
}
var queryFiles = {
'HubsRecommendations-AdvisorCost': loadTextContent('./scripts/HubsRecommendations-AdvisorCost.json')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't these be in the queries folder?

Suggested change
'HubsRecommendations-AdvisorCost': loadTextContent('./scripts/HubsRecommendations-AdvisorCost.json')
'HubsRecommendations-AdvisorCost': loadTextContent('./queries/HubsRecommendations-AdvisorCost.json')

"mappings": [
{
"source": {
"path": "[['ResourceId']"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this path correct? It doesn't look right with the extra [. Same for the others.

},
{
"source": {
"path": "[['x_RecommendationImpact']"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the impact actually useful for customers? Can we stand by the impact assessment for any of these recommendations? I've never trusted it, but I also haven't had a conversation with customers about it.

},
{
"source": {
"path": "[['x_RecommendationMaturityLevel']"
Copy link
Collaborator

Choose a reason for hiding this comment

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

What values does this have? Who assesses maturity? Is it standardized?

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention πŸ‘‹ Issue or PR needs to be reviewed by the author or it will be closed due to no activity and removed Needs: Review πŸ‘€ PR that is ready to be reviewed labels Feb 11, 2025

@helderpinto: you have some new feedback!

Please review and resolve all comments and I'll let reviewers know by removing the Needs: Attention label. If I miss anything, just reply with #needs-review and I'll update the status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Attention πŸ‘‹ Issue or PR needs to be reviewed by the author or it will be closed due to no activity Tool: FinOps hubs Data pipeline solution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants