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

feat(kuma-cp) Generate tracing config in Bootstrap config #592

Merged
merged 5 commits into from
Feb 24, 2020

Conversation

jakubdyszkiewicz
Copy link
Contributor

Summary

Generate tracing config in Bootstrap config.

When we generate snapshot, we do traffic trace matching and get proper backend from the mesh. Then we convert this to bootstrap config.

Note: There is some bug in Envoy - Zipkin V2 version of the API is not compatible with Jaeger, because timestamp field in JSON is string and Jeager expects int64 there. We can look for it as a separate task and just use V1 for now which works fine.

if zipkin.ApiVersion != "" && zipkin.ApiVersion != "httpJson" && zipkin.ApiVersion != "httpProto" {
verr.AddViolation("apiVersion", `has to be either "httpJson" or "httpProto"`)
if zipkin.ApiVersion != "" && zipkin.ApiVersion != "httpJsonV1" && zipkin.ApiVersion != "httpJson" && zipkin.ApiVersion != "httpProto" {
verr.AddViolation("apiVersion", `has to be one of the following values: "httpJsonV1", "httpJson" or "httpProto"`)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we reuse AllowedValuesHint() ?

if zipkin.ApiVersion != "" && zipkin.ApiVersion != "httpJson" && zipkin.ApiVersion != "httpProto" {
verr.AddViolation("apiVersion", `has to be either "httpJson" or "httpProto"`)
if zipkin.ApiVersion != "" && zipkin.ApiVersion != "httpJsonV1" && zipkin.ApiVersion != "httpJson" && zipkin.ApiVersion != "httpProto" {
verr.AddViolation("apiVersion", `has to be one of the following values: "httpJsonV1", "httpJson" or "httpProto"`)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we update docs for Zipkin proto type to mention httpJsonV1 value as well ?

And probably describe the difference or reference Envoy docs ?

const zipkinClusterTimeout = 10 * time.Second

func zipkinCluster(backendName string, url *net_url.URL) (*envoy_api.Cluster, error) {
port, err := strconv.Atoi(url.Port())
Copy link
Contributor

Choose a reason for hiding this comment

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

This will result in the error if URL has no port.

If the port is absolutely mandatory, should we update Mesh validator then ?

@jakubdyszkiewicz jakubdyszkiewicz force-pushed the feature/generate-tracing-on-listeners branch 2 times, most recently from ae11c40 to 910a126 Compare February 21, 2020 10:10
@jakubdyszkiewicz jakubdyszkiewicz changed the base branch from feature/generate-tracing-on-listeners to master February 24, 2020 08:51
@jakubdyszkiewicz jakubdyszkiewicz merged commit 2a3edb0 into master Feb 24, 2020
@devadvocado devadvocado deleted the feature/tracing-bootstrap branch March 30, 2020 13:16
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.

None yet

2 participants