Skip to content

Commit

Permalink
trace log
Browse files Browse the repository at this point in the history
  • Loading branch information
zirain committed Dec 30, 2024
1 parent 776adc9 commit 1594c45
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void MetadataExchangeFilter::writeNodeMetadata() {
if (conn_state_ != WriteMetadata) {
return;
}

ENVOY_LOG(trace, "Writing metadata to the connection.");
ProtobufWkt::Struct data;
const auto obj = Istio::Common::convertStructToWorkloadMetadata(local_info_.node().metadata(),
config_->additional_labels_);
Expand Down Expand Up @@ -264,6 +264,7 @@ void MetadataExchangeFilter::tryReadProxyData(Buffer::Instance& data) {
}

void MetadataExchangeFilter::updatePeer(const Istio::Common::WorkloadMetadataObject& obj) {
ENVOY_LOG(trace, "updatePeer {}", obj.identity_);
read_callbacks_->connection().streamInfo().filterState()->setData(
config_->filter_direction_ == FilterDirection::Downstream ? Istio::Common::DownstreamPeer
: Istio::Common::UpstreamPeer,
Expand All @@ -280,6 +281,7 @@ void MetadataExchangeFilter::setMetadataNotFoundFilterState() {
ENVOY_LOG(debug, "Look up metadata based on peer address {}", peer_address->asString());
const auto metadata_object = config_->metadata_provider_->GetMetadata(peer_address);
if (metadata_object) {
ENVOY_LOG(trace, "Metadata found for peer address {}", peer_address->asString());
updatePeer(metadata_object.value());
config_->stats().metadata_added_.inc();
return;
Expand Down

0 comments on commit 1594c45

Please sign in to comment.