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

Prometheus metrics do not show fuseki_requests_good or fuseki_requests_bad metrics for new datasets created after startup #2046

Closed
tomdw opened this issue Oct 19, 2023 · 6 comments · Fixed by #2903
Labels

Comments

@tomdw
Copy link

tomdw commented Oct 19, 2023

Version

4.9.0

What happened?

In the /metrics endpoint for prometheus there should be metrics concerning the requests going to fuseki.

More specifically fuseki_requests_good or fuseki_requests_bad metrics

They are shown for datasets or data endpoints that already exist at startup of Fuseki. However, when a new dataset or data endpoint is created while fuseki is running, then the metrics endpoint does not include these requests metrics.

Cause: the code to register datasets with the MetricsRegistry of micrometer is only executed at startup time of Fuseki. It should be executed again when a new dataset is added.

Relevant output and stacktrace

No response

Are you interested in making a pull request?

None

@tomdw tomdw added the bug label Oct 19, 2023
@rvesse
Copy link
Member

rvesse commented Oct 19, 2023

@afs This might be another good motivator to translate the current metrics integration into an actual Fuseki Module.

We'd need to extend the FusekiModule interface (maybe in Jena 5.x) to have suitable methods that could be called when a new dataset/endpoint is added (or removed?) to a running server instance so that modules can take appropriate actions when things change. (serverReload() exists but not sure if that is quite the right extension point for this?)

Otherwise even if we fixed this specific issue you could still encounter the same issue with another module in the future. Therefore we might as well make the more general fix at the same time.

WDYT?

@afs
Copy link
Member

afs commented Oct 20, 2023

@tomdw Which form/packging of Fuseki are you using?

Ensuring FusekiModule get triggered for dynamically added datasets will be necessary anyway but maybe the Prometheus code should cope with a changing DataAccessPointRegistry. That also means a fix now is possible whereas changing the FusekiModule interface has to be done very carefully and that means longer timescale.

Logically, the metrics should be generated every time a metrics response is generated.

An optimization is that the Prometheus code caches setup some where around FusekiRequestsMetrics and resets when there is a change in DataAccessPointRegistry.

DataAccessPointRegistry would have a UUID for each setup (the epoch) and it changes the UUID when a change is made. No harm in being safe - e.g. reset the UUID if a change may have been made.

The UUID approach is safer than relying on the names via DataAccessPointRegistry.accessPoints although that is an option.

@tomdw
Copy link
Author

tomdw commented Oct 20, 2023

@afs we are running fuseki in docker in a kubernetes environment. Or do you mean something different with 'form/packaging'?

@afs
Copy link
Member

afs commented Oct 20, 2023

@tomdw Are you running with the Fuseki UI available?

Fuseki has forms "webapp" (war file or the jar file in apache-jena-fuseki, or jena-fuseki-full.jar) or "main" (jar file jena-fuseki-server).

@namedgraph
Copy link
Contributor

namedgraph commented Oct 20, 2023 via email

@tomdw
Copy link
Author

tomdw commented Oct 20, 2023

@afs the Fuseki UI is also included yes.

@afs afs mentioned this issue Dec 27, 2024
4 tasks
afs added a commit to afs/jena that referenced this issue Dec 27, 2024
afs added a commit to afs/jena that referenced this issue Dec 31, 2024
afs added a commit to afs/jena that referenced this issue Jan 1, 2025
@afs afs closed this as completed in #2903 Jan 1, 2025
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 a pull request may close this issue.

4 participants