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

chore: add http metrics server in datanode node when greptime start in distributed mode #1256

Merged
merged 13 commits into from
Mar 31, 2023

Conversation

paomian
Copy link
Contributor

@paomian paomian commented Mar 27, 2023

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

  • Unify disorganized metrics into a single file
  • start http server in datanode instance to export prometheus metrics when start in distributed mode

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.

Refer to a related PR or issue link (optional)

@paomian paomian changed the title chore: add http metrics server in datanode node when greptime start i… chore: add http metrics server in datanode node when greptime start in distributed mode Mar 27, 2023
@paomian paomian force-pushed the chore/metrics branch 2 times, most recently from 09c4b1e to 9630d0a Compare March 27, 2023 11:19
@codecov
Copy link

codecov bot commented Mar 27, 2023

Codecov Report

Merging #1256 (207b3ac) into develop (eb77f9a) will decrease coverage by 0.51%.
The diff coverage is 62.63%.

@@             Coverage Diff             @@
##           develop    #1256      +/-   ##
===========================================
- Coverage    85.91%   85.41%   -0.51%     
===========================================
  Files          499      500       +1     
  Lines        75599    75690      +91     
===========================================
- Hits         64950    64649     -301     
- Misses       10649    11041     +392     

@paomian paomian force-pushed the chore/metrics branch 2 times, most recently from d571dac to b1beccb Compare March 27, 2023 13:48
@sunng87 sunng87 linked an issue Mar 28, 2023 that may be closed by this pull request
src/common/telemetry/src/metrics.rs Outdated Show resolved Hide resolved
src/cmd/src/metasrv.rs Outdated Show resolved Hide resolved
src/servers/src/metrics_server.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@MichaelScofield MichaelScofield left a comment

Choose a reason for hiding this comment

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

Can we add a grpc interface to expose metrics in datanode, instead of creating a http server?

src/common/telemetry/src/metrics.rs Outdated Show resolved Hide resolved
src/common/telemetry/Cargo.toml Show resolved Hide resolved
@waynexia
Copy link
Member

Can we add a grpc interface to expose metrics in datanode, instead of creating a http server?

metrics's expose path usually defaults to http://endpoint/metrics. I think we'd better to do so

Copy link
Collaborator

@MichaelScofield MichaelScofield left a comment

Choose a reason for hiding this comment

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

If some comments are hard to resolve or not related to this PR's scope, feel free to add "todo"s or create issues that tagged with "good first issue".

src/datanode/src/server.rs Outdated Show resolved Hide resolved
src/datanode/src/server.rs Outdated Show resolved Hide resolved
src/meta-srv/src/bootstrap.rs Show resolved Hide resolved
src/meta-srv/src/error.rs Show resolved Hide resolved
src/meta-srv/src/error.rs Outdated Show resolved Hide resolved
src/servers/src/http.rs Outdated Show resolved Hide resolved
src/servers/src/http.rs Outdated Show resolved Hide resolved
src/servers/src/metrics_handler.rs Outdated Show resolved Hide resolved
src/datanode/src/server.rs Outdated Show resolved Hide resolved
src/common/runtime/src/runtime.rs Outdated Show resolved Hide resolved
src/meta-srv/src/metasrv.rs Outdated Show resolved Hide resolved
@paomian paomian force-pushed the chore/metrics branch 5 times, most recently from a7b2fde to 9b96ee6 Compare March 30, 2023 06:30
src/meta-srv/src/error.rs Outdated Show resolved Hide resolved
src/meta-srv/src/error.rs Outdated Show resolved Hide resolved
src/servers/src/http.rs Outdated Show resolved Hide resolved
@paomian
Copy link
Contributor Author

paomian commented Mar 31, 2023

PTAL @evenyag @MichaelScofield

Copy link
Contributor

@evenyag evenyag left a comment

Choose a reason for hiding this comment

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

LGTM

@evenyag evenyag merged commit a2b262e into GreptimeTeam:develop Mar 31, 2023
paomian added a commit to paomian/greptimedb that referenced this pull request Oct 19, 2023
…n distributed mode (GreptimeTeam#1256)

* chore: add http metrics server in datanode node when greptime start in distributed mode

* chore: add some docs and license

* chore: change metrics_addr to resolve address already in use error

* chore add metrics for meta service

* chore: replace metrics exporter http server from hyper to axum

* chore: format

* fix: datanode mode branching error

* fix: sqlness test address already in use and start metrics in defualt config

* chore: change metrics location

* chore: use builder pattern to builder httpserver

* chore: remove useless debug_assert macro in httpserver builder

* chore: resolve conflicting build error

* chore: format code
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.

Add prometheus metrics endpoint for datanode and meta
4 participants