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

Update google-cloud-logging to use trace context tracking from core #1136

Merged

Conversation

dazuma
Copy link
Member

@dazuma dazuma commented Dec 14, 2016

This PR includes two related changes in google-cloud-logging.

  • The middleware uses stackdriver-core to obtain trace context instead of attempting to read it itself. As a result, stackdriver-core is now a gem dependency (as well as a dependency of gcloud, google-cloud, and stackdriver)
  • The middleware allows setting the log name by path (so that, e.g. health checks in App Engine Flex can be directed to a separate log and don't spam the main app log.)

This PR is being directed to a feature branch for now because it is dependent on the release of the stackdriver-core gem.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 14, 2016
@dazuma
Copy link
Member Author

dazuma commented Dec 14, 2016

CircleCI failure seems to be unrelated:

  1) Error:
Google::Cloud.speech#test_0001_:
RuntimeError: This code example is not yet mocked
    /home/ubuntu/google-cloud-ruby/google-cloud-speech/support/doctest_helper.rb:69:in `new'
    /home/ubuntu/google-cloud-ruby/google-cloud-speech/lib/google-cloud-speech.rb:105:in `speech'
    /opt/circleci/.rvm/gems/ruby-2.3.1/gems/yard-doctest-0.1.8/lib/yard/doctest/example.rb:77:in `context'
    /home/ubuntu/google-cloud-ruby/google-cloud-speech/lib/google-cloud-speech.rb:102
    /opt/circleci/.rvm/gems/ruby-2.3.1/gems/yard-doctest-0.1.8/lib/yard/doctest/example.rb:56:in `eval'
    /opt/circleci/.rvm/gems/ruby-2.3.1/gems/yard-doctest-0.1.8/lib/yard/doctest/example.rb:56:in `evaluate_example'
    /opt/circleci/.rvm/gems/ruby-2.3.1/gems/yard-doctest-0.1.8/lib/yard/doctest/example.rb:43:in `block (4 levels) in generate'
    /opt/circleci/.rvm/gems/ruby-2.3.1/gems/yard-doctest-0.1.8/lib/yard/doctest/example.rb:40:in `each'
    /opt/circleci/.rvm/gems/ruby-2.3.1/gems/yard-doctest-0.1.8/lib/yard/doctest/example.rb:40:in `block (3 levels) in generate'

@blowmage
Copy link
Contributor

The rebuild passed, so its probably nothing to worry too hard about for now.

I can't recreate the failure locally. Its possible that it was a fluke or that there is a way of sorting the speech doctest tests that will cause it to fail. @quartzmo this is something to keep in mind.

attr_reader :trace_ids
# A OrderedHash of Thread IDs to RequestInfo, keeping track of data
# associated with the request being handled by the current thread.
attr_reader :request_info

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

def add_trace_id trace_id
trace_ids[current_thread_id] = trace_id
# @param [RequestInfo] info Info about the current request
def add_request_info info

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

# Stackdriver services.
attr_reader :trace_ids
# A OrderedHash of Thread IDs to RequestInfo, keeping track of data
# associated with the request being handled by the current thread.

This comment was marked as spam.

This comment was marked as spam.

@dazuma dazuma merged commit ab558c4 into googleapis:stackdriver-core-dependencies Dec 15, 2016
@dazuma dazuma deleted the logging-trace-context branch December 15, 2016 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants