-
-
Notifications
You must be signed in to change notification settings - Fork 652
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: opentelemetry metrics #1966
Merged
Merged
Conversation
This file contains 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
luan
changed the title
feat: comprehensive opentelemtry metrics
feat: comprehensive opentelemetry metrics
Dec 3, 2023
luan
changed the title
feat: comprehensive opentelemetry metrics
feat: opentelemetry metrics
Dec 3, 2023
luan
force-pushed
the
luan/metrics
branch
2 times, most recently
from
December 3, 2023 04:22
a50de87
to
0a33920
Compare
andersonfaaria
approved these changes
Dec 3, 2023
lgrossi
approved these changes
Dec 3, 2023
majestyotbr
approved these changes
Dec 3, 2023
luan
force-pushed
the
luan/metrics
branch
2 times, most recently
from
December 5, 2023 01:47
f13bfdb
to
48c26b9
Compare
Kudos, SonarCloud Quality Gate passed! |
crash_civetweb-worker.log |
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.
Canary Metrics (OpenTelemetry)
By default, no metrics are collected or exported. To enable metrics, you must setup a metrics exporter. The following example shows how to setup a Prometheus exporter.
config.lua
This, in and of itself will expose a Prometheus endpoint at
http://localhost:9464/metrics
. However, you will need to configure Prometheus to scrape this endpoint.The easiest, batteries included way, to do this is using the provided
docker-compose.yml
file provided in thismetrics
directory. Simply rundocker-compose up
and you will have a Prometheus instance running and scraping the Canary metrics endpoint.The
docker-compose.yml
file also includes a Grafana instance that is preconfigured to use the Prometheus instance as a data source. The Grafana instance is exposed athttp://localhost:3000
and the default username and password areadmin
andadmin
respectively (you will be prompted to change the password on first login).Usage
This is an advanced feature. While you can simply enable OStream and get metrics in your logs, that is not recommended to do in production. Prometheus can be run efficiently in production with minimal impact to server performance.
Enabling OStream:
If you don't how what Prometheus and Grafana are, you need to learn that first: https://prometheus.io/ is your starting point. You can come back to this feature once you've understood how to install and run this software.
Metrics
We export all kinds of metrics, but the most important ones are:
Here's an interactive demo of a dashboard from a real production server: https://snapshots.raintank.io/dashboard/snapshot/bpiq45inK3I2Xixa2d7oNHWekdiDE6zr
Screenshot
Analytics
We also export analytic event, counters and other useful data. This is useful for debugging and understanding the behavior of the server. Some interesting ones are:
Examples:
Note: you can normally see player names here, I've hidden those for privacy.
Raw exp/h
Raw gold/h
Monsters killed/h