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

Merge stackdriver-core-dependencies feature branch to master #1162

Merged
merged 21 commits into from
Dec 21, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
bee7781
Update google-cloud-logging to use trace context tracking from core
dazuma Dec 2, 2016
ab50c20
Trace instrumentation
dazuma Oct 26, 2016
6a75b24
Frontload require of version.rb so the trace gem will load without th…
dazuma Dec 14, 2016
bbf3345
Restore (but deprecate) earlier logger API for now.
dazuma Dec 14, 2016
26ce73d
Restore doctest notice for google-cloud-trace
dazuma Dec 14, 2016
ffcf821
Basic acceptance tests for google-cloud-trace
dazuma Dec 15, 2016
d5af77d
Logger object understands all attributes supported by the stdlib Logger
dazuma Dec 15, 2016
ff10785
Cloud Logger supports all remaining stdlib Logger methods.
dazuma Dec 15, 2016
6bc5fc7
Ensure AsyncWriter threads finish on VM exit
dazuma Dec 15, 2016
5f47636
Improve Logging::Railtie activation warning messages
hxiong388 Dec 16, 2016
b1da405
Update and clarify docs for google-cloud-trace
dazuma Dec 16, 2016
4db6a30
Improve the Logger activation warning messages even more
hxiong388 Dec 17, 2016
73db861
Remove orphaned span hack from middleware, and fix conversion of orph…
dazuma Dec 17, 2016
dcc3774
Document capture_stack rails config
dazuma Dec 18, 2016
b0eb908
Best Logger activation warning messages ever!
hxiong388 Dec 19, 2016
b1c31bc
Fix examples related to thread traces
dazuma Dec 19, 2016
b83c2a6
Trace sampler interface is now just a Proc
dazuma Dec 19, 2016
d93935c
Rename to_proto/from_proto to to_grpc/from_grpc for trace models
dazuma Dec 19, 2016
8c806a8
Update docs to clarify how blacklisting and sampling work
dazuma Dec 20, 2016
eac4d89
Change proto to grpc terminology in Utils
dazuma Dec 20, 2016
7e38bc5
Update google-cloud-core dependency for logging and trace to pick up …
dazuma Dec 21, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename to_proto/from_proto to to_grpc/from_grpc for trace models
  • Loading branch information
dazuma authored and blowmage committed Dec 21, 2016
commit d93935c91d8956fb2ebdbad73df6b78ffd000d4a
2 changes: 1 addition & 1 deletion google-cloud-trace/lib/google/cloud/trace/result_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def self.from_gax_page service, project_id,
next_page_token = page.next_page_token
next_page_token = nil unless page.next_page_token?
results = page.map do |proto|
Google::Cloud::Trace::TraceRecord.from_proto proto
Google::Cloud::Trace::TraceRecord.from_grpc proto
end
new service, project_id,
results, next_page_token,
Expand Down
4 changes: 2 additions & 2 deletions google-cloud-trace/lib/google/cloud/trace/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def patch_traces traces
traces = Array(traces)
traces_proto = Google::Devtools::Cloudtrace::V1::Traces.new
traces.each do |trace|
traces_proto.traces.push trace.to_proto
traces_proto.traces.push trace.to_grpc
end
execute do
lowlevel_client.patch_traces @project, traces_proto
Expand All @@ -107,7 +107,7 @@ def get_trace trace_id
trace_proto = execute do
lowlevel_client.get_trace @project, trace_id
end
Google::Cloud::Trace::TraceRecord.from_proto trace_proto
Google::Cloud::Trace::TraceRecord.from_grpc trace_proto
end

##
Expand Down
4 changes: 2 additions & 2 deletions google-cloud-trace/lib/google/cloud/trace/span.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def eql? other
# to contain the span.
# @return [Google::Cloud::Trace::Span] A corresponding Span object.
#
def self.from_proto span_proto, trace
def self.from_grpc span_proto, trace
labels = {}
span_proto.labels.each { |k, v| labels[k] = v }
span_kind = SpanKind.get span_proto.kind
Expand All @@ -173,7 +173,7 @@ def self.from_proto span_proto, trace
# @return [Google::Devtools::Cloudtrace::V1::TraceSpan] The generated
# protobuf.
#
def to_proto default_parent_id = 0
def to_grpc default_parent_id = 0
start_proto = Google::Cloud::Trace::Utils.time_to_proto start_time
end_proto = Google::Cloud::Trace::Utils.time_to_proto end_time
Google::Devtools::Cloudtrace::V1::TraceSpan.new \
Expand Down
10 changes: 5 additions & 5 deletions google-cloud-trace/lib/google/cloud/trace/trace_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module Trace
# span = trace.create_span "root_span"
# subspan = span.create_span "subspan"
#
# trace_proto = trace.to_proto
# trace_proto = trace.to_grpc
#
class TraceRecord
##
Expand Down Expand Up @@ -79,7 +79,7 @@ def eql? other
# @return [Trace, nil] A corresponding Trace object, or `nil` if the
# proto does not represent an existing trace object.
#
def self.from_proto trace_proto
def self.from_grpc trace_proto
trace_id = trace_proto.trace_id.to_s
return nil if trace_id.empty?

Expand All @@ -105,9 +105,9 @@ def self.from_proto trace_proto
# @return [Google::Devtools::Cloudtrace::V1::Trace] The generated
# protobuf.
#
def to_proto
def to_grpc
span_protos = @spans_by_id.values.map do |span|
span.to_proto trace_context.span_id.to_i
span.to_grpc trace_context.span_id.to_i
end
Google::Devtools::Cloudtrace::V1::Trace.new \
project_id: project,
Expand Down Expand Up @@ -320,7 +320,7 @@ def add_span_protos span_protos, parent_span_ids
new_span_ids = ::Set.new
span_protos.each do |span_proto|
if parent_span_ids.include? span_proto.parent_span_id
Google::Cloud::Trace::Span.from_proto span_proto, self
Google::Cloud::Trace::Span.from_grpc span_proto, self
new_span_ids.add span_proto.span_id
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@
labels: sub_labels)
]

trace.to_proto.must_equal proto
Google::Cloud::Trace::TraceRecord.from_proto(proto).must_equal trace
trace.to_grpc.must_equal proto
Google::Cloud::Trace::TraceRecord.from_grpc(proto).must_equal trace
end

it "converts to and from a protobuf with an orphaned span" do
Expand Down Expand Up @@ -298,7 +298,7 @@
labels: sub_labels)
]

trace.to_proto.must_equal proto
Google::Cloud::Trace::TraceRecord.from_proto(proto).must_equal trace
trace.to_grpc.must_equal proto
Google::Cloud::Trace::TraceRecord.from_grpc(proto).must_equal trace
end
end