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

[feature] Initial metrics #2334

Merged

Conversation

Tsuribori
Copy link
Contributor

Description

Relating to #1218, this PR implements the following metrics:

  • Go performance/runtime metrics
  • Bun metrics
  • Gin metrics

These are instrumented via OpenTelemetry.

Following settings are added:

	MetricsEnabled:  false,
	MetricsExporter: "prometheus",

Turning metrics on exposes them on a public /metrics endpoint for Prometheus pull.

The code has largely been modeled after #1623

Checklist

  • I/we have read the GoToSocial contribution guidelines.
  • I/we have discussed the proposed changes already, either in an issue on the repository, or in the Matrix chat.
  • I/we have performed a self-review of added code.
  • I/we have written code that is legible and maintainable by others.
  • I/we have commented the added code, particularly in hard-to-understand areas.
  • I/we have made any necessary changes to documentation.
  • I/we have added tests that cover new code.
  • I/we have run tests and they pass locally with the changes.
  • I/we have run go fmt ./... and golangci-lint run.

@Tsuribori Tsuribori changed the title feat: initial metrics [feature] Initial metrics Nov 5, 2023
@Tsuribori
Copy link
Contributor Author

I don't really know if its possible to add tests for this

@tsmethurst
Copy link
Contributor

Thanks for this! Finishing off a couple things now, will try to have a look and review soon!

docs/advanced/metrics.md Outdated Show resolved Hide resolved
docs/advanced/metrics.md Outdated Show resolved Hide resolved
internal/metrics/metrics.go Outdated Show resolved Hide resolved
Copy link
Member

@daenney daenney left a comment

Choose a reason for hiding this comment

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

I think that looks good. This gives us a good starting point and we can start to add custom metrics for things later on. Thanks for the work!

Copy link
Contributor

@tsmethurst tsmethurst left a comment

Choose a reason for hiding this comment

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

Great work! I'll just rebase this on main (if I can) to see if I can fix the merge conflicts...

@tsmethurst tsmethurst merged commit 1ba3e14 into superseriousbusiness:main Nov 20, 2023
2 checks passed
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.

None yet

3 participants