-
Notifications
You must be signed in to change notification settings - Fork 275
fix(fix): Fix/otel compat #6119
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
Open
aseemxs
wants to merge
6
commits into
aws:main
Choose a base branch
from
aseemxs:fix/otel-compat
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+9
−176
Conversation
This file contains hidden or 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
…re file Address PR review feedback to avoid copying entire OTelService.kt for version compatibility. Changes: - Move OTelService.kt to common src/ directory (168 lines, shared by all versions) - Create small version-specific HttpPostCompat.kt files (18-19 lines each) - Eliminates 137 lines of code duplication - Main logic now maintained in single location The httpPost API changed between IDE versions 2024.2-2025.2 and 2025.3+: - Old API uses contentLength parameter with streaming body - New API uses body parameter with byte array Follows existing codebase pattern (see PythonModuleUtil.kt, JavascriptLanguage.kt) for handling compile-time API incompatibilities with minimal duplication.
...munity/src-242-252/software/aws/toolkits/jetbrains/services/telemetry/otel/HttpPostCompat.kt
Fixed
Show fixed
Hide fixed
...munity/src-242-252/software/aws/toolkits/jetbrains/services/telemetry/otel/HttpPostCompat.kt
Fixed
Show fixed
Hide fixed
8f1e9a9 to
543169d
Compare
rli
reviewed
Nov 20, 2025
...community/src-253+/software/aws/toolkits/jetbrains/services/telemetry/otel/HttpPostCompat.kt
Outdated
Show resolved
Hide resolved
rli
reviewed
Nov 20, 2025
...munity/src-242-252/software/aws/toolkits/jetbrains/services/telemetry/otel/HttpPostCompat.kt
Outdated
Show resolved
Hide resolved
Address PR review feedback - use Apache HttpClient instead of platform httpPost API. Changes: - Replace IntelliJ Platform httpPost with Apache HttpClient - Works consistently across all IDE versions (2024.2 - 2025.3+) - Matches existing pattern used in SigV4OtlpSpanProcessor - No version-specific compatibility wrappers needed - Single OTelService.kt in common src/ directory This approach: - Uses same HTTP library as CawsEnvironmentClient and SigV4OtlpSpanProcessor - Avoids platform API incompatibilities between IDE versions - Follows established codebase patterns for HTTP operations
rli
reviewed
Nov 20, 2025
|
|
||
| httpPost(traceUrl, contentLength = item.binarySerializedSize.toLong(), contentType = ContentType.XProtobuf) { | ||
| item.writeBinaryTo(this) | ||
| HttpClients.createDefault().use { client -> |
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does not respect IDE proxy settings nor uses our custom user agent. see HttpUtils/HttpRequests
Use IntelliJ's HttpRequests API instead of Apache HttpClient to respect IDE proxy settings and use AWS Toolkit user agent.
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.
Types of changes
Description
Address PR #6098 review feedback to avoid duplicating OTelService.kt across version directories.
Changes:
src/directory (shared by all IDE versions)HttpPostCompat.kthelper files (18-19 lines each)Technical Details:
The
httpPostAPI changed between IDE versions 2024.2-2025.2 and 2025.3+:httpPost(url, contentLength, contentType) { body }httpPost(url, contentType, body = bytes)Follows existing codebase patterns (PythonModuleUtil, JavascriptLanguage) for handling compile-time API incompatibilities with minimal duplication.
Related: #6098
Checklist
License
I confirm that my contribution is made under the terms of the Apache 2.0 license.