-
Notifications
You must be signed in to change notification settings - Fork 451
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
Dynamically generate metrics documentation #4850
Conversation
Opening this PR as draft to hopefully get some feedback on this approach to documenting the metrics. This code is largely modeled after and works the same as the Here is an example of the output from the few example metrics I added to Click to expandBelow are the metrics used to monitor various components of Accumulo. General Server Metricsaccumulo.detected.low.memoryType: GAUGE Description: reports 1 when process memory usage is above threshold, 0 when memory is okay accumulo.server.idleType: GAUGE Description: Indicates if the server is idle or not. The value will be 1 when idle and 0 when not idle. Compactor MetricsScan Server Metricsaccumulo.scan.busy.timeout.countType: COUNTER Description: Count of the scans where a busy timeout happened Fate Metrics |
core/src/main/java/org/apache/accumulo/core/metrics/MetricsDocGen.java
Outdated
Show resolved
Hide resolved
Marking this as ready for review since I think its mostly done. One thing I thought of is if we want to use the description from the enum when registering the corresponding metric. For example: accumulo/server/tserver/src/main/java/org/apache/accumulo/tserver/BlockCacheMetrics.java Lines 57 to 58 in 3a265ed
could be changed to FunctionCounter.builder(BLOCKCACHE_INDEX_HITCOUNT.getName(), indexCache, getHitCount)
.description(BLOCKCACHE_INDEX_HITCOUNT.getDescription()).register(registry); this would make the description that appears in the docs the same as the one connected to the micrometer instrument. I am guessing we want to keep the description attached to the micrometer instrument more brief than the one that will appear on the docs but I figured I would ask. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments and questions. Overall, looks like a really good improvement
core/src/main/java/org/apache/accumulo/core/metrics/MetricsDocGen.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/accumulo/core/metrics/MetricsDocGen.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/accumulo/core/metrics/MetricsProducer.java
Show resolved
Hide resolved
server/tserver/src/main/java/org/apache/accumulo/tserver/metrics/TabletServerMetrics.java
Outdated
Show resolved
Hide resolved
test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompactionMetricsIT.java
Outdated
Show resolved
Hide resolved
test/src/main/java/org/apache/accumulo/test/functional/MemoryStarvedMajCIT.java
Outdated
Show resolved
Hide resolved
test/src/main/java/org/apache/accumulo/test/metrics/MetricsIT.java
Outdated
Show resolved
Hide resolved
test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompactionProgressIT.java
Outdated
Show resolved
Hide resolved
@kevinrr888 All of your suggestions should be addressed now. |
core/src/main/java/org/apache/accumulo/core/metrics/MetricsDocGen.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/accumulo/core/metrics/Metric.java
Outdated
Show resolved
Hide resolved
test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompactionProgressIT.java
Show resolved
Hide resolved
test/src/main/java/org/apache/accumulo/test/functional/MemoryStarvedMajCIT.java
Outdated
Show resolved
Hide resolved
test/src/main/java/org/apache/accumulo/test/functional/MemoryStarvedMinCIT.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Kevin Rathbun <krathbun@apache.org>
@DomGarguilo that would be really nice, is there a follow on issue for that? |
Not yet. I can create one though. Two things I am thinking of that should be considered before consolidating these two descriptions though:
|
For point number one we need to figure out what the implications are if any of a "long" description for micrometer. I am assuming long means more than a sentence or two. If there are no known negative implications, then should probably not worry about it. For point number two, markdown is meant to be readable in source form. So as long as the characters used by markdown do not cause problems for micrometer then it seems ok to include it. |
@keith-turner sounds good. I created #4870 to track this. |
I made a PR to the website to add the doc generated by these changes: apache/accumulo-website#442. Also, here is a screenshot of what things look like currently on the User manual page of the website when I run it from the linked branch: |
I think this PR is ready to be merged as far as I can tell. Once this is merged I plan to open a follow on PR in the hopes that everyone can contribute to adding/editing the descriptions for each metric. I have also verified that running |
Was there already a discussion about the table format that is used for the properties? If so, I'll go read that. |
Here is a link to where I proposed the current format: #4815 (comment) along with the comment that follows it. That was pretty much the whole discussion on the formatting. There is still time for more input/opinions as that is something that is pretty easy to change at this point. Do you a table better than how it is now with different sections per metric? @dlmarion |
@DomGarguilo - Looking at the server configuration properties table, I like how the entries are more condensed and that there is a separator between each one. If we end up having a short description, and a longer explanation, then I can see how that might not work well in a table. Can the current format be adjusted to put a line separator between each metric, and to reduce the whitespace within the lines of the elements for each metric? |
Yea I think those would be good improvements. I'll try to do that. I think once this is merged and the follow on PR is created to fill out or improve all the descriptions, that will also give us a better idea of whether a table or "list" format would be better. |
In e818f6d I added some more style changes so that the metrics page will render with alternating background colors per metric as well as reduced line break between fields: I think this looks nice and did this as opposed to a line separator since there is one after each metrics section title (e.g. "General Server Metrics", "Compactor Metrics", etc.) |
@DomGarguilo - this looks better, thanks for adding this change. |
Fixes #4815
Metrics
, which is similar toProperty
where we can add documentation for each metricMetricsDocGen
class which pulls the data fromMetrics
and constructs a markdown document from it