Azure / Azure/azure-sdk-for-java

[BUG] io.netty.channel.ConnectTimeoutException after one minute of running

Open
#41,929 10 comments 1 reaction 1 assignee Claimed by @heyams View on GitHub
bug customer-reported needs-team-attention OpenTelemetry
Dominant language
Java
Stars
2.6k
Forks
2.2k
Avg merge
2d 8h
Merged PRs (30d)
178

Description

**Describe the bug**
An error message in the log output.

***Exception or Stack Trace***
_[AzureMetadataService-0] ERROR com.azure.core.http.netty.NettyAsyncHttpClient - io.netty.channel.ConnectTimeoutException: connection timed out after 10000 ms: /169.254.169.254:80_
No stack trace is printed.

**To Reproduce**
1. Create a Scala project
2. Copy the below code
3. Run sbt console
4. Issue `run` command
5. Keep sbt console running and wait for ~70 seconds

***Code Snippet***

build.sbt:
```scala
libraryDependencies += "org.slf4j" % "slf4j-simple" % "2.0.16"
libraryDependencies += "com.azure" % "azure-monitor-opentelemetry-exporter" % "1.0.0-beta.28"
```

Main.scala
```scala
object Main extends App {
val aiConnStr = "..."

import io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdk
import com.azure.monitor.opentelemetry.exporter.AzureMonitorExporterBuilder

val sdkBuilder = AutoConfiguredOpenTelemetrySdk.builder()

new AzureMonitorExporterBuilder()
.connectionString(aiConnStr)
.install(sdkBuilder)

val openTelemetry = sdkBuilder.build().getOpenTelemetrySdk()
println("Auto-configured")

val meter = openTelemetry.getMeter("my-meter")
val gauge = meter.gaugeBuilder("my-gauge").build()
gauge.set(111)
println("metric sent")

openTelemetry.shutdown()
println("Done")
}
```

**Expected behavior**
No error messaegs.

**Screenshots**
N/A

**Setup (please complete the following information):**
- OS: 14.6.1 (23G93)
- IDE: VSCode
- Library/Libraries: azure-monitor-opentelemetry-exporter 1.0.0-beta.28
- Java version: 8
- Scala version: 3.5.0
- sbt version: 1.10.2
- App Server/Environment: N/A
- Frameworks: N/A

**Additional context**
The message seems benign, and does not affect the subsequent operation. Still, not clear what is the endpoint it is complaining about.

**Information Checklist**
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
- [x] Bug Description Added
- [x] Repro Steps Added
- [x] Setup information Added

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.