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-3460 feat: Add "Batch Closed" telemetry #1386

Merged
merged 2 commits into from
Jul 24, 2023

Conversation

ncreated
Copy link
Collaborator

@ncreated ncreated commented Jul 21, 2023

What and why?

📦⏱️ Adding "Batch Closed" metric.

See (internal) RFC Batching & Upload Observability.

How?

Leveraged metrics API added earlier in #1384.

With this PR, I'm adding full unit tests coverage for both metrics creation in FilesOrchestrator.

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

@ncreated ncreated self-assigned this Jul 21, 2023
@ncreated ncreated changed the title RUMM-3460 Add "Batch Closed" telemetry RUMM-3460 feat: Add "Batch Closed" telemetry Jul 21, 2023
@ncreated ncreated marked this pull request as ready for review July 21, 2023 17:18
@ncreated ncreated requested a review from a team as a code owner July 21, 2023 17:18
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Jul 21, 2023

Datadog Report

Branch report: ncreated/RUMM-3460/batch-completed-telemetry
Commit report: f3d60f6

dd-sdk-ios: 0 Failed, 0 New Flaky, 118 Passed, 0 Skipped, 2m 35.9s Wall Time

Copy link
Contributor

@ganeshnj ganeshnj left a comment

Choose a reason for hiding this comment

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

💯 test cases, nice work.

@@ -92,3 +93,23 @@ internal enum BatchDeletedMetric {
}
}
}

/// Definition of "Batch Closed" telemetry.
internal enum BatchClosedMetric {
Copy link
Contributor

Choose a reason for hiding this comment

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

non blocking, but would have preferred this as struct with method toAttributes() -> expected type which makes it easier handle any conversion.

Copy link
Collaborator Author

@ncreated ncreated Jul 24, 2023

Choose a reason for hiding this comment

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

I have been thinking of it, but I decided to keep it bare simple, as we introduce a new concept here and not yet sure which direction it will go. Moving from "static constants" model to a "type" won't cost much in the future.

For instance, one idea I had was to define Metric protocol that enforces common fields: name, metric_type and attributes. That could be passed directly to telemetry.metric(_:) in a type-safer way, instead of broad telemetry.metric(name:attributes:) introduced by this PR.

With few options in hand and no foresight future, I bet on simplicity for now, so will keep it as it is.

Copy link
Member

@maxep maxep left a comment

Choose a reason for hiding this comment

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

👌

Base automatically changed from ncreated/RUMM-3459/batch-deleted-telemetry to develop July 24, 2023 16:26
@ncreated ncreated merged commit 63506fc into develop Jul 24, 2023
7 checks passed
@ncreated ncreated deleted the ncreated/RUMM-3460/batch-completed-telemetry branch July 24, 2023 17:29
@ncreated ncreated mentioned this pull request Jul 25, 2023
6 tasks
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.

3 participants