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

Adding EmbraceSemantics module #27

Merged
merged 6 commits into from
Aug 7, 2024
Merged

Adding EmbraceSemantics module #27

merged 6 commits into from
Aug 7, 2024

Conversation

NachoEmbrace
Copy link
Contributor

  • Main purpose of this module is to not duplicate constants through out the code.
  • This being a public module would also allow users of the SDK to generate OTel data using Embrace's semantics.
  • Removed the usage of constants in tests (we do want hardcoded values there).

Copy link

github-actions bot commented Jul 29, 2024

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Manifest Files

Copy link

github-actions bot commented Jul 29, 2024

Warnings
⚠️ No CHANGELOG entry added.
⚠️

Package.swift#L32 - Collection literals should not have trailing commas (trailing_comma)

⚠️

Package.swift#L54 - Collection literals should not have trailing commas (trailing_comma)

⚠️

Sources/EmbraceCore/Capture/UX/Tap/TapCaptureService.swift#L137 - Returning Void in a function declaration is redundant (redundant_void_return)

⚠️

Sources/EmbraceCore/Capture/UX/View/ViewCaptureService+didAppear.swift#L55 - Returning Void in a function declaration is redundant (redundant_void_return)

⚠️

Tests/EmbraceCoreTests/Capture/Network/DefaultURLSessionTaskHandlerTests.swift#L196 - Prefer using UTF-8 encoded strings when converting between String and Data (non_optional_string_data_conversion)

Generated by 🚫 Danger Swift against 68a2f59

Copy link

codecov bot commented Jul 29, 2024

Codecov Report

Attention: Patch coverage is 95.54455% with 9 lines in your changes missing coverage. Please review.

Project coverage is 91.69%. Comparing base (b17b00d) to head (b5f6a7c).
Report is 5 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #27      +/-   ##
==========================================
+ Coverage   91.66%   91.69%   +0.02%     
==========================================
  Files         386      384       -2     
  Lines       18169    18107      -62     
==========================================
- Hits        16655    16603      -52     
+ Misses       1514     1504      -10     
Files Coverage Δ
...ources/EmbraceCommonInternal/LogType/LogType.swift 96.66% <100.00%> (ø)
...rces/EmbraceCommonInternal/SpanType/SpanType.swift 100.00% <100.00%> (ø)
...ceCore/Capture/Network/URLSessionTaskHandler.swift 97.29% <100.00%> (+0.42%) ⬆️
...apture/System/LowMemoryWarningCaptureService.swift 100.00% <100.00%> (ø)
...stem/LowPowerMode/LowPowerModeCaptureService.swift 95.34% <100.00%> (+0.34%) ⬆️
...EmbraceCore/Capture/UX/Tap/TapCaptureService.swift 94.52% <100.00%> (ø)
...Capture/UX/View/ViewCaptureService+didAppear.swift 92.30% <100.00%> (+1.00%) ⬆️
...ceCore/Capture/WebView/WebViewCaptureService.swift 83.33% <100.00%> (+1.31%) ⬆️
...re/Internal/Logs/EmbraceLogAttributesBuilder.swift 91.52% <100.00%> (ø)
...rnal/Logs/Exporter/StorageEmbraceLogExporter.swift 90.90% <100.00%> (ø)
... and 22 more

... and 8 files with indirect coverage changes

@atreat
Copy link
Contributor

atreat commented Jul 30, 2024

Like the separation of these constants and how it's organized into a well name-spaced spot. It may be useful to differentiate OpenTelemetry semantic conventions from those that are Embrace specific (until we can get those pushed upstream).

It may be enough to reference these semantic conventions directly in SemanticAttributes This would let people follow the definition through to the source.

Tried referencing the SemanticAttributes directly and realized it would probably be more of a headache to manage when conventions change but we're using an older version of the otel-swift dependency. May be easier to just have a comment on the NetworkRequest struct that links to the opentelemtry.io semantic conventions page.

…the `emb.type` attribute.

Update SpanType, LogType to conform to new protocol
Adds SpanEventType which also conforms to new protocol
@atreat
Copy link
Contributor

atreat commented Aug 2, 2024

@NachoEmbrace added a commit to this branch to make the EmbraceType implementation be in one spot. It also allows us to attach these to new telemetry types ( I also added SpanEventType).

Hoping this means we can have telemetry specific declarations and interfaces, but a common implementation to what the value of emb.type means.

# Conflicts:
#	Sources/EmbraceCore/Capture/Network/URLSessionTaskHandler.swift
@NachoEmbrace NachoEmbrace merged commit 4f060e9 into main Aug 7, 2024
10 checks passed
@NachoEmbrace NachoEmbrace deleted the embrace_semantics branch August 7, 2024 15:21
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