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(analytics): adding google analytics for ZFSPV #49

Merged
merged 2 commits into from
Mar 2, 2020

Conversation

pawanpraka1
Copy link
Contributor

@pawanpraka1 pawanpraka1 commented Feb 26, 2020

Whenever a volume is provisioned and de-provisioned we will send a google event with following details :

  1. pvName (will shown as app title in google analytics)
  2. size of the volume
  3. event type : volume-provision, volume-deprovision
  4. storage type zfs-localpv
  5. replicacount as 1
  6. ClientId as default namespace uuid

Apart from this, we send the event once in 24 hr, which will have some info like number of nodes, node type, kubernetes version etc.

This metric is cotrolled by OPENEBS_IO_ENABLE_ANALYTICS env. We can set it to false if we don't want to send the metrics.

Signed-off-by: Pawan pawan@mayadata.io

@pawanpraka1 pawanpraka1 added this to the v0.5.0 milestone Feb 26, 2020
@codecov-io
Copy link

codecov-io commented Feb 26, 2020

Codecov Report

Merging #49 into master will decrease coverage by 59.75%.
The diff coverage is 14.18%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #49       +/-   ##
===========================================
- Coverage   83.33%   23.57%   -59.76%     
===========================================
  Files           1       14       +13     
  Lines          72      475      +403     
===========================================
+ Hits           60      112       +52     
- Misses         12      362      +350     
- Partials        0        1        +1
Impacted Files Coverage Δ
pkg/client/k8s/v1alpha1/resource.go 0% <0%> (ø)
pkg/usage/usage.go 0% <0%> (ø)
pkg/usage/googleanalytics.go 0% <0%> (ø)
pkg/client/k8s/v1alpha1/namespace.go 0% <0%> (ø)
pkg/client/k8s/v1alpha1/node.go 0% <0%> (ø)
pkg/client/k8s/v1alpha1/k8s.go 0% <0%> (ø)
pkg/usage/versionset.go 0% <0%> (ø)
pkg/usage/size.go 100% <100%> (ø)
pkg/common/kubernetes/client/client.go 83.33% <100%> (ø) ⬆️
pkg/usage/ping.go 43.75% <43.75%> (ø)
... and 17 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c2f2202...aa10a9d. Read the comment docs.

@kmova
Copy link
Member

kmova commented Feb 27, 2020

Hi @pawanpraka1 : Can you update the PR description with the following details:

  • Where the events are inserted
  • Event type and parameters passed with each event.

Copy link
Member

@vharsh vharsh left a comment

Choose a reason for hiding this comment

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

I've got to suggest some more code deletions.

pkg/usage/usage.go Show resolved Hide resolved
pkg/usage/const.go Show resolved Hide resolved
pkg/usage/ping.go Show resolved Hide resolved
Gopkg.lock Show resolved Hide resolved
pkg/client/k8s/k8s.go Outdated Show resolved Hide resolved
Copy link
Member

@vharsh vharsh left a comment

Choose a reason for hiding this comment

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

minor small change suggestios, PTAL

@@ -647,6 +650,10 @@ spec:
value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock
- name: OPENEBS_NAMESPACE
value: openebs
- name: OPENEBS_IO_INSTALLER_TYPE
Copy link
Member

Choose a reason for hiding this comment

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

Pending addition to helm charts cc @ChandanSagar

// sendEventOrIgnore sends anonymous local-pv provision/delete events
func sendEventOrIgnore(pvName, capacity, stgType, method string) {
if zfs.GoogleAnalyticsEnabled == "true" {
analytics.New().Build().ApplicationBuilder().
Copy link
Member

Choose a reason for hiding this comment

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

DoubleCheck: Confirm if AppName, AppID, AppVersion, etc are being set, etc.

pkg/usage/const.go Outdated Show resolved Hide resolved
pkg/usage/versionset.go Show resolved Hide resolved
pkg/usage/usage.go Show resolved Hide resolved
pkg/usage/const.go Outdated Show resolved Hide resolved
pkg/usage/const.go Outdated Show resolved Hide resolved
pkg/usage/const.go Show resolved Hide resolved
Copy link
Member

@vharsh vharsh left a comment

Choose a reason for hiding this comment

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

lgtm

Whenever a volume is provisioned and de-provisioned we will send a google event with mainly following details :
1.    pvName (will shown as app title in google analytics)
2.    size of the volume
3.    event type : volume-provision, volume-deprovision
4.    storage type zfs-localpv
5.    replicacount as 1
6.    ClientId as default namespace uuid

Apart from this, we send the event once in 24 hr, which will have some info like number of nodes, node type, kubernetes version etc.

This metric is cotrolled by OPENEBS_IO_ENABLE_ANALYTICS env. We can set it to false if we don't want to send the metrics.

Signed-off-by: Pawan <pawan@mayadata.io>
Signed-off-by: Pawan <pawan@mayadata.io>
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.

4 participants