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: Gather metrics from sinks #148

Merged
merged 4 commits into from
Jul 7, 2020
Merged

feat: Gather metrics from sinks #148

merged 4 commits into from
Jul 7, 2020

Conversation

trygve-lie
Copy link
Contributor

This adds metrics to the internal sinks. These metrics ups a counter for each method in the sink where the method is set as a label on the counter. If the value to the arguments passed to the method is not valid or a directory traversal is tried, the counter will have a success label set to false. If the method touches the storage, the success label will be set to true.

Do note that if writing to the storage fails (ex a permission is not granted etc), the metric will have success set to true. This is because we would like to distinguish between touching the file storage (success is true) and when we are not touching the file storage (success is false). These are handy to distinguish on when writing / reading to cloud storages where one pay for access operations.

@digitalsadhu
Copy link
Member

digitalsadhu commented Jul 6, 2020

Perhaps another label could be used to help differentiate the success/storage thing?
You could have an approach where success label is true or false and a second label like error_location is set to storage or server or some such?

@trygve-lie
Copy link
Contributor Author

@digitalsadhu Good point.

I've now made it so that there is a access label which indicates if one did touch the file storage (triggers costs) and the success label indicates if the operation was successful or not.

Copy link
Member

@digitalsadhu digitalsadhu left a comment

Choose a reason for hiding this comment

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

LGTM

@trygve-lie trygve-lie merged commit 7d1792c into master Jul 7, 2020
@trygve-lie trygve-lie deleted the metrics-sink branch July 7, 2020 21:17
github-actions bot pushed a commit that referenced this pull request Jul 7, 2020
# [1.1.0](v1.0.4...v1.1.0) (2020-07-07)

### Features

* Gather metrics from sinks ([#148](#148)) ([7d1792c](7d1792c))
@github-actions
Copy link

github-actions bot commented Jul 7, 2020

🎉 This PR is included in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants