Skip to content

tracing: allow tracers to be configured with a collector cluster added via CDS#10526

Merged
mattklein123 merged 10 commits intoenvoyproxy:masterfrom
yskopets:feature/allow-tracers-to-be-configured-with-cds-clusters
Mar 28, 2020
Merged

tracing: allow tracers to be configured with a collector cluster added via CDS#10526
mattklein123 merged 10 commits intoenvoyproxy:masterfrom
yskopets:feature/allow-tracers-to-be-configured-with-cds-clusters

Conversation

@yskopets
Copy link
Member

@yskopets yskopets commented Mar 25, 2020

Description: allow tracers to be configured with a collector cluster added via CDS
Risk Level: Medium
Testing: unit tests
Docs Changes: N/A
Release Notes: N/A

Context:

…r added via CDS

Signed-off-by: Yaroslav Skopets <yaroslav@tetrate.io>
…er added via CDS

Signed-off-by: Yaroslav Skopets <yaroslav@tetrate.io>
…ster added via CDS

Signed-off-by: Yaroslav Skopets <yaroslav@tetrate.io>
@yskopets yskopets requested a review from mattklein123 as a code owner March 25, 2020 22:40
@mattklein123 mattklein123 self-assigned this Mar 26, 2020
@yskopets
Copy link
Member Author

/retest

@repokitteh-read-only
Copy link

🔨 rebuilding ci/circleci: coverage (failed build)

🐱

Caused by: a #10526 (comment) was created by @yskopets.

see: more, trace.

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks LGTM at a high level with some small comments. Thanks for working on this!

/wait

driver_.clusterManager()
.httpAsyncClientForCluster(driver_.cluster()->name())
.send(std::move(message), *this,
if (driver_.clusterManager().get(driver_.cluster())) {
Copy link
Member

Choose a reason for hiding this comment

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

Optimally you would use the thread local cluster manager callbacks here to avoid this lookup every time. Perhaps put in a TODO for that if you don't want to do it now? It's possible that a helper base/mix-in class could be used for this across tracers and other similar cases. (Comment applies to all the other tracers.)

Copy link
Member Author

Choose a reason for hiding this comment

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

I've implemented it for Zipkin tracer. Please take a look.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've implemented cluster manager callbacks for the remaining tracers.

Signed-off-by: Yaroslav Skopets <yaroslav@tetrate.io>
Signed-off-by: Yaroslav Skopets <yaroslav@tetrate.io>
Signed-off-by: Yaroslav Skopets <yaroslav@tetrate.io>
Signed-off-by: Yaroslav Skopets <yaroslav@tetrate.io>
…acks

Signed-off-by: Yaroslav Skopets <yaroslav@tetrate.io>
…cers-to-be-configured-with-cds-clusters

Signed-off-by: Yaroslav Skopets <yaroslav@tetrate.io>
@yskopets yskopets requested a review from mattklein123 March 27, 2020 18:39
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks LGTM other than a comment to share the callback code. Thank you!

/wait

}
}

void TraceReporter::onClusterAddOrUpdate(Upstream::ThreadLocalCluster& cluster) {
Copy link
Member

Choose a reason for hiding this comment

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

Can you move this into some kind of base class/mix-in shared by each tracer? I think it should be pretty easy to do.

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

I had to sacrifice ENVOY_LOG(debug, ...) statement, though.

…mponent

Signed-off-by: Yaroslav Skopets <yaroslav@tetrate.io>
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Fantastic work, thanks!

htuch pushed a commit that referenced this pull request Nov 23, 2020
#10526 allowed tracers to use CDS clusters. But zipkin proto doc still says bootstrap cluster is mandatory

Risk Level: Low
Testing: N/A

Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
qqustc pushed a commit to qqustc/envoy that referenced this pull request Nov 24, 2020
envoyproxy#10526 allowed tracers to use CDS clusters. But zipkin proto doc still says bootstrap cluster is mandatory

Risk Level: Low
Testing: N/A

Signed-off-by: Rama Chavali <rama.rao@salesforce.com>
Signed-off-by: Qin Qin <qqin@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants