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

RUMM-3355 Core v2 Configuration #1332

Merged
merged 5 commits into from
Jun 28, 2023
Merged

Conversation

maxep
Copy link
Member

@maxep maxep commented Jun 26, 2023

What and why?

Introduce public interface to create a DatadogCore instance.

The Datadog interface will be exposed as DatadogCore in #1335

How?

Default:

import Datadog

Datadog.initialize(
  with: Datadog.Configuration(
    clientToken: "<token>",
    env: "<environment>"
  ),
  trackingConsent: .pending
)

Advanced:

import Datadog

Datadog.initialize(
  with: Datadog.Configuration(
    clientToken: "<token>",
    env: "<environment>",
    site: .us1,
    service: nil,
    bundle: .main,
    batchSize: .medium,
    uploadFrequency: .average,
    additionalConfiguration: [:],
    proxyConfiguration: nil,
    encryption: nil,
    serverDateProvider: nil
  ),
  trackingConsent: .pending
)

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference
  • Add CHANGELOG entry for user facing changes

Custom CI job configuration (optional)

  • Run unit tests
  • Run integration tests
  • Run smoke tests

@maxep maxep self-assigned this Jun 26, 2023
@maxep maxep force-pushed the maxep/RUMM-3355/core-configuration branch from 76da2d5 to aab583a Compare June 26, 2023 11:49
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Jun 26, 2023

Datadog Report

Branch report: maxep/RUMM-3355/core-configuration
Commit report: 4381481

dd-sdk-ios: 0 Failed, 0 New Flaky, 156 Passed, 0 Skipped, 16m 14.33s Wall Time

@maxep maxep force-pushed the maxep/RUMM-3355/core-configuration branch from aab583a to 7cd8f41 Compare June 26, 2023 13:27
@maxep maxep marked this pull request as ready for review June 26, 2023 15:30
@maxep maxep requested a review from a team as a code owner June 26, 2023 15:30
@maxep maxep force-pushed the maxep/RUMM-3355/core-configuration branch 2 times, most recently from 8515fdf to 6f780be Compare June 27, 2023 20:45
Copy link
Member

@ncreated ncreated left a comment

Choose a reason for hiding this comment

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

Really good 👍 - nice to see last V1 things disappear.

let debug = configuration.processInfo.arguments.contains(LaunchArguments.Debug)
if debug {
consolePrint("⚠️ Overriding verbosity, and upload frequency due to \(LaunchArguments.Debug) launch argument")
Datadog.verbosityLevel = .debug
Copy link
Member

Choose a reason for hiding this comment

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

question/ @maxep What is the plan for getting rid of global .verbosityLevel? Do we have necessary items in the backlog?

Copy link
Member Author

Choose a reason for hiding this comment

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

Is there a plan to get rid of it? 🤔
Is is used by DD.logger which is also global and since it's for development it makes sense keep it this way, no?

Copy link
Member

Choose a reason for hiding this comment

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

TBC: sorry, I don't mean "removing it" 🙂. Do we consider attaching .verbosityLevel to SDK core instance, or we want to keep it global? Global would mean seeing logs from all instances of the SDK (even not mine). Whatever we decide it is rather low priority.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah! Indeed, it would make sense to prefix the console-log entry with the core instance name. It will require a core-specific logger in the same manner we want Telemetry per core. I will add a ticket for that 👍

Copy link
Member

Choose a reason for hiding this comment

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

Good idea 👍

@maxep maxep requested a review from ncreated June 28, 2023 08:47
@maxep maxep force-pushed the maxep/RUMM-3355/core-configuration branch 2 times, most recently from 3a64d24 to 1a40a3e Compare June 28, 2023 10:26
@maxep maxep requested a review from a team as a code owner June 28, 2023 15:13
@maxep maxep force-pushed the maxep/RUMM-3355/core-configuration branch from d07e4a0 to 1a40a3e Compare June 28, 2023 15:15
@maxep maxep removed the request for review from a team June 28, 2023 15:35
@maxep maxep force-pushed the maxep/RUMM-3355/core-configuration branch from 1a40a3e to 4381481 Compare June 28, 2023 16:37
Copy link
Member

@ncreated ncreated left a comment

Choose a reason for hiding this comment

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

🏅 🏆

@maxep maxep merged commit b41fb9e into feature/v2 Jun 28, 2023
@maxep maxep deleted the maxep/RUMM-3355/core-configuration branch June 28, 2023 18:11
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