Skip to content
This repository has been archived by the owner on Aug 14, 2021. It is now read-only.

Instrument opentracing APIs in provisioner #33

Closed
wants to merge 2 commits into from
Closed

Instrument opentracing APIs in provisioner #33

wants to merge 2 commits into from

Conversation

utkarshmani1997
Copy link

  1. Why is this change necessary ?
  1. How does this change address the issue ?
  • It uses opentacing libraries to implement tracing by using contexts
    and spans.
  1. How to verify this change ?
  • First bring up jaeger setup on your cluster.See
    here
  • Open jaeger UI by getting loadbalancer/nodeport IP on browser.
  • Run the templates given below
apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: maya-apiserver
  namespace: default
spec:
  replicas: 1
  template:
    metadata:
      labels:
        name: maya-apiserver
    spec:
      serviceAccountName: openebs-maya-operator
      containers:
      - name: maya-apiserver
        imagePullPolicy: Always
        image: utkarshmani1997/m-apiserver:testtracing1
        ports:
        - containerPort: 5656
        env:
        - name: OPENEBS_IO_JIVA_CONTROLLER_IMAGE
          value: "openebs/jiva:0.5.1-RC1"
        - name: OPENEBS_IO_JIVA_REPLICA_IMAGE
          value: "openebs/jiva:0.5.1-RC1"
        - name: OPENEBS_IO_VOLUME_MONITOR_IMAGE
          value: "openebs/m-exporter:0.5.0"
        - name: OPENEBS_IO_JIVA_REPLICA_COUNT
          value: "2"
      - image: jaegertracing/jaeger-agent
        name: jaeger-agent
        ports:
        - containerPort: 5775
          protocol: UDP
        - containerPort: 5778
        - containerPort: 6831
          protocol: UDP
        - containerPort: 6832
          protocol: UDP
        command:
        - "/go/bin/agent-linux"
        - "--collector.host-port=jaeger-collector:14267"
---
apiVersion: v1
kind: Service
metadata:
  name: maya-apiserver-service
spec:
  ports:
  - name: api
    port: 5656
    protocol: TCP
    targetPort: 5656
  selector:
    name: maya-apiserver
  sessionAffinity: None
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: openebs-provisioner
  namespace: default
spec:
  replicas: 1
  template:
    metadata:
      labels:
        name: openebs-provisioner
    spec:
      serviceAccountName: openebs-maya-operator
      containers:
      - name: jaeger-agent
        imagePullPolicy: Always
        image: jaegertracing/jaeger-agent
        ports:
        - containerPort: 5775
          protocol: UDP
        - containerPort: 5778
        - containerPort: 6831
          protocol: UDP
        - containerPort: 6832
          protocol: UDP
        command:
        - "/go/bin/agent-linux"
        - "--collector.host-port=jaeger-collector:14267"
      - name: openebs-provisioner
        image: utkarshmani1997/openebs-provisioner:testtracing1
        env:
        - name: NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        - name: OPENEBS_MONITOR_URL
          value:
"http://127.0.0.1:32515/dashboard/db/openebs-volume-stats?orgId=1"
        - name: OPENEBS_MONITOR_VOLKEY
          value: "&var-OpenEBS"
        - name: MAYA_PORTAL_URL
          value: "https://mayaonline.io/"
  1. What side effects does this change have ?
  • none
  1. Other details

Note :

  • This is very first and complete PR for the provisioner, there will be
    more PR that yet be raised in openebs/maya and openebs/jiva for
    indepth tracing.

Signed-off-by: utkarshmani1997 utkarshmani1997@gmail.com

@kmova
Copy link

kmova commented Feb 13, 2018

@utkarshmani1997 .. please split the commits between the vendor update and actual code changes.

Copy link

@kmova kmova left a comment

Choose a reason for hiding this comment

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

Hard to review the core files with vendor getting updated.

1. Why is this change necessary ?
- To implement tracing in provisioner
- See issue : openebs/openebs#1131 for more details

2. How does this change address the issue ?
- It uses opentacing libraries to implement tracing by using
  contexts and spans.

3. How to verify this change ?
- First bring up jaeger setup on your cluster.See
  [here](https://github.com/jaegertracing/jaeger-kubernetes/)
- Open jaeger UI by getting loadbalancer/nodeport IP on browser.
- Run the templates given below
```
        apiVersion: apps/v1beta1
        kind: Deployment
        metadata:
          name: maya-apiserver
          namespace: default
        spec:
          replicas: 1
          template:
            metadata:
              labels:
                name: maya-apiserver
            spec:
              serviceAccountName: openebs-maya-operator
              containers:
              - name: maya-apiserver
                imagePullPolicy: Always
                image: utkarshmani1997/m-apiserver:testtracing1
                ports:
                - containerPort: 5656
                env:
                - name: OPENEBS_IO_JIVA_CONTROLLER_IMAGE
                  value: "openebs/jiva:0.5.1-RC1"
                - name: OPENEBS_IO_JIVA_REPLICA_IMAGE
                  value: "openebs/jiva:0.5.1-RC1"
                - name: OPENEBS_IO_VOLUME_MONITOR_IMAGE
                  value: "openebs/m-exporter:0.5.0"
                - name: OPENEBS_IO_JIVA_REPLICA_COUNT
                  value: "2"
              - image: jaegertracing/jaeger-agent
                name: jaeger-agent
                ports:
                - containerPort: 5775
                  protocol: UDP
                - containerPort: 5778
                - containerPort: 6831
                  protocol: UDP
                - containerPort: 6832
                  protocol: UDP
                command:
                - "/go/bin/agent-linux"
                - "--collector.host-port=jaeger-collector:14267"
        ---
        apiVersion: v1
        kind: Service
        metadata:
          name: maya-apiserver-service
        spec:
          ports:
          - name: api
            port: 5656
            protocol: TCP
            targetPort: 5656
          selector:
            name: maya-apiserver
          sessionAffinity: None
        ---
        apiVersion: apps/v1beta1
        kind: Deployment
        metadata:
          name: openebs-provisioner
          namespace: default
        spec:
          replicas: 1
          template:
            metadata:
              labels:
                name: openebs-provisioner
            spec:
              serviceAccountName: openebs-maya-operator
              containers:
              - name: jaeger-agent
                imagePullPolicy: Always
                image: jaegertracing/jaeger-agent
                ports:
                - containerPort: 5775
                  protocol: UDP
                - containerPort: 5778
                - containerPort: 6831
                  protocol: UDP
                - containerPort: 6832
                  protocol: UDP
                command:
                - "/go/bin/agent-linux"
                - "--collector.host-port=jaeger-collector:14267"
              - name: openebs-provisioner
                image: utkarshmani1997/openebs-provisioner:testtracing1
                env:
                - name: NODE_NAME
                  valueFrom:
                    fieldRef:
                      fieldPath: spec.nodeName
                - name: OPENEBS_MONITOR_URL
                  value:"http://127.0.0.1:32515/dashboard/db/openebs-volume-stats?orgId=1"
                - name: OPENEBS_MONITOR_VOLKEY
                  value: "&var-OpenEBS"
                - name: MAYA_PORTAL_URL
                  value: "https://mayaonline.io/"
```

4. What side effects does this change have ?
- none

5. Other details

- Feature : openebs/openebs#1131

- This is very first and complete PR for the provisioner, there will
  be more PR that yet be raised in openebs/maya and openebs/jiva for
  indepth tracing.

Signed-off-by: utkarshmani1997 <utkarshmani1997@gmail.com>
@utkarshmani1997
Copy link
Author

utkarshmani1997 commented Feb 14, 2018

Here is the screenshot of the traces for create and delete
screenshot from 2018-02-14 12-47-08
screenshot from 2018-02-14 12-48-39
screenshot from 2018-02-14 12-56-58
screenshot from 2018-02-14 12-57-33

@kmova
Copy link

kmova commented Mar 15, 2018

Check if kubernetes/enhancements#496 helps get similar metrics.

@kmova
Copy link

kmova commented Jun 1, 2018

We will revisit the tracing PR after moving to CSI plugin

@kmova kmova closed this Jun 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants