-
Notifications
You must be signed in to change notification settings - Fork 50
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
jetbrains: Generate OpenTelemetry-style metric builders #899
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rli
force-pushed
the
rli/otel-generator
branch
from
October 30, 2024 00:07
ca7f327
to
b78a7b5
Compare
manodnyab
approved these changes
Nov 4, 2024
justinmk3
reviewed
Nov 4, 2024
...sources/generatesOTelWithNormalInput/output/software/aws/toolkits/telemetry/impl/BaseSpan.kt
Outdated
Show resolved
Hide resolved
justinmk3
approved these changes
Nov 4, 2024
rli
added a commit
to aws/aws-toolkit-jetbrains
that referenced
this pull request
Nov 5, 2024
The OpenTelemetry SDK can automatically attach the same trace ID to spans recorded under the same 'context'. This is somewhat challenging because the JetBrains platform frequently requires switching threads and coroutine scope contexts, which loses the `ThreadLocal` state needed to connect parent->child when spans are started. This on its own is not too difficult, but becomes a significant ergonomic challenge when we also want to bring some type-safety to how span metadata is built. This PR allows spans generated in aws/aws-toolkit-common#899 to automatically perform context propagation. See internal documentation for details. A contributor-friendly version of the doc will be written after we validate this pattern with some initial metrics.
rli
added a commit
to aws/aws-toolkit-jetbrains
that referenced
this pull request
Nov 6, 2024
…5027) * Depends on #4982 * Depends on aws/aws-toolkit-common#899 * Rename Unit -> MetricUnit directly in SDK codegen * Use newer provider convention syntax for input/output in generator task * expose `passive`/`unit`/`value` as special fields * add smoke test for `validateRequiredAttributes`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
At the moment, metrics in the JetBrains extensions are collected as singular datapoints independent of each other. Modern observability frameworks, as well as our long-term goals are to be able to correlate these data flows over a single user flow. This requires the 'trace ID' concept which is high-friction in the current model.
Solution
Generate 'fluent builders' that wrap the OpenTelemetry SDK to allow us to leverage the SDK to record trace/span IDs automatically, but still expose a good amount of type safety based on the metric schema. This PR references base classes proposed in aws/aws-toolkit-jetbrains#4982.
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.