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

Export site metrics in Prometheus #698

Closed
redblom opened this issue Apr 30, 2020 · 11 comments
Closed

Export site metrics in Prometheus #698

redblom opened this issue Apr 30, 2020 · 11 comments

Comments

@redblom
Copy link
Contributor

redblom commented Apr 30, 2020

sciencemesh/sciencemesh#30

@redblom redblom changed the title Create Accounting service for CS3Mesh metrics Create Accounting HTTP service for CS3Mesh metrics Apr 30, 2020
@redblom redblom changed the title Create Accounting HTTP service for CS3Mesh metrics Export site metrics in Prometheus May 13, 2020
@redblom
Copy link
Contributor Author

redblom commented May 13, 2020

Develop a metrics package that exports site metrics to prometheus.

@redblom
Copy link
Contributor Author

redblom commented Jun 30, 2020

@ishank011 So I am able to do grpc calls with basic authentication (user/pass). Now how do I get a token (authenticate my request) if I don't have user. Which is the case for the metrics package. I guess I should use this shared jwt_secret somehow ... ?

@ishank011
Copy link
Contributor

@redblom The way other packages do it is that the HTTP or GRPC services pass the context which contains the token to the package methods like done here. But with the metrics package, since the methods execute in the background as goroutines, this won't be possible.

What would be the use case for this? The metrics methods should ideally be unprotected anyway.

@redblom
Copy link
Contributor Author

redblom commented Jul 1, 2020

@ishank011 The metrics should be retrieved from the underlying EFSS/storage. The CS3 api has useful methods to get this data so why not use that (I would think it's the preferred way). But the CS3 api requires authentication.
Or is there another way ???

@redblom
Copy link
Contributor Author

redblom commented Jul 1, 2020

@hugo Hi Hugo, could you enlighten me with your view on the above?

@labkode
Copy link
Member

labkode commented Jul 3, 2020

Hi @redblom, using the CS3APIS will be an option, note that currently there are not such method to obtain this information so the APIS need to be extended. I'll discuss it with @ishank011 today and let you know by noon.

@ishank011
Copy link
Contributor

@redblom, apologies for the delay. I was on leave for the last couple of days. After discussing with @labkode, we decided to go with not adding the stats to CS3APIs, since the primary method to gather these stats would be to execute external scripts which would need to be executed on the same host.

So I've refactored the metrics package using which you can define multiple drivers to populate stats, and these can register their views themselves, making it more flexible to add new stats. The next step is to complete the logic for the script driver, which would execute external scripts to gather the stats. PR: #934

@redblom
Copy link
Contributor Author

redblom commented Jul 6, 2020

@ishank011 Ishank, could you tell me precisely what we are trying to achieve here?
Are drivers and external scripts that same thing? If not what are their roles?
Are the drivers or external scripts supposed to implement the Reader interface? (I understand how an interface works)
Are we, or the vendors, supposed to write these external scripts or drivers?

@ishank011
Copy link
Contributor

ishank011 commented Jul 6, 2020

@redblom, the drivers represent the multiple ways in which metrics can be read, one of which is to read those using external scripts, which ties with this task: sciencemesh/sciencemesh#125. All the drivers are expected to implement the Reader interface. Also, this change enables us to register metrics from multiple packages and services, whereas previously each of these had to be imported in the prometheus service and registered separately.

@labkode must have discussed with you how to proceed with the above task and how exactly these scripts would be executed. I'm not familiar with how that is to be done so you might want to discuss that with him.

@labkode
Copy link
Member

labkode commented Jul 7, 2020

@redblom you're supposed to write a driver that reads the metrics from a file, I'd suggest JSON.
Every site will then use their mechanisms to put this file into a place that Reva can read so the metrics can be exported.

@redblom
Copy link
Contributor Author

redblom commented Jul 14, 2020

PR #973 created. @ishank011 : ready for review.

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

No branches or pull requests

3 participants