Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 7 additions & 8 deletions .github/workflows/spring-boot-4-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,13 @@ jobs:
--auto-init "false" \
--build "true"

# needs a fix in opentelemetry-spring-boot-starter
# - name: Run sentry-samples-spring-boot-4-opentelemetry-noagent
# run: |
# python3 test/system-test-runner.py test \
# --module "sentry-samples-spring-boot-4-opentelemetry-noagent" \
# --agent false \
# --auto-init "true" \
# --build "true"
- name: Run sentry-samples-spring-boot-4-opentelemetry-noagent
run: |
python3 test/system-test-runner.py test \
--module "sentry-samples-spring-boot-4-opentelemetry-noagent" \
--agent false \
--auto-init "true" \
--build "true"

- name: Run sentry-samples-spring-7
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/system-tests-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ jobs:
- sample: "sentry-samples-spring-boot-4-webflux"
agent: "false"
agent-auto-init: "true"
# - sample: "sentry-samples-spring-boot-4-opentelemetry-noagent"
# agent: "false"
# agent-auto-init: "true"
- sample: "sentry-samples-spring-boot-4-opentelemetry-noagent"
agent: "false"
agent-auto-init: "true"
- sample: "sentry-samples-spring-boot-4-opentelemetry"
agent: "true"
agent-auto-init: "true"
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
}
```

### Dependencies

- Bump OpenTelemetry ([#5225](https://github.com/getsentry/sentry-java/pull/5225))
- `opentelemetry` to `1.60.1` (was `1.57.0`)
- `opentelemetry-instrumentation` to `2.26.0` (was `2.23.0`)
- `opentelemetry-instrumentation-alpha` to `2.26.0-alpha` (was `2.23.0-alpha`)
- `opentelemetry-semconv` to `1.40.0` (was `1.37.0`)
- `opentelemetry-semconv-alpha` to `1.40.0-alpha` (was `1.37.0-alpha`)

## 8.36.0

### Features
Expand Down
10 changes: 5 additions & 5 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ nopen = "1.0.1"
# see https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-compatibility-and-versioning.html#kotlin-compatibility
# see https://developer.android.com/jetpack/androidx/releases/compose-kotlin
okhttp = "4.9.2"
otel = "1.57.0"
otelInstrumentation = "2.23.0"
otelInstrumentationAlpha = "2.23.0-alpha"
otel = "1.60.1"
otelInstrumentation = "2.26.0"
otelInstrumentationAlpha = "2.26.0-alpha"
# check https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/dependencyManagement/build.gradle.kts#L49 for release version above to find a compatible version
otelSemanticConventions = "1.37.0"
otelSemanticConventionsAlpha = "1.37.0-alpha"
otelSemanticConventions = "1.40.0"
otelSemanticConventionsAlpha = "1.40.0-alpha"
retrofit = "2.9.0"
slf4j = "1.7.30"
springboot2 = "2.7.18"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package io.sentry.opentelemetry

import io.opentelemetry.api.common.AttributeKey
import io.opentelemetry.sdk.internal.AttributesMap
import io.opentelemetry.sdk.trace.SpanLimits
import io.opentelemetry.api.common.Attributes
import io.opentelemetry.sdk.trace.data.SpanData
import io.opentelemetry.semconv.HttpAttributes
import io.opentelemetry.semconv.ServerAttributes
Expand All @@ -22,12 +21,12 @@ import org.mockito.kotlin.whenever
class OpenTelemetryAttributesExtractorTest {
private class Fixture {
val spanData = mock<SpanData>()
val attributes = AttributesMap.create(100, SpanLimits.getDefault().maxAttributeValueLength)
var attributes: Attributes = Attributes.empty()
val options = SentryOptions.empty()
val scope = Scope(options)

init {
whenever(spanData.attributes).thenReturn(attributes)
whenever(spanData.attributes).thenAnswer { attributes }
}
}

Expand Down Expand Up @@ -346,7 +345,22 @@ class OpenTelemetryAttributesExtractorTest {
}

private fun givenAttributes(map: Map<AttributeKey<out Any>, Any>) {
map.forEach { k, v -> fixture.attributes.put(k, v) }
fixture.attributes = buildAttributes(map)
}

private fun buildAttributes(map: Map<AttributeKey<out Any>, Any>): Attributes {
val builder = Attributes.builder()
map.forEach { (key, value) -> putAttribute(builder, key, value) }
return builder.build()
}

@Suppress("UNCHECKED_CAST")
private fun putAttribute(
builder: io.opentelemetry.api.common.AttributesBuilder,
key: AttributeKey<out Any>,
value: Any,
) {
builder.put(key as AttributeKey<Any>, value)
}

private fun whenExtractingAttributes() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package io.sentry.opentelemetry

import io.opentelemetry.api.common.AttributeKey
import io.opentelemetry.api.common.Attributes
import io.opentelemetry.api.trace.SpanKind
import io.opentelemetry.sdk.internal.AttributesMap
import io.opentelemetry.semconv.HttpAttributes
import io.opentelemetry.semconv.ServerAttributes
import io.opentelemetry.semconv.UrlAttributes
Expand All @@ -17,7 +17,7 @@ import org.mockito.kotlin.whenever
class OtelInternalSpanDetectionUtilTest {
private class Fixture {
val scopes = mock<IScopes>()
val attributes = AttributesMap.create(100, 100)
var attributes: Attributes = Attributes.empty()
val options = SentryOptions.empty()
var spanKind: SpanKind = SpanKind.INTERNAL

Expand Down Expand Up @@ -152,7 +152,22 @@ class OtelInternalSpanDetectionUtilTest {
}

private fun givenAttributes(map: Map<AttributeKey<out Any>, Any>) {
map.forEach { k, v -> fixture.attributes.put(k, v) }
fixture.attributes = buildAttributes(map)
}

private fun buildAttributes(map: Map<AttributeKey<out Any>, Any>): Attributes {
val builder = Attributes.builder()
map.forEach { (key, value) -> putAttribute(builder, key, value) }
return builder.build()
}

@Suppress("UNCHECKED_CAST")
private fun putAttribute(
builder: io.opentelemetry.api.common.AttributesBuilder,
key: AttributeKey<out Any>,
value: Any,
) {
builder.put(key as AttributeKey<Any>, value)
}

private fun givenDsn(dsn: String) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package io.sentry.opentelemetry

import io.opentelemetry.api.common.AttributeKey
import io.opentelemetry.api.common.Attributes
import io.opentelemetry.api.trace.SpanContext
import io.opentelemetry.api.trace.SpanKind
import io.opentelemetry.api.trace.TraceFlags
import io.opentelemetry.api.trace.TraceState
import io.opentelemetry.sdk.internal.AttributesMap
import io.opentelemetry.sdk.trace.data.SpanData
import io.opentelemetry.semconv.HttpAttributes
import io.opentelemetry.semconv.UrlAttributes
Expand All @@ -22,14 +22,14 @@ class SpanDescriptionExtractorTest {
private class Fixture {
val sentrySpan = mock<IOtelSpanWrapper>()
val otelSpan = mock<SpanData>()
val attributes = AttributesMap.create(100, 100)
var attributes: Attributes = Attributes.empty()
var parentSpanContext = SpanContext.getInvalid()
var spanKind = SpanKind.INTERNAL
var spanName: String? = null
var spanDescription: String? = null

fun setup() {
whenever(otelSpan.attributes).thenReturn(attributes)
whenever(otelSpan.attributes).thenAnswer { attributes }
whenever(otelSpan.parentSpanContext).thenReturn(parentSpanContext)
whenever(otelSpan.kind).thenReturn(spanKind)
spanName?.let { whenever(otelSpan.name).thenReturn(it) }
Expand Down Expand Up @@ -271,7 +271,22 @@ class SpanDescriptionExtractorTest {
}

private fun givenAttributes(map: Map<AttributeKey<out Any>, Any>) {
map.forEach { k, v -> fixture.attributes.put(k, v) }
fixture.attributes = buildAttributes(map)
}

private fun buildAttributes(map: Map<AttributeKey<out Any>, Any>): Attributes {
val builder = Attributes.builder()
map.forEach { (key, value) -> putAttribute(builder, key, value) }
return builder.build()
}

@Suppress("UNCHECKED_CAST")
private fun putAttribute(
builder: io.opentelemetry.api.common.AttributesBuilder,
key: AttributeKey<out Any>,
value: Any,
) {
builder.put(key as AttributeKey<Any>, value)
}

private fun whenExtractingSpanInfo(): OtelSpanInfo {
Expand Down
Loading