Skip to content

Track SaveMoney telemetry input sources - #2014

Open
mamu0 wants to merge 4 commits into
mainfrom
fix-cli-savemoney-telemetry-attributes
Open

Track SaveMoney telemetry input sources#2014
mamu0 wants to merge 4 commits into
mainfrom
fix-cli-savemoney-telemetry-attributes

Conversation

@mamu0

@mamu0 mamu0 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

This PR improves telemetry for the dx savemoney command so we can verify whether current observability is sufficient for SaveMoney usage analysis.

It adds OpenTelemetry attributes on the root span to capture:

  • AZQR report source (cli, config, none)
  • subscription source (config, env, prompt)
  • output format, enabled sources, and pricing flag
  • analyzed subscription count and findings/resource totals

Example result on Application Insight:
image

Resolves CES-2208

@mamu0
mamu0 requested a review from a team as a code owner July 27, 2026 14:59
@mamu0
mamu0 temporarily deployed to infra-prod-ci July 27, 2026 15:00 — with GitHub Actions Inactive
@mamu0
mamu0 temporarily deployed to bootstrapper-dev-ci July 27, 2026 15:00 — with GitHub Actions Inactive
@mamu0
mamu0 temporarily deployed to infra-dev-ci July 27, 2026 15:00 — with GitHub Actions Inactive
@mamu0
mamu0 temporarily deployed to bootstrapper-prod-ci July 27, 2026 15:00 — with GitHub Actions Inactive

@kin0992 kin0992 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

question: are we sure we need this like this?

according to an RFC, we are going to remove the savemoney command from the CLI, so I would not invest on this (or at least I would do it differently)

@mamu0

mamu0 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

question: are we sure we need this like this?

@kin0992 Your point makes sense.
My thinking was that since this will be deleted entirely once separated, and the effort to implement it was minimal, a simpler change could suffice in the meantime.

according to an RFC, we are going to remove the savemoney command from the CLI, so I would not invest on this (or at least I would do it differently)

What alternative approach do you suggest?

@kin0992

kin0992 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

question: are we sure we need this like this?

@kin0992 Your point makes sense. My thinking was that since this will be deleted entirely once separated, and the effort to implement it was minimal, a simpler change could suffice in the meantime.

according to an RFC, we are going to remove the savemoney command from the CLI, so I would not invest on this (or at least I would do it differently)

What alternative approach do you suggest?

I would start thinking of savemoney as an independent and separate tool, callable through npx (e.g. npx @pagopa/savemoney <command>), so I would move in that direction. It's reasonable to have telemetry there (taking care of privacy concerns since potentially it is going to be used by anyone), so I would try to move in that direction.

Note that this is not a blocking comment: if you think that this way is best right now, then it's ok to me. It just seems to me that we are going to do the same work twice

@mamu0
mamu0 temporarily deployed to bootstrapper-dev-ci July 28, 2026 13:56 — with GitHub Actions Inactive
@mamu0
mamu0 temporarily deployed to infra-dev-ci July 28, 2026 13:56 — with GitHub Actions Inactive
@mamu0
mamu0 temporarily deployed to infra-prod-ci July 28, 2026 13:56 — with GitHub Actions Inactive
@mamu0
mamu0 temporarily deployed to bootstrapper-prod-ci July 28, 2026 13:56 — with GitHub Actions Inactive
@mamu0
mamu0 temporarily deployed to bootstrapper-dev-ci July 28, 2026 13:56 — with GitHub Actions Inactive
@mamu0
mamu0 temporarily deployed to infra-prod-ci July 28, 2026 13:56 — with GitHub Actions Inactive
@mamu0
mamu0 temporarily deployed to bootstrapper-prod-ci July 28, 2026 13:56 — with GitHub Actions Inactive
@mamu0
mamu0 temporarily deployed to infra-dev-ci July 28, 2026 13:56 — with GitHub Actions Inactive
@mamu0

mamu0 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

I would start thinking of savemoney as an independent and separate tool, callable through npx (e.g. npx @pagopa/savemoney <command>), so I would move in that direction. It's reasonable to have telemetry there (taking care of privacy concerns since potentially it is going to be used by anyone), so I would try to move in that direction.

@kin0992 Good point, I refactored this so telemetry mapping is now in @pagopa/dx-savemoney (not CLI-specific), and the DX CLI only forwards attributes to the active span (check this commit db570bf).

This keeps current telemetry working while minimizing rework for the future standalone savemoney entrypoint.

So we avoid doing the same work twice and keep the migration path cleaner.

@mamu0
mamu0 requested a review from kin0992 July 28, 2026 14:24
@mamu0
mamu0 temporarily deployed to infra-prod-ci July 29, 2026 14:01 — with GitHub Actions Inactive
@mamu0
mamu0 temporarily deployed to bootstrapper-dev-ci July 29, 2026 14:01 — with GitHub Actions Inactive
@mamu0
mamu0 temporarily deployed to bootstrapper-prod-ci July 29, 2026 14:01 — with GitHub Actions Inactive
@mamu0
mamu0 temporarily deployed to infra-dev-ci July 29, 2026 14:01 — with GitHub Actions Inactive
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.

2 participants