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

Fix span batching to stackdriver #425

Merged

Conversation

kornholi
Copy link
Contributor

@kornholi kornholi commented Dec 4, 2018

Currently every trace is being exported individually, burning through Stackdriver quota.

screen shot 2018-12-03 at 6 00 29 pm

This change was deployed at 5:46 PM.

@c24t @liyanhui1228 could you take a look?

@c24t
Copy link
Member

c24t commented Dec 4, 2018

@kornholi is this fixing a regression in the stackdriver exporter or an improvement?

@kornholi
Copy link
Contributor Author

kornholi commented Dec 5, 2018

Regression from #291

Copy link
Member

@c24t c24t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please file a ticket for the stackdriver quota issue (instead of the FIXME comment) if this is still causing problems for you.

# Write spans to Stackdriver
for _, sds in trace_span_map.items():
# convert to the legacy trace json for easier refactoring
# TODO: refactor this to use the span data directly
trace = span_data.format_legacy_trace_json(sds)
stackdriver_spans = self.translate_to_stackdriver(trace)
self.client.batch_write_spans(project, stackdriver_spans)
stackdriver_spans.extend(self.translate_to_stackdriver(trace))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity: why change this to a generator if you're just appending the results?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to avoid intermediate lists

@bogdandrutu bogdandrutu merged commit 1f47a11 into census-instrumentation:master Dec 6, 2018
@kornholi kornholi deleted the fix/stackdriver-batching-2 branch December 6, 2018 03:13
c24t pushed a commit to c24t/opencensus-python that referenced this pull request Jan 16, 2019
* Fix span batching to stackdriver

* Lose FIXME comment
@c24t c24t mentioned this pull request Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants