Skip to content

Conversation

@DeathGun44
Copy link

Description

This PR fixes the Prometheus scraping configuration for the development stack as described in FINERACT-2053.

The default docker-compose configuration for Prometheus was failing to scrape metrics from Fineract due to incorrect paths, SSL verification issues, and hostname mismatches.

Changes made:

  1. Metrics Path: Updated metrics_path to include the context path /fineract-provider/actuator/prometheus (previously just /actuator/prometheus).
  2. TLS Config: Added insecure_skip_verify: true to tls_config. This is necessary because the development environment uses self-signed certificates.
  3. Hostname: Updated the scrape target from fineract-server:8443 to fineract-development:8443.
    • Reasoning: Debugging confirmed that the actual container name generated by docker-compose-development.yml is fineract-development. The previous hostname fineract-server resulted in "no such host" errors.

Verification:
I have verified that Prometheus can now successfully scrape the Fineract target. The target state is UP (Green).

Prometheus Green Target

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per our guidelines
  • Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
  • Create/update unit or integration tests for verifying the changes made. (Verified manually via Docker stack)
  • Follow our coding conventions.
  • Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
  • This PR must not be a "code dump". Large changes can be made in a branch, with assistance. Ask for help on the developer mailing list.

Copy link
Contributor

@IOhacker IOhacker left a comment

Choose a reason for hiding this comment

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

I don't like the "development" change. Because it is tied to a environment. It is prefer to add a new configuration file for this name and update the documentation.

@DeathGun44
Copy link
Author

I don't like the "development" change. Because it is tied to a environment. It is prefer to add a new configuration file for this name and update the documentation.

Thanks for the review @IOhacker. You make a valid point about keeping prometheus.yml environment-agnostic.

The reason I made the change is that the docker-compose-development.yml file explicitly sets the container name to fineract-development, so the standard fineract-server hostname fails to resolve in the default dev stack.

Alternative Proposal: Instead of creating a separate config file (which increases maintenance), would you prefer if I added a network alias to docker-compose-development.yml?

If I add networks: aliases: - fineract-server to the fineract service, the standard prometheus.yml will work without modification. This i think could be cleaner than maintaining two separate Prometheus config files.

Let me know if you agree, and I will update the PR!

@DeathGun44
Copy link
Author

@IOhacker I went ahead and implemented the network alias approach.

  • Reverted prometheus.yml to use the generic fineract-server hostname (so it remains environment-agnostic).

  • Updated docker-compose-development.yml to alias the container as fineract-server.

I verified locally that this resolves the connection issue while keeping the configuration clean. Ready for re-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

Successfully merging this pull request may close these issues.

2 participants