[ 
https://issues.apache.org/jira/browse/HDDS-910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16720216#comment-16720216
 ] 

Elek, Marton commented on HDDS-910:
-----------------------------------

HDFS-8232 and HDFS-10984 are different. There were no registered metrics at 
all. And instead of using @Metric annotations a manual MetericsSink method was 
added.

But here we have the @Metrics annotations so we don't need to implement the 
MetricsSource (AFAIK) as a source will be added anyway by the code which is 
commented by me earlier.

I just tested it locally with the following code:

{code}
    DefaultMetricsSystem.initialize("test");
    OMMetrics source = new OMMetrics();
    DefaultMetricsSystem.instance().register(source);
    for (int i = 0; i < 10; i++) {
      source.incNumVolumeCreates();
      Thread.sleep(1000);
    }
{code}

And the following configuration:

{code}
test.sink.file.class=org.apache.hadoop.metrics2.sink.FileSink
*.period=1
test.sink.file.filename=/tmp/metrics.out
{code}

And got a lot of metric links in the /tmp/metrics.out

{code}
1544710353589 dfs.OMMetrics: Context=dfs, Hostname=sc, NumVolumeOps=10, 
NumBucketOps=0, NumKeyOps=0, NumVolumeCreates=10, NumVolumeUpdates=0, 
NumVolumeInfos=0, NumVolumeCheckAccesses=0, NumBucketCreates=0, 
NumVolumeDeletes=0, NumBucketInfos=0, NumBucketUpdates=0, NumBucketDeletes=0, 
NumKeyAllocate=0, NumKeyLookup=0, NumKeyRenames=0, NumKeyDeletes=0, 
NumBucketLists=0, NumKeyLists=0, NumVolumeLists=0, NumKeyCommits=0, 
NumAllocateBlockCalls=0, NumGetServiceLists=0, NumListS3Buckets=0, 
NumInitiateMultipartUploads=0, NumVolumeCreateFails=0, NumVolumeUpdateFails=0, 
NumVolumeInfoFails=0, NumVolumeDeleteFails=0, NumBucketCreateFails=0, 
NumVolumeCheckAccessFails=0, NumBucketInfoFails=0, NumBucketUpdateFails=0, 
NumBucketDeleteFails=0, NumKeyAllocateFails=0, NumKeyLookupFails=0, 
NumKeyRenameFails=0, NumKeyDeleteFails=0, NumBucketListFails=0, 
NumKeyListFails=0, NumVolumeListFails=0, NumKeyCommitFails=0, 
NumBlockAllocateCallFails=0, NumGetServiceListFails=0, NumListS3BucketsFails=0, 
NumInitiateMultipartUploadFails=0, NumCommitMultipartUploadParts=0, 
GetNumCommitMultipartUploadPartFails=0, NumVolumes=0, NumBuckets=0, NumKeys=0
1544710353590 metricssystem.MetricsSystem: Context=metricssystem, Hostname=sc, 
NumActiveSources=1, NumAllSources=1, NumActiveSinks=1, NumAllSinks=0, 
Sink_fileNumOps=9, Sink_fileAvgTime=2.0, Sink_fileDropped=0, Sink_fileQsize=0, 
SnapshotNumOps=19, SnapshotAvgTime=0.0, PublishNumOps=9, PublishAvgTime=0.0, 
DroppedPubAll=0
{code}

It seems to be working. And any sink can receive all of the metrics without 
problem.

I think it's very important to make ozone metrics available from ambari, but 
would be great to know the real problem to solve it for all feature ozone 
metrics, too.

> Expose OMMetrics
> ----------------
>
>                 Key: HDDS-910
>                 URL: https://issues.apache.org/jira/browse/HDDS-910
>             Project: Hadoop Distributed Data Store
>          Issue Type: Bug
>            Reporter: Bharat Viswanadham
>            Assignee: Bharat Viswanadham
>            Priority: Major
>         Attachments: HDDS-910.00.patch
>
>
> Implement MetricsSource interface, so that external metrics can collect the 
> OMMetrics.
>  
> From *MetricsSource.java:*
> It registers with \{@link MetricsSystem}, which periodically polls it to 
> collect \{@link MetricsRecord} and passes it to \{@link MetricsSink}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to