-
Notifications
You must be signed in to change notification settings - Fork 375
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
ekump/decouple core transport #3150
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
406c01b
WIP: Moving transport traces to tracing
ekump c6d2028
move ddtrace/transport to tracing and update file references
ekump 84ce9f3
namespace Datadog::Transport from ddtrace to DDatadog::Tracing::Trans…
ekump 90c280d
move Core::Transport to Core::Remote::Transport
ekump 918cfc2
move Transport::HTTP::API::Map and Fallback to core
ekump 2cb1a15
move tracing::transport::http::env to core
ekump 5754c16
move tracing::transport::request to core
ekump 35fea19
move tracing::transport::http::response to core
ekump bdb8945
move tracing::transport::http::adapters to core
ekump c2cf885
move datadog::tracing::transport::http::api::endpoint and tracing::tr…
ekump a00f91f
move Tracing::Transport::Response to core
ekump 667cfb3
fixing contrib tests for transport refactor
ekump 68c0e8a
fix bad merge for faux_writer
ekump 96a411f
fix rubocop errors
ekump e9d47d2
cleanup TODOs for transport refactor
ekump 32d7c6c
creating Datadog::Core::Transport::Ext
ekump 02b6c42
cleaning up contrib test failures
ekump a4c0001
export Datadog::Core::Transport::Ext to Datadog::Transport::Ext in dd…
ekump ffc5cb8
cleaning up rubocop errors
ekump 4ca9b95
move rbs files to correct folders for transport refactor
ekump 01e2fac
update namespace for decoupling transport
ekump caecc2c
forgot to properly namespace Datadog::Core::Transport::HTTP::Env
ekump File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../../../core/transport/request' | ||
require_relative '../../../core/transport/parcel' | ||
|
||
module Datadog | ||
module Core | ||
module Remote | ||
module Transport | ||
module Config | ||
# Data transfer object for encoded traces | ||
class EncodedParcel | ||
include Datadog::Core::Transport::Parcel | ||
|
||
def count | ||
data.length | ||
end | ||
end | ||
|
||
# Config request | ||
class Request < Datadog::Core::Transport::Request | ||
end | ||
|
||
# Config response | ||
module Response | ||
attr_reader :roots, :targets, :target_files, :client_configs | ||
|
||
def empty? | ||
@empty | ||
end | ||
end | ||
|
||
# Config transport | ||
class Transport | ||
attr_reader :client, :apis, :default_api, :current_api_id | ||
|
||
def initialize(apis, default_api) | ||
@apis = apis | ||
|
||
@client = HTTP::Client.new(current_api) | ||
end | ||
|
||
##### there is only one transport! it's negotiation! | ||
def send_config(payload) | ||
json = JSON.dump(payload) | ||
parcel = EncodedParcel.new(json) | ||
request = Request.new(parcel) | ||
|
||
@client.send_config_payload(request) | ||
end | ||
|
||
def current_api | ||
@apis[HTTP::API::V7] | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Nice cleanup!