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

use peer_metadata to get pod metadata info from istiod #411

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

YaoZengzeng
Copy link
Member

What type of PR is this?

/kind enhancement

use peer_metadata http filter to get pod metadata from istiod

What this PR does / why we need it:

So we could get necessary fields to fill observability information

Before this modification, the metric is :

istio_requests_total{reporter="destination",source_workload="unknown",source_canonical_service="unknown",source_canonical_revision="latest",source_workload_namespace="unknown",source_principal="unknown",source_app="unknown",source_version="unknown",source_cluster="unknown",destination_workload="reviews-v1",destination_workload_namespace="default",destination_principal="unknown",destination_app="unknown",destination_version="unknown",destination_service="reviews.default.svc.cluster.local",destination_canonical_service="reviews",destination_canonical_revision="v1",destination_service_name="reviews",destination_service_namespace="default",destination_cluster="Kubernetes",request_protocol="http",response_code="200",grpc_response_status="",response_flags="-",connection_security_policy="none"} 93

After this modification:

istio_requests_total{reporter="destination",source_workload="productpage-v1",source_canonical_service="productpage",source_canonical_revision="v1",source_workload_namespace="default",source_principal="unknown",source_app="productpage",source_version="v1",source_cluster="Kubernetes",destination_workload="reviews-v1",destination_workload_namespace="default",destination_principal="unknown",destination_app="unknown",destination_version="unknown",destination_service="reviews.default.svc.cluster.local",destination_canonical_service="reviews",destination_canonical_revision="v1",destination_service_name="reviews",destination_service_namespace="default",destination_cluster="Kubernetes",request_protocol="http",response_code="200",grpc_response_status="",response_flags="-",connection_security_policy="none"} 1

And the metric from waypoint in ambient mesh:

istio_requests_total{reporter="destination",source_workload="productpage-v1",source_canonical_service="productpage",source_canonical_revision="v1",source_workload_namespace="default",source_principal="spiffe://cluster.local/ns/default/sa/bookinfo-productpage",source_app="productpage",source_version="v1",source_cluster="Kubernetes",destination_workload="reviews-v1",destination_workload_namespace="default",destination_principal="spiffe://cluster.local/ns/default/sa/bookinfo-reviews-istio-waypoint",destination_app="unknown",destination_version="unknown",destination_service="reviews.default.svc.cluster.local",destination_canonical_service="reviews",destination_canonical_revision="v1",destination_service_name="reviews",destination_service_namespace="default",destination_cluster="Kubernetes",request_protocol="http",response_code="200",grpc_response_status="",response_flags="-",connection_security_policy="mutual_tls"} 34

We have basically filled in all the fields, compared with ambient.

Which issue(s) this PR fixes:
Fixes part of #320

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


Signed-off-by: YaoZengzeng <yaozengzeng@huawei.com>
@kmesh-bot kmesh-bot added the kind/enhancement New feature or request label Jun 4, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Flag Coverage Δ
unittests 30.99% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

- '*'
routes:
- match:
prefix: "/"
Copy link
Member

Choose a reason for hiding this comment

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

If we look at the new configdump from 1.22 waypoint this is changed to

- match:
    connectMatcher: {}

Copy link
Member Author

Choose a reason for hiding this comment

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

It is connectMatcher in 1.21 as well which is used to match HTTO CONNECTH request, refer: https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/route/v3/route_components.proto#envoy-v3-api-field-config-route-v3-routematch-connect-matcher

Because we don't use HBONE, change it to path matching.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, ic. This is not needed for us

Copy link
Member

@hzxuzhonghu hzxuzhonghu left a comment

Choose a reason for hiding this comment

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

/lgtm

@kmesh-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hzxuzhonghu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kmesh-bot kmesh-bot merged commit f036bca into kmesh-net:main Jun 4, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants