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

JMX metrics for HDFS operations #1971

Closed
findepi opened this issue Nov 6, 2019 · 14 comments
Closed

JMX metrics for HDFS operations #1971

findepi opened this issue Nov 6, 2019 · 14 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@findepi
Copy link
Member

findepi commented Nov 6, 2019

Similarly to what we do with S3 file system, we should have JMX-exported metrics for HDFS operations/invocations.

@findepi findepi added the enhancement New feature or request label Nov 6, 2019
@kokosing kokosing added the good first issue Good for newcomers label Nov 7, 2019
@Anurag870
Copy link
Contributor

@findepi Would like to work on this

@findepi
Copy link
Member Author

findepi commented Nov 7, 2019

@Anurag870 sure, thanks! if you need guidance, please join the #dev channel of our slack https://prestosql.io/slack.html

@findepi
Copy link
Member Author

findepi commented Nov 13, 2019

For the record, S3 stats are collected in PrestoS3FileSystemStats class.

@Anurag870 Anurag870 removed their assignment Apr 14, 2020
@amommendes
Copy link
Contributor

amommendes commented Sep 26, 2020

Hey @findepi, is this PR still to be worked? Inspecting the code, we already have NamenodeStats being exported in HiveHdfsModule. Probably I'm missing something, but here do we need to implement more statistics (as we have for PrestoS2FileSystem)?

@findepi
Copy link
Member Author

findepi commented Sep 27, 2020

NamenodeStats expose only few operations (file metadata queries). We could want HDFS stats like file open, or read operations (data throughput).
cc @sopel39

@amommendes
Copy link
Contributor

NamenodeStats expose only few operations (file metadata queries). We could want HDFS stats like file open, or read operations (data throughput).
cc @sopel39

Great!

@amommendes
Copy link
Contributor

Hey @findepi, I would like to work on this!

@tnatssb
Copy link

tnatssb commented Feb 18, 2021

Hi @amommendes, any progress on this?

@amommendes
Copy link
Contributor

Hi @amommendes, any progress on this?

Hey @tnatssb , not yet! I had a discussion about these statistics in the slack a time ago.
If someone wants to take this PR, no problem!

@tangjiangling
Copy link
Member

@findepi As a newcomer, I want to start integrating into the community and contributing from this issue.

@tangjiangling
Copy link
Member

tangjiangling commented Dec 23, 2021

NamenodeStats expose only few operations (file metadata queries). We could want HDFS stats like file open, or read operations (data throughput).

@findepi I have an idea to implement this feature, and I hope you can review it:

Let me introduce some background first:

  1. Get Hadoop FileSystem will be implemented through the Cache, as shown in the code in io.trino.plugin.hive.HdfsEnvironment:
    FileSystemManager.registerCache(TrinoFileSystemCache.INSTANCE);
  2. The value in the cache is io.trino.plugin.hive.fs.TrinoFileSystemCache.FileSystemWrapper, which indirectly inherits from Hadoop FileSystem and overrides some of the interfaces (e.g., open, append, create, etc.)

Therefore, the simplest way to achieve this feature is to extend io.trino.plugin.hive.fs.TrinoFileSystemCache.FileSystemWrapper, override more methods (e.g., delete, etc.), add interface metrics (e.g., latency, error count, etc.).
By the way, we also need a class similar to TrinoS3FileSystemStats, can be called TrinoHdfsFileSystemStats, and merge the metrics in NamenodeStats to TrinoHdfsFileSystemStats.

@tangjiangling
Copy link
Member

Therefore, the simplest way to achieve this feature is to extend io.trino.plugin.hive.fs.TrinoFileSystemCache.FileSystemWrapper, override more methods (e.g., delete, etc.), add interface metrics (e.g., latency, error count, etc.).

After thinking about it for a while, I shouldn't extend io.trino.plugin.hive.fs.TrinoFileSystemCache.FileSystemWrapper directly, because io.trino.plugin.hive.fs.TrinoFileSystemCache. FileSystemWrapper is the base class of Hadoop ecoFileSystem (e.g., S3, HDFS), extend a class similar to io.trino.plugin.hive.s3.TrinoS3FileSystem, called TrinoHdfsFileSystem, to better monitor operations (e.g., open, create, delete, etc.).

@findepi @electrum

@weijiii
Copy link
Member

weijiii commented Dec 4, 2022

@findepi Hi I'd like to try taking on this :)

@hashhar
Copy link
Member

hashhar commented May 26, 2023

Seems to be addressed by #17078

@hashhar hashhar closed this as completed May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Development

No branches or pull requests

8 participants