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

Adding support for zipkin UI #127

Merged
merged 1 commit into from
Jul 25, 2023
Merged

Conversation

Yangfisher1
Copy link
Contributor

Marking the variable SW_ZIPKIN_ADDRESS explicitly for deploying the zipkin UI more easily on k8s cluster.

Copy link
Member

@innerpeacez innerpeacez left a comment

Choose a reason for hiding this comment

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

I think just configuring the ui.env in the values.yaml

@@ -41,6 +41,7 @@ oap:
# zabbix: 10051
grpc: 11800
rest: 12800
zipkinUI: 9412
Copy link
Member

Choose a reason for hiding this comment

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

I think this should not be enabled by default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok. Maybe I should if to create a conditional block in ui-deployment.yaml.

@Yangfisher1
Copy link
Contributor Author

I think using these variables in Chart template is easier especially for those who are not familiar with Helm. But at least adding some guide about how to deploy the zipkin UI on k8s cluster is needed. It took me a lot of time to find out the variable SW_ZIPKIN_ADDRESS should be set.

@Yangfisher1
Copy link
Contributor Author

Yangfisher1 commented Jul 24, 2023

Use ui.zipkin.enabled and oap.port.zipkinui to control whether set the variable SW_ZIPKIN_ADDRESS or not.

Copy link
Member

@kezhenxu94 kezhenxu94 left a comment

Choose a reason for hiding this comment

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

@Yangfisher1 the configurations look verbose to me, here is what I think:

  • Always add the SW_ZIPKIN_ADDRESS, there is no side effect for this env var to be set no matter Zipkin plugin is enabled or disabled.
  • Conditionally add the exposed port 9412 in the OAP service: when the SW_QUERY_ZIPKIN is set to default, add the port 9412 to service OAP, otherwise, don't add the port.
  • Remove oap.ports.zipkinui and zipkin.enabled, because that's not the way to enable/disable zipking plugin, it's SW_QUERY_ZIPKIN that does this.

@Yangfisher1 let me know what you think

@Yangfisher1
Copy link
Contributor Author

@kezhenxu94

Conditionally add the exposed port 9412 in the OAP service: when the SW_QUERY_ZIPKIN is set to default, add the port 9412 to service OAP, otherwise, don't add the port.

I think this idea is better.

Always add the SW_ZIPKIN_ADDRESS, there is no side effect for this env var to be set no matter Zipkin plugin is enabled or disabled.

However, there's one side effect for this env var to be set without setting the port. The UI pod will throw an error complaining about the missing port when initializing. I think we should use the env var SW_QUERY_ZIPKIN to control whether the SW_ZIPKIN_ADDRESS is set or not. Is it a good idea?

@kezhenxu94
Copy link
Member

However, there's one side effect for this env var to be set without setting the port. The UI pod will throw an error complaining about the missing port when initializing. I think we should use the env var SW_QUERY_ZIPKIN to control whether the SW_ZIPKIN_ADDRESS is set or not. Is it a good idea?

Right I missed that, that's better!

@Yangfisher1
Copy link
Contributor Author

@kezhenxu94

It works well now. But I think directly hardcoding the port number(like 9141 and 9142) in the file is not very graceful.


{{- if eq .Values.oap.env.SW_QUERY_ZIPKIN "default" }}
- containerPort: 9412
name: "zipkin-ui"
Copy link
Member

Choose a reason for hiding this comment

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

FYI @jcchavezs Another new Zipkin is being added.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wu-sheng I think it's the original Zipkin bounded in Skywalking OAP Server. We just configure the deployment, making it easier to use Zipkin trace in Skywalking on k8s cluster since I find there're some issues about the configuration of Zipkin.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, but it was not exposed I think.

Copy link
Member

Choose a reason for hiding this comment

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

This is for the sake of convenience, nothing new is added, nothing old was blocked without this changes

@kezhenxu94
Copy link
Member

@kezhenxu94

It works well now. But I think directly hardcoding the port number(like 9141 and 9142) in the file is not very graceful.

I agree, but I don't thin we have a more graceful way to do this, do you have any better idea, I'm open to discuss?

@innerpeacez
Copy link
Member

innerpeacez commented Jul 25, 2023

values.yaml

oap:
  ports:
    # add more ports here if you need, for example
    # zabbix: 10051
    grpc: 11800
    rest: 12800
    # zipkinReceiver: 9411
    # zipkinQuery: 9412

oap-deployment.yaml

        env:
{{- if .Values.oap.ports.zipkinReceiver }}
        - name: SW_RECEIVER_ZIPKIN
          value: "default"
        - name: SW_RECEIVER_ZIPKIN_REST_PORT
          value: "{{ .Values.oap.ports.zipkinReceiver }}"
{{- end }}
{{- if .Values.oap.ports.zipkinQuery }}
        - name: SW_QUERY_ZIPKIN
          value: "default"
        - name: SW_QUERY_ZIPKIN_REST_PORT
          value: "{{ .Values.oap.ports.zipkinReceiver }}"
{{- end }}

ui-deployment.yaml

        env:
{{- if .Values.oap.ports.zipkinQuery }}
        - name: SW_ZIPKIN_ADDRESS
          value: "http://{{ template "skywalking.oap.fullname" . }}:{{ .Values.oap.ports.zipkinQuery }}"
{{- end }}

I think it might be more convenient. What do you think? @kezhenxu94 @Yangfisher1

@kezhenxu94
Copy link
Member

values.yaml

oap:
  ports:
    # add more ports here if you need, for example
    # zabbix: 10051
    grpc: 11800
    rest: 12800
    # zipkinReceiver: 9411
    # zipkinQuery: 9412

oap-deployment.yaml

        env:
{{- if .Values.oap.ports.zipkinReceiver }}
        - name: SW_RECEIVER_ZIPKIN
          value: "default"
{{- end }}
{{- if .Values.oap.ports.zipkinQuery }}
        - name: SW_QUERY_ZIPKIN
          value: "default"
{{- end }}

ui-deployment.yaml

        env:
{{- if .Values.oap.ports.zipkinQuery }}
        - name: SW_ZIPKIN_ADDRESS
          value: "http://{{ template "skywalking.oap.fullname" . }}:{{ .Values.oap.ports.zipkinQuery }}"
{{- end }}

I think it might be more convenient. What do you think? @kezhenxu94 @Yangfisher1

This works for me too, another good point is that we can also set SW_QUERY_ZIPKIN_REST_PORT to .Values.ports.zipkinQuery, @Yangfisher1 in that case users can set Zipin port to arbitrary port, I think

@Yangfisher1
Copy link
Contributor Author

@innerpeacez @kezhenxu94 It works for me, making it more convenient and graceful. Users only need to configure these two ports to enable zipkin trace and they can choose any port they want.

I'd like to make these changes and add these ports into README.md.

Copy link
Member

@innerpeacez innerpeacez left a comment

Choose a reason for hiding this comment

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

LGTM

@Yangfisher1
Copy link
Contributor Author

@innerpeacez @kezhenxu94
I tested it on my k8s cluster and it worked well. Since helm only supports lowercase letters so I rename these ports.

@innerpeacez
Copy link
Member

Since helm only supports lowercase letters so I rename these ports.

Camel-Case is supported, let's keep it. ref to https://helm.sh/zh/docs/chart_best_practices/values/

@Yangfisher1
Copy link
Contributor Author

@innerpeacez My bad. It's the restriction of Kubernetes as a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')

@innerpeacez
Copy link
Member

@innerpeacez My bad. It's the restriction of Kubernetes as a lowercase RFC 1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')

Oooops! For more convenience. Named zkreceiver zkquery, to avoid using gotemplate index function. You think? @Yangfisher1

@Yangfisher1
Copy link
Contributor Author

@innerpeacez
I'm ok with this. But I'm concerned that using zk instead of zipkin might be confusing. Using 'index' would ensure the readability of these ports.

@kezhenxu94
Copy link
Member

I vote for not to use index function, using . is also friendly for completion in IDEs。

@kezhenxu94
Copy link
Member

@innerpeacez

I'm ok with this. But I'm concerned that using zk instead of zipkin might be confusing. Using 'index' would ensure the readability of these ports.

We can use zipkinreceiver or zipkinquery?

@Yangfisher1
Copy link
Contributor Author

@kezhenxu94

We can use zipkinreceiver or zipkinquery?

I'm ok with this.

@innerpeacez
Copy link
Member

@innerpeacez

I'm ok with this. But I'm concerned that using zk instead of zipkin might be confusing. Using 'index' would ensure the readability of these ports.

We can use zipkinreceiver or zipkinquery?

It's better. I think.

@Yangfisher1
Copy link
Contributor Author

@kezhenxu94 @innerpeacez
Renaming is done.

Copy link
Member

@kezhenxu94 kezhenxu94 left a comment

Choose a reason for hiding this comment

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

Thanks for your patience @Yangfisher1 🙇

@innerpeacez innerpeacez merged commit 73f5788 into apache:master Jul 25, 2023
2 checks passed
@wu-sheng
Copy link
Member

Congrats @Yangfisher1 to be 800th GitHub contributor of SkyWalking.
Welcome.

@Yangfisher1
Copy link
Contributor Author

@kezhenxu94 @innerpeacez @wu-sheng Thank you for your help! This is a wonderful community and everyone is kind🤩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants