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

Recording openstack metrics #46008

Merged
merged 1 commit into from
May 23, 2017

Conversation

NickrenREN
Copy link
Contributor

add openstack operation metrics

Release note:

Add support for emitting metrics from openstack cloudprovider about storage operations.

/assign @gnufied

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 18, 2017
@k8s-github-robot k8s-github-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels May 18, 2017
@NickrenREN
Copy link
Contributor Author

/assign @anguslees

@NickrenREN NickrenREN force-pushed the openstack-add-metric branch from 035ec7e to fe0e4d0 Compare May 18, 2017 02:00
@k8s-github-robot k8s-github-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 18, 2017
Copy link
Member

@anguslees anguslees left a comment

Choose a reason for hiding this comment

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

Thanks, I like being able to export these metrics.

I would like it even more if we can make the call-site syntax really minimal - that way we can put it everywhere without messing up the visual flow of the code much. Ideally something as simple as a one-letter wrapper that takes the metric name, and a closure - not sure if that's possible though with golang's lack of parametric types :(

return "", "", err
}
timeToken := time.Since(startTime).Seconds()
recordOpenstackOperationMetric("create_v1_volume", timeToken, nil)
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 you should move all these to above the if err != nil handler. ie: remove the explicitly different calls in separate branches:

vol, err := volumes_v1.Create(...)
timeToken := time.Since(startTime).Seconds()
recordOpenstackOperationMetric("create_v1_volume", timeToken, err)
// rest is unchanged from original:
if err != nil {
      return "", "", err
}
return vol.ID, vol.AvailabilityZone, nil

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but maybe we do not need to calc timetaken if err happened

Copy link
Member

Choose a reason for hiding this comment

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

I'm very reluctant to add anything complex on error paths because they're ~never tested - and there's rarely much point optimising the error case either...

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, i see.

return "", "", err
}
timeToken := time.Since(startTime).Seconds()
Copy link
Member

Choose a reason for hiding this comment

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

Is this meant to be timeTaken (taken vs token)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes,timeTaken. Sorry i will change that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, thanks

@NickrenREN
Copy link
Contributor Author

@NickrenREN NickrenREN force-pushed the openstack-add-metric branch from fe0e4d0 to b3bb74f Compare May 20, 2017 02:19
@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 20, 2017
@NickrenREN
Copy link
Contributor Author

@k8s-bot ok to test

Name: OpenstackOperationErrorKey,
Help: "Cumulative number of openstack Api call errors",
},
[]string{"openstack_operation"},
Copy link
Member

Choose a reason for hiding this comment

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

Can we use naming convention proposed here - https://github.com/kubernetes/community/blob/master/contributors/design-proposals/cloudprovider-storage-metrics.md ? Which is, rename openstack_operation to request ?

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, will modify

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

add openstack operation metrics
Add support for emitting metrics from openstack cloudprovider about storage operations.
@NickrenREN NickrenREN force-pushed the openstack-add-metric branch from b3bb74f to 18852c5 Compare May 22, 2017 02:48
@NickrenREN
Copy link
Contributor Author

kindly ping @anguslees @gnufied . Ready for review again

@gnufied
Copy link
Member

gnufied commented May 23, 2017

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 23, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: NickrenREN, gnufied

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented May 23, 2017

@NickrenREN: The following test(s) failed:

Test name Commit Details Rerun command
pull-kubernetes-federation-e2e-gce 18852c5 link @k8s-bot pull-kubernetes-federation-e2e-gce test this

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 3bfae79 into kubernetes:master May 23, 2017
@NickrenREN NickrenREN deleted the openstack-add-metric branch May 23, 2017 04:54
dims pushed a commit to dims/kubernetes that referenced this pull request Feb 8, 2018
Automatic merge from submit-queue

Recording openstack metrics

add openstack operation metrics


**Release note**:
```release-note
Add support for emitting metrics from openstack cloudprovider about storage operations.
```

/assign @gnufied
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants