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

Telemetry fixes #2857

Merged
merged 4 commits into from
Oct 7, 2024
Merged

Telemetry fixes #2857

merged 4 commits into from
Oct 7, 2024

Conversation

calebschoepp
Copy link
Collaborator

@calebschoepp calebschoepp commented Sep 23, 2024

Summary

  • Fixes bug that slipped in with Upgrade OTel #2834.
  • Improves a comment.
  • Removes potentially sensitive values from OTel traces.

Questions

  • Do we want to remove DB addresses from OTel traces b/c they might contain credentials inline?
  • Do we want to remove key values everywhere from OTel traces? This seems valuable enough to me that I think we should just keep it and document it.

Fixe #2816

Signed-off-by: Caleb Schoepp <caleb.schoepp@fermyon.com>
This is relied on by other parts of spin-telemetry

Signed-off-by: Caleb Schoepp <caleb.schoepp@fermyon.com>
Signed-off-by: Caleb Schoepp <caleb.schoepp@fermyon.com>
Copy link
Collaborator

@rylev rylev left a comment

Choose a reason for hiding this comment

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

Seems like an improvement. As for your questions:

  • re: DB addresses - this seems like a smart idea to remove
  • key-value: I think we definitely want to remove values - I can see the argument both for keeping and removing keys. Perhaps we keep them for now, and see what people think over time?

@lann
Copy link
Collaborator

lann commented Sep 24, 2024

Do we want to remove key values everywhere from OTel traces? This seems valuable enough to me that I think we should just keep it and document it.

We could perhaps drop it by default but allow opting-in by level, e.g.

#[instrument(..., fields(key = Empty))]
...
// I believe this would allow e.g. RUST_LOG=spin_factor_key_value=debug
if tracing::enabled!(Level::DEBUG) {
  span.record("key", key);
}

@calebschoepp
Copy link
Collaborator Author

Ready for another round of review. I think that we should just keep keys for now and we can handle feedback in the future. I feel that it is a reasonable requirement that PII should be kept out of keys.

@calebschoepp
Copy link
Collaborator Author

Do we want to remove key values everywhere from OTel traces? This seems valuable enough to me that I think we should just keep it and document it.

We could perhaps drop it by default but allow opting-in by level, e.g.

#[instrument(..., fields(key = Empty))]
...
// I believe this would allow e.g. RUST_LOG=spin_factor_key_value=debug
if tracing::enabled!(Level::DEBUG) {
  span.record("key", key);
}

I tried this and it didn't work.

Copy link
Collaborator

@rylev rylev left a comment

Choose a reason for hiding this comment

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

I still have questions, but nothing that should block if you feel this is ready to merge.

crates/factor-outbound-mysql/src/host.rs Outdated Show resolved Hide resolved
crates/factor-outbound-mysql/src/host.rs Outdated Show resolved Hide resolved
crates/factor-outbound-mysql/src/host.rs Outdated Show resolved Hide resolved
@calebschoepp
Copy link
Collaborator Author

Ready for one more review and then for someone to merge it if they think it's good to go.

@rylev
Copy link
Collaborator

rylev commented Oct 7, 2024

@calebschoepp looks like the failure in CI is legit:

error: expected statement after outer attribute
 --> crates/factor-outbound-networking/src/lib.rs:258:1
  |
3 | #[instrument(fields(db.address = Empty, server.port = Empty, db.namespace = Empty))]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Signed-off-by: Caleb Schoepp <caleb.schoepp@fermyon.com>
@calebschoepp
Copy link
Collaborator Author

@calebschoepp looks like the failure in CI is legit:

error: expected statement after outer attribute
 --> crates/factor-outbound-networking/src/lib.rs:258:1
  |
3 | #[instrument(fields(db.address = Empty, server.port = Empty, db.namespace = Empty))]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Fixed

@rylev rylev merged commit f80e5ce into fermyon:main Oct 7, 2024
17 checks passed
@calebschoepp calebschoepp deleted the telemetry-fixes branch October 7, 2024 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

Successfully merging this pull request may close these issues.

3 participants