-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only use OpenTelemetry SDK and refactor tests
- Loading branch information
Showing
19 changed files
with
159 additions
and
239 deletions.
There are no files selected for viewing
9 changes: 0 additions & 9 deletions
9
api/src/main/java/be/orbinson/aem/opentelemetry/metrics/api/OpenTelemetryMetric.java
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
api/src/main/java/be/orbinson/aem/opentelemetry/metrics/api/package-info.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
api/src/main/java/be/orbinson/aem/opentelemetry/services/api/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
@Version("1.0.0") | ||
@Version("1.1.0") | ||
package be.orbinson.aem.opentelemetry.services.api; | ||
|
||
import org.osgi.annotation.versioning.Version; |
2 changes: 1 addition & 1 deletion
2
...opentelemetry/core/ContextPropagator.java → ...metry/core/context/ContextPropagator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../src/main/java/be/orbinson/aem/opentelemetry/core/filters/OpenTelemetryRequestFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...services/AttributeLogRecordProcessor.java → ...ore/logs/AttributeLogRecordProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 0 additions & 41 deletions
41
core/src/main/java/be/orbinson/aem/opentelemetry/core/metrics/DistributionQueueGauage.java
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
...src/main/java/be/orbinson/aem/opentelemetry/core/metrics/DistributionQueueSizeGauage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package be.orbinson.aem.opentelemetry.core.metrics; | ||
|
||
import be.orbinson.aem.opentelemetry.services.api.OpenTelemetryConfig; | ||
import be.orbinson.aem.opentelemetry.services.api.OpenTelemetryFactory; | ||
import io.opentelemetry.api.OpenTelemetry; | ||
import io.opentelemetry.api.metrics.ObservableDoubleMeasurement; | ||
import org.apache.sling.distribution.agent.spi.DistributionAgent; | ||
import org.apache.sling.distribution.queue.spi.DistributionQueue; | ||
import org.osgi.service.component.annotations.Activate; | ||
import org.osgi.service.component.annotations.Component; | ||
import org.osgi.service.component.annotations.Reference; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
@Component | ||
public class DistributionQueueSizeGauage { | ||
|
||
private static final Logger LOG = LoggerFactory.getLogger(DistributionQueueSizeGauage.class); | ||
|
||
@Reference | ||
OpenTelemetryFactory openTelemetryFactory; | ||
|
||
@Reference | ||
OpenTelemetryConfig openTelemetryConfig; | ||
|
||
@Reference | ||
DistributionAgent distributionAgent; | ||
|
||
@Activate | ||
public void activate() { | ||
if (openTelemetryConfig.exportMetrics()) { | ||
OpenTelemetry openTelemetry = openTelemetryFactory.get(); | ||
|
||
openTelemetry.getMeter(openTelemetryConfig.instrumentationScopeName()) | ||
.gaugeBuilder("distribution.queue.size") | ||
.setDescription("The size of the distribution queue") | ||
.setUnit("items") | ||
.buildWithCallback(this::callback); | ||
} | ||
} | ||
|
||
public void callback(ObservableDoubleMeasurement measurement) { | ||
int size = 0; | ||
if (distributionAgent != null) { | ||
DistributionQueue distributionQueue = distributionAgent.getQueue("main"); | ||
if (distributionQueue != null) { | ||
size = distributionQueue.getStatus().getItemsCount(); | ||
} else { | ||
LOG.warn("Distribution queue 'main' is not available"); | ||
} | ||
} else { | ||
LOG.warn("Distribution agent is not available"); | ||
} | ||
measurement.record(size); | ||
} | ||
} |
57 changes: 0 additions & 57 deletions
57
core/src/main/java/be/orbinson/aem/opentelemetry/core/services/MetricsProvider.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...telemetry/core/ContextPropagatorTest.java → ...y/core/context/ContextPropagatorTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.