Add remote metrics setup#5
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This MR adds a remote observability setup so local Grafana/Prometheus can monitor a remotely hosted Commerce API (for example, Render), and adds an optional server-side Promtail agent for shipping remote Docker logs to Loki.
Motivation
The existing setup assumes the app and database run in the same local Docker Compose network.
When the app/database are remote, local observability was not directly usable.
This change introduces configurable remote scraping and remote log shipping paths.
Scope of Changes
Added
.env.remote.example.env.server-logs.exampledocker-compose.remote.ymldocker-compose.server-logs.ymlobservability/prometheus.remote.yml.tmplobservability/promtail.remote.yml.tmplUpdated
README.mdWhat’s Included
1) Remote metrics stack (
docker-compose.remote.yml)grafanaprometheuslokitempootel-collectorREMOTE_SERVER_ADDRESSREMOTE_APP_SCHEMEREMOTE_APP_PORTREMOTE_METRICS_PATH2) Server-side remote log shipping (
docker-compose.server-logs.yml)REMOTE_LOKI_PUSH_URLREMOTE_LOG_HOSTREMOTE_LOG_JOB3) Documentation updates (
README.md)https://commercesystemdemo.onrender.com/Validation
/returns200/healthreturns200/metricsreturns200withcommerce_*metricsdocker compose -f docker-compose.remote.yml ... configdocker compose -f docker-compose.server-logs.yml ... configupforcommercesystemdemo.onrender.com:443How to Use (Render example)