Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

feat: add getProjectId and getCurrentRootSpan#782

Merged
kjin merged 1 commit intogoogleapis:masterfrom
kjin:new-api
Jun 22, 2018
Merged

feat: add getProjectId and getCurrentRootSpan#782
kjin merged 1 commit intogoogleapis:masterfrom
kjin:new-api

Conversation

@kjin
Copy link
Copy Markdown
Contributor

@kjin kjin commented Jun 20, 2018

This PR adds two methods on the TraceAgent class, getProjectId and getCurrentRootSpan, which should supercede getWriterProjectId and getCurrentContextId respectively. It also uses TraceWriter#projectId instead of TraceWriter#config.projectId to store the retrieved project ID, because this is already the behavior of Service. In practice, this fixes a regression with getProjectId.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 20, 2018
@kjin kjin force-pushed the new-api branch 3 times, most recently from 2ce40ca to 9a9e43b Compare June 21, 2018 00:28
@kjin kjin requested a review from a team June 21, 2018 16:56
Comment thread src/trace-api.ts Outdated
// In v3, this will be deprecated for getCurrentRootSpan.
const traceContext = this.getCurrentRootSpan().getTraceContext();
const parsedTraceContext = util.parseContextFromHeader(traceContext);
if (parsedTraceContext) {

This comment was marked as spam.

@kjin kjin merged commit f7ae770 into googleapis:master Jun 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants