Skip to content

Commit

Permalink
Add module info to OpenTelemetry autoconfigure (Azure#43313)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanbisutti authored Dec 12, 2024
1 parent bbb5789 commit d8482ff
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 17 deletions.
6 changes: 0 additions & 6 deletions sdk/monitor/azure-monitor-opentelemetry-autoconfigure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,6 @@
<version>2.9.3</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.1</version> <!-- {x-version-update;com.squareup.okio:okio;external_dependency} -->
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

module com.azure.monitor.opentelemetry.autoconfigure {

requires transitive com.azure.core;

requires java.management;

requires io.netty.handler;

requires io.opentelemetry.api;
requires io.opentelemetry.context;
requires io.opentelemetry.sdk.autoconfigure.spi;
requires io.opentelemetry.sdk.common;
requires io.opentelemetry.sdk.logs;
requires io.opentelemetry.sdk.metrics;
requires io.opentelemetry.sdk.trace;
requires io.opentelemetry.semconv;
requires io.opentelemetry.semconv.incubating;

opens com.azure.monitor.opentelemetry.autoconfigure.implementation.models to com.azure.core;
opens com.azure.monitor.opentelemetry.autoconfigure.implementation.quickpulse.swagger.models to com.azure.core;

provides io.opentelemetry.sdk.autoconfigure.spi.logs.ConfigurableLogRecordExporterProvider
with com.azure.monitor.opentelemetry.autoconfigure.implementation.AzureMonitorLogRecordExporterProvider;
provides io.opentelemetry.sdk.autoconfigure.spi.metrics.ConfigurableMetricExporterProvider
with com.azure.monitor.opentelemetry.autoconfigure.implementation.AzureMonitorMetricExporterProvider;
provides io.opentelemetry.sdk.autoconfigure.spi.traces.ConfigurableSpanExporterProvider
with com.azure.monitor.opentelemetry.autoconfigure.implementation.AzureMonitorSpanExporterProvider;

exports com.azure.monitor.opentelemetry.autoconfigure;

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@

package com.azure.monitor.opentelemetry.autoconfigure.implementation.statsbeat;

import okio.BufferedSource;
import okio.Okio;
import org.junit.jupiter.api.Test;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;

Expand All @@ -21,10 +19,8 @@ public class AzureMetadataServiceTest {
public void testParseJsonResponseLinux() throws IOException {
Path path
= new File(getClass().getClassLoader().getResource("metadata_instance_linux.json").getPath()).toPath();
InputStream in = Files.newInputStream(path);
BufferedSource source = Okio.buffer(Okio.source(in));
String result = source.readUtf8();
source.close();
byte[] fileContent = Files.readAllBytes(path);
String result = new String(fileContent, StandardCharsets.UTF_8);

AttachStatsbeat attachStatsbeat = new AttachStatsbeat(new CustomDimensions());
AzureMetadataService azureMetadataService
Expand All @@ -43,10 +39,8 @@ public void testParseJsonResponseLinux() throws IOException {
public void testParseJsonResponseWindows() throws IOException {
Path path
= new File(getClass().getClassLoader().getResource("metadata_instance_windows.json").getPath()).toPath();
InputStream in = Files.newInputStream(path);
BufferedSource source = Okio.buffer(Okio.source(in));
String result = source.readUtf8();
source.close();
byte[] fileContent = Files.readAllBytes(path);
String result = new String(fileContent, StandardCharsets.UTF_8);

AttachStatsbeat attachStatsbeat = new AttachStatsbeat(new CustomDimensions());
AzureMetadataService azureMetadataService
Expand Down

0 comments on commit d8482ff

Please sign in to comment.