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

OpenTelemetry Metrics Support for Live Metrics #3792

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9bba04b
got logs to show on terminal
t-nsukumar Jul 3, 2024
f1bd767
working base version
t-nsukumar Jul 3, 2024
2571ea2
Merge branch 't-nsukumar/experimentation' into main
navsukumar Jul 9, 2024
8d1606a
Merge pull request #1 from navsukumar/main
navsukumar Jul 9, 2024
45c2138
code for sending opentel metrics
t-nsukumar Jul 9, 2024
669eb65
Merge branch 'microsoft:main' into main
navsukumar Jul 11, 2024
51477eb
Merge branch 'microsoft:main' into t-nsukumar/experimentation
navsukumar Jul 11, 2024
a014bbe
fixed custom metrics to display on Live
t-nsukumar Jul 11, 2024
cecb4da
adding exporter config files for PR
t-nsukumar Jul 12, 2024
4d03ba9
updated exporter jar
t-nsukumar Jul 12, 2024
2251850
Merge branch 'microsoft:main' into main
navsukumar Jul 12, 2024
c0ef1e9
Merge branch 'microsoft:main' into t-nsukumar/experimentation
navsukumar Jul 12, 2024
a485eb4
Merge branch 'microsoft:main' into main
navsukumar Jul 16, 2024
7d43bd6
Merge branch 'microsoft:main' into t-nsukumar/experimentation
navsukumar Jul 16, 2024
a53bed2
working version
t-nsukumar Jul 16, 2024
46167af
Merge branch 'microsoft:main' into main
navsukumar Jul 18, 2024
c709d3e
Merge branch 'microsoft:main' into t-nsukumar/experimentation
navsukumar Jul 18, 2024
24901a8
working version
t-nsukumar Jul 19, 2024
a616a81
fixed code style violations
t-nsukumar Jul 23, 2024
6a2d465
Merge branch 'main' into t-nsukumar/experimentation
navsukumar Jul 23, 2024
11f5061
Merge branch 'microsoft:main' into main
navsukumar Jul 23, 2024
28cf22e
Merge branch 'main' into t-nsukumar/experimentation
heyams Jul 24, 2024
3ae760e
Merge branch 'main' into t-nsukumar/experimentation
heyams Jul 29, 2024
38f81a2
pulled latest
t-nsukumar Aug 13, 2024
3bb441d
Merge branch 'main' into t-nsukumar/experimentation
t-nsukumar Aug 13, 2024
8a7988d
merged upstream
t-nsukumar Aug 14, 2024
4d22643
merged main to branch
t-nsukumar Aug 14, 2024
bff1cb5
commiting with new liscense and exporter jar
t-nsukumar Aug 14, 2024
5c579e7
updated exporter pom and jar
t-nsukumar Aug 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
required: false

env:
EXPORTER_VERSION: 1.0.0-beta.28 # to be updated with the latest version
EXPORTER_VERSION: 1.0.0-beta.29 # to be updated with the latest version

jobs:
spotless:
Expand Down
2 changes: 1 addition & 1 deletion agent/agent-tooling/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies {
implementation(project(":agent:agent-profiler:agent-diagnostics"))
implementation(project(":etw:java"))

implementation("com.azure:azure-monitor-opentelemetry-exporter:1.0.0-beta.28")
implementation("com.azure:azure-monitor-opentelemetry-exporter:1.0.0-beta.29")
compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-bootstrap")
compileOnly("io.opentelemetry.javaagent:opentelemetry-javaagent-tooling")
compileOnly("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-servlet-common-bootstrap")
Expand Down
2 changes: 1 addition & 1 deletion agent/agent-tooling/gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ com.azure:azure-core-http-netty:1.15.2=runtimeClasspath
com.azure:azure-core:1.50.0=runtimeClasspath
com.azure:azure-identity:1.13.1=runtimeClasspath
com.azure:azure-json:1.2.0=runtimeClasspath
com.azure:azure-monitor-opentelemetry-exporter:1.0.0-beta.28=runtimeClasspath
com.azure:azure-monitor-opentelemetry-exporter:1.0.0-beta.29=runtimeClasspath
com.azure:azure-sdk-bom:1.2.26=runtimeClasspath
com.azure:azure-storage-blob:12.27.0=runtimeClasspath
com.azure:azure-storage-common:12.26.0=runtimeClasspath
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.azure.monitor.opentelemetry.exporter.implementation.heartbeat.HeartbeatExporter;
import com.azure.monitor.opentelemetry.exporter.implementation.models.TelemetryItem;
import com.azure.monitor.opentelemetry.exporter.implementation.quickpulse.QuickPulse;
import com.azure.monitor.opentelemetry.exporter.implementation.quickpulse.QuickPulseMetricReader;
import com.azure.monitor.opentelemetry.exporter.implementation.statsbeat.Feature;
import com.azure.monitor.opentelemetry.exporter.implementation.statsbeat.StatsbeatModule;
import com.azure.monitor.opentelemetry.exporter.implementation.utils.AzureMonitorHelper;
Expand Down Expand Up @@ -218,6 +219,8 @@ public void customize(AutoConfigurationCustomizer autoConfiguration) {
// TODO (trask) add this method to AutoConfigurationCustomizer upstream?
((AutoConfiguredOpenTelemetrySdkBuilder) autoConfiguration).disableShutdownHook();

QuickPulseMetricReader liveMetricReader = new QuickPulseMetricReader();

QuickPulse quickPulse;
if (configuration.preview.liveMetrics.enabled) {
quickPulse =
Expand All @@ -231,6 +234,10 @@ public void customize(AutoConfigurationCustomizer autoConfiguration) {
telemetryClient.getRoleName(),
telemetryClient.getRoleInstance(),
configuration.preview.useNormalizedValueForNonNormalizedCpuPercentage,
liveMetricReader,
new MetricDataMapper(
telemetryClient::populateDefaults,
configuration.preview.captureHttpServer4xxAsError),
FirstEntryPoint.getAgentVersion());
} else {
quickPulse = null;
Expand Down Expand Up @@ -291,6 +298,11 @@ public void customize(AutoConfigurationCustomizer autoConfiguration) {
return metricExporter;
}
})
.addMeterProviderCustomizer(
(meterProviderBuilder, configProperties) -> {
meterProviderBuilder.registerMetricReader(liveMetricReader);
return meterProviderBuilder;
})
.addLogRecordExporterCustomizer(
(logRecordExporter, configProperties) -> {
if (logRecordExporter
Expand Down
Binary file not shown.
250 changes: 250 additions & 0 deletions azure-monitor-opentelemetry-exporter-1.0.0-beta.29.pom
Original file line number Diff line number Diff line change
@@ -0,0 +1,250 @@
<!-- Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. -->

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>com.azure</groupId>
<artifactId>azure-client-sdk-parent</artifactId>
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
</parent>

<groupId>com.azure</groupId>
<artifactId>azure-monitor-opentelemetry-exporter</artifactId>
<version>1.0.0-beta.29</version> <!-- {x-version-update;com.azure:azure-monitor-opentelemetry-exporter;current} -->

<name>Microsoft Azure SDK for OpenTelemetry Azure Monitor Exporter</name>
<description>This package contains Microsoft Azure SDK for OpenTelemetry Azure Monitor Exporter.</description>

<distributionManagement>
<site>
<id>azure-java-build-docs</id>
<url>${site.url}/site/${project.artifactId}</url>
</site>
</distributionManagement>

<scm>
<url>https://github.com/Azure/azure-sdk-for-java</url>
</scm>

<properties>
<jacoco.min.linecoverage>0.30</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0.20</jacoco.min.branchcoverage>
<!-- Configures the Java 9+ run to perform the required module exports, opens, and reads that are necessary for testing but shouldn't be part of the module-info. -->
<javaModulesSurefireArgLine>
--add-opens com.azure.monitor.opentelemetry.exporter/com.azure.monitor.opentelemetry.exporter=ALL-UNNAMED
</javaModulesSurefireArgLine>
<checkstyle.excludes>**/implementation/**/*.java</checkstyle.excludes>
<spotless.skip>false</spotless.skip>
</properties>

<dependencies>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
<version>1.51.0</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-json</artifactId>
<version>1.2.0</version> <!-- {x-version-update;com.azure:azure-json;dependency} -->
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-http-netty</artifactId>
<version>1.15.3</version> <!-- {x-version-update;com.azure:azure-core-http-netty;dependency} -->
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-api</artifactId>
<version>1.40.0</version> <!-- {x-version-update;io.opentelemetry:opentelemetry-api;external_dependency} -->
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk</artifactId>
<version>1.40.0</version> <!-- {x-version-update;io.opentelemetry:opentelemetry-sdk;external_dependency} -->
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-metrics</artifactId>
<version>1.40.0</version> <!-- {x-version-update;io.opentelemetry:opentelemetry-sdk-metrics;external_dependency} -->
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-logs</artifactId>
<version>1.40.0</version> <!-- {x-version-update;io.opentelemetry:opentelemetry-sdk-logs;external_dependency} -->
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-extension-autoconfigure-spi</artifactId>
<version>1.40.0</version> <!-- {x-version-update;io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi;external_dependency} -->
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-extension-autoconfigure</artifactId>
<version>1.40.0</version> <!-- {x-version-update;io.opentelemetry:opentelemetry-sdk-extension-autoconfigure;external_dependency} -->
</dependency>
<dependency>
<groupId>io.opentelemetry.semconv</groupId>
<artifactId>opentelemetry-semconv-incubating</artifactId>
<version>1.25.0-alpha</version> <!-- {x-version-update;io.opentelemetry.semconv:opentelemetry-semconv-incubating;external_dependency} -->
</dependency>

<!-- Added this dependency to include necessary annotations used by reactor core.
Without this dependency, javadoc throws a warning as it cannot find enum When.MAYBE
which is used in @Nullable annotation in reactor core classes -->
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version> <!-- {x-version-update;com.google.code.findbugs:jsr305;external_dependency} -->
<scope>provided</scope>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.36</version> <!-- {x-version-update;org.slf4j:slf4j-simple;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.9.3</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-api;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.9.3</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-engine;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.9.3</version> <!-- {x-version-update;org.junit.jupiter:junit-jupiter-params;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.22.0</version> <!-- {x-version-update;org.assertj:assertj-core;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.11.0</version> <!-- {x-version-update;org.mockito:mockito-core;external_dependency} -->
<scope>test</scope>
</dependency>
<!-- bytebuddy dependencies are required for mockito 4.11.0 to work with Java 21. Mockito 4.11.0 is the last release -->
<!-- of Mockito supporting Java 8 as a baseline. -->
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.14.12</version> <!-- {x-version-update;testdep_net.bytebuddy:byte-buddy;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
<version>1.14.12</version> <!-- {x-version-update;testdep_net.bytebuddy:byte-buddy-agent;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-testing</artifactId>
<version>1.40.0</version> <!-- {x-version-update;io.opentelemetry:opentelemetry-sdk-testing;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-data-appconfiguration</artifactId>
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-data-appconfiguration;dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-messaging-eventhubs</artifactId>
<version>5.18.6</version> <!-- {x-version-update;com.azure:azure-messaging-eventhubs;dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opentelemetry</artifactId>
<version>1.0.0-beta.48</version> <!-- {x-version-update;com.azure:azure-core-tracing-opentelemetry;dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-test</artifactId>
<version>1.26.2</version> <!-- {x-version-update;com.azure:azure-core-test;dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-messaging-eventhubs-checkpointstore-blob</artifactId>
<version>1.19.6</version> <!-- {x-version-update;com.azure:azure-messaging-eventhubs-checkpointstore-blob;dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
<version>1.13.2</version> <!-- {x-version-update;com.azure:azure-identity;dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>4.2.0</version> <!-- {x-version-update;org.awaitility:awaitility;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.github.hakky54</groupId>
<artifactId>logcaptor</artifactId>
<version>2.9.0</version> <!-- {x-version-update;io.github.hakky54:logcaptor;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
<version>3.9.0</version> <!-- {x-version-update;com.squareup.okio:okio;external_dependency} -->
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.4.1</version> <!-- {x-version-update;org.apache.maven.plugins:maven-enforcer-plugin;external_dependency} -->
<configuration>
<rules>
<bannedDependencies>
<includes>
<include>io.opentelemetry:opentelemetry-api:[1.40.0]</include> <!-- {x-include-update;io.opentelemetry:opentelemetry-api;external_dependency} -->
<include>io.opentelemetry:opentelemetry-sdk:[1.40.0]</include> <!-- {x-include-update;io.opentelemetry:opentelemetry-sdk;external_dependency} -->
<include>io.opentelemetry:opentelemetry-sdk-metrics:[1.40.0]</include> <!-- {x-include-update;io.opentelemetry:opentelemetry-sdk-metrics;external_dependency} -->
<include>io.opentelemetry:opentelemetry-sdk-logs:[1.40.0]</include> <!-- {x-include-update;io.opentelemetry:opentelemetry-sdk-logs;external_dependency} -->
<include>io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi:[1.40.0]</include> <!-- {x-include-update;io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi;external_dependency} -->
<include>io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:[1.40.0]</include> <!-- {x-include-update;io.opentelemetry:opentelemetry-sdk-extension-autoconfigure;external_dependency} -->
<include>io.opentelemetry.semconv:opentelemetry-semconv-incubating:[1.25.0-alpha]</include> <!-- {x-include-update;io.opentelemetry.semconv:opentelemetry-semconv-incubating;external_dependency} -->
<include>com.squareup.okio:okio:[3.9.0]</include> <!-- {x-include-update;com.squareup.okio:okio;external_dependency} -->
</includes>
</bannedDependencies>
</rules>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.2.5</version> <!-- {x-version-update;org.apache.maven.plugins:maven-surefire-plugin;external_dependency} -->
</plugin>
</plugins>
</build>
</project>
4 changes: 2 additions & 2 deletions licenses/more-licenses.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# agent
## Dependency License Report
_2024-08-12 03:55:56 UTC_
_2024-08-13 17:34:01 PDT_
## Apache License, Version 2.0

**1** **Group:** `com.fasterxml.jackson.core` **Name:** `jackson-annotations` **Version:** `2.17.2`
Expand Down Expand Up @@ -362,7 +362,7 @@ _2024-08-12 03:55:56 UTC_
> - **POM Project URL**: [https://github.com/Azure/azure-sdk-for-java](https://github.com/Azure/azure-sdk-for-java)
> - **POM License**: MIT License - [https://opensource.org/licenses/MIT](https://opensource.org/licenses/MIT)

**70** **Group:** `com.azure` **Name:** `azure-monitor-opentelemetry-exporter` **Version:** `1.0.0-beta.28`
**70** **Group:** `com.azure` **Name:** `azure-monitor-opentelemetry-exporter` **Version:** `1.0.0-beta.29`
> - **POM License**: MIT License - [https://opensource.org/licenses/MIT](https://opensource.org/licenses/MIT)

**71** **Group:** `com.azure` **Name:** `azure-storage-blob` **Version:** `12.27.0`
Expand Down