[ https://issues.apache.org/jira/browse/SLING-8372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16825449#comment-16825449 ]
Timothee Maret edited comment on SLING-8372 at 4/24/19 7:24 PM: ---------------------------------------------------------------- Thanks [~akrainiouk]! I looked at the PR, I suggest a simplification. The PR duplicates the journalAvailable state. Indeed, we already register a {{JournalAvailable}} service when the journal is available and unregister the {{JournalAvailable}} service when the journal is not available. The {{DistributionMetricsService}} could have an optional reference on the {{JournalAvailable}} service to populate the gauge. You may setup this reference as follow. {code:java} @Reference(policy=ReferencePolicy.DYNAMIC, cardinality=ReferenceCardinality.OPTIONAL) private volatile JournalAvailable journalAvailable; {code} was (Author: marett): Thanks [~akrainiouk]! I looked at the PR, I suggest a simplification. The PR duplicates the journalAvailable state. Indeed, we already register a {{JournalAvailable}} service when the journal is available and unregister the {{JournalAvailable}} service when the journal is not available. The {{DistributionMetricsService}} could have an optional reference on the {{JournalAvailable}} service to populate the gauge. You may setup this reference as follow. {code:java} @Reference(cardinality=ReferenceCardinality.OPTIONAL) private volatile JournalAvailable journalAvailable; {code} > Add sling metric for journal availability > ----------------------------------------- > > Key: SLING-8372 > URL: https://issues.apache.org/jira/browse/SLING-8372 > Project: Sling > Issue Type: Improvement > Components: Content Distribution > Affects Versions: Content Distribution Journal Core 0.1.0 > Reporter: Alexei Krainiouk > Assignee: Timothee Maret > Priority: Major > Fix For: Content Distribution Journal Core 0.1.2 > > Time Spent: 10m > Remaining Estimate: 0h > > Currently journal availability is monitored and logged but not exposed via > sling metrics. > This improvment adds `journal_available` Gauge metric reflecting current > journal status. > Pull request: > https://github.com/apache/sling-org-apache-sling-distribution-journal/pull/1 -- This message was sent by Atlassian JIRA (v7.6.3#76005)