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

If consent is not granted, I can't send any traces, even those without any user information. #1716

Closed
MaximBazarov opened this issue Mar 9, 2024 · 4 comments
Labels
question Further information is requested

Comments

@MaximBazarov
Copy link

MaximBazarov commented Mar 9, 2024

Question

Hi, I'm trying to send our internal traces to Datadog, and I can see if user is not giving a consent I can't even enable tracing. That essentially makes it unusable for iOS app instrumentation. I think this should not be the case, app developers should decide what traces to send based on the legal requirement and I don't think it's a Datadog responsibility to prevent developers from that.

Traces that I'm trying to send do not include any user information, and only contain our internal systems information.

As a workaround I tried to add span_id and trace_id to the logs, but Datadog doesn't seem to include this logs in the traces view.

Is there a way to enable tracings for manually sent events when consent is not granted?

@MaximBazarov MaximBazarov added the question Further information is requested label Mar 9, 2024
@MaximBazarov
Copy link
Author

Another issue is Logger also sends no events if consent is not granted, which makes absolutely no sense, we should be able to send anonymous logs.

@maxep
Copy link
Member

maxep commented Mar 12, 2024

Hello @MaximBazarov 👋

The purpose of the consent tracking feature is to avoid the propagation of PII without the end user’s consent. Therefore, the tracking consent is indeed set for an entire core instance because we correlate data by default, meaning that logs, traces, rum events, etc.. are linked together and follow the same rule regarding privacy consent.

If you want to apply a different consent value for traces and logs, you can enable these features in a different core instance that has consent granted. This way, the data won’t be correlated with RUM so we won’t be collecting user-data. However, by doing so, you should refrain from sending any potential PII in logs or span tags and we cannot be held accountable for any PII being sent through this pattern.

To instantiate the default core with the actual user consent:

Datadog.initialize(
  with: ...,
  trackingConsent: trackingConsent
)

RUM.enable(with: ...)

To instance a second core with .granted consent:

let grantedCore = Datadog.initialize(
  with: ...,
  trackingConsent: .granted,
  instanceName: "core-bypass-consent"
)

Logs.enable(with: ..., in: grantedCore)
Trace.enable(with: ..., in: grantedCore)

You can then retrieve the core at any time:

let grantedCore = DatadogCore.sdkInstance(named: "core-bypass-consent")
let logger = Logger.create(in: grantedCore)
let tracer = Tracer.shared(in: grantedCore)

I hope this helps, let me know if you need further info.

@maxep maxep closed this as completed Mar 12, 2024
@MaximBazarov
Copy link
Author

Hey @maxep thank you for the response!

Yes that's a good workaround, it's fun how I wrote almost identical code :D, kudos on having this core as a source of truth for instruments.

I just think this something that could be an improvement to the SDK, to strip all the automatic collection/transmission of the PII context if consent to that is not granted, but still allow sending logs that initiated by the system and leave developers to make sure what they trace is not a subject.

@maxep
Copy link
Member

maxep commented Mar 15, 2024

Hi @MaximBazarov

That's a fair call, I will bring this topic to the team 👍

Apple is also adding an extra layer for privacy control and are now requiring Privacy Manifests declaration. Performance data are subject of it, so even with looser rules on our side, reporting could be blocked by the system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants