mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[fleet, reporting] remove otel from api and rpc
GitOrigin-RevId: 27894fbdcec8fc287a57eb2eebd74d381556aec9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
178035b8f8
commit
ba71fb3770
@@ -13,13 +13,11 @@ jvm_library(
|
||||
name = "api",
|
||||
module_name = "fleet.reporting.api",
|
||||
visibility = ["//visibility:public"],
|
||||
srcs = glob(["srcCommonMain/**/*.kt", "srcCommonMain/**/*.java", "srcCommonMain/**/*.form", "srcJvmMain/**/*.kt", "srcJvmMain/**/*.java", "srcJvmMain/**/*.form"], allow_empty = True, exclude = ["**/module-info.java"]),
|
||||
srcs = glob(["srcCommonMain/**/*.kt", "srcCommonMain/**/*.java", "srcCommonMain/**/*.form"], allow_empty = True, exclude = ["**/module-info.java"]),
|
||||
kotlinc_opts = ":custom_api",
|
||||
deps = [
|
||||
"@lib//:kotlin-stdlib",
|
||||
"@lib//:kotlinx-coroutines-core",
|
||||
"@lib//:opentelemetry",
|
||||
"@lib//:opentelemetry-semconv",
|
||||
]
|
||||
)
|
||||
### auto-generated section `build fleet.reporting.api` end
|
||||
@@ -20,14 +20,11 @@
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/srcCommonMain" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/srcJvmMain" isTestSource="false" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/gradlebuild/build" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="kotlin-stdlib" level="project" />
|
||||
<orderEntry type="library" name="kotlinx-coroutines-core" level="project" />
|
||||
<orderEntry type="library" name="opentelemetry" level="project" />
|
||||
<orderEntry type="library" name="opentelemetry-semconv" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -58,8 +58,6 @@ kotlin {
|
||||
implementation(jps.com.intellij.platform.kotlinx.coroutines.core.jvm134738847.get().let { "${it.group}:kotlinx-coroutines-core:${it.version}" }) {
|
||||
isTransitive = false
|
||||
}
|
||||
implementation(jps.io.opentelemetry.opentelemetry.sdk966255575.get())
|
||||
implementation(jps.io.opentelemetry.semconv.opentelemetry.semconv489456914.get())
|
||||
}
|
||||
// KOTLIN__MARKER_END
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package fleet.tracing
|
||||
|
||||
import io.opentelemetry.api.GlobalOpenTelemetry
|
||||
import io.opentelemetry.api.OpenTelemetry
|
||||
import io.opentelemetry.api.metrics.Meter
|
||||
import io.opentelemetry.api.trace.Tracer
|
||||
|
||||
private const val FLEET_INSTRUMENTER_NAME = "fleet"
|
||||
|
||||
//this is a single instance that they recommend to use in OTel docs
|
||||
private val opentelemetry: OpenTelemetry by lazy { GlobalOpenTelemetry.get() }
|
||||
|
||||
val tracer: Tracer
|
||||
get() = opentelemetry.getTracer(FLEET_INSTRUMENTER_NAME)
|
||||
|
||||
val meter: Meter
|
||||
get() = opentelemetry.getMeter(FLEET_INSTRUMENTER_NAME)
|
||||
|
||||
//@fleet.kernel.plugins.InternalInPluginModules(where = ["fleet.reporting.opentelemetry"])
|
||||
const val CANCELLED_SPAN_ATTR = "Cancelled"
|
||||
@@ -1,26 +0,0 @@
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package fleet.tracing
|
||||
|
||||
import io.opentelemetry.api.trace.Span
|
||||
import io.opentelemetry.context.Context
|
||||
import io.opentelemetry.context.Scope
|
||||
import kotlinx.coroutines.ThreadContextElement
|
||||
import kotlin.coroutines.AbstractCoroutineContextElement
|
||||
import kotlin.coroutines.CoroutineContext
|
||||
|
||||
class TracingCoroutineElement(private val otelContext: Context) : ThreadContextElement<Scope>, AbstractCoroutineContextElement(
|
||||
TracingCoroutineElement) {
|
||||
companion object Key : CoroutineContext.Key<TracingCoroutineElement>
|
||||
|
||||
override fun restoreThreadContext(context: CoroutineContext, oldState: Scope) {
|
||||
oldState.close()
|
||||
}
|
||||
|
||||
override fun updateThreadContext(context: CoroutineContext): Scope {
|
||||
return otelContext.makeCurrent()
|
||||
}
|
||||
}
|
||||
|
||||
fun Span.asContextElement(): CoroutineContext.Element {
|
||||
return TracingCoroutineElement(Context.current().with(this))
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
@file:JvmName("SpanKt")
|
||||
@file:JvmMultifileClass
|
||||
|
||||
package fleet.tracing.runtime
|
||||
|
||||
import io.opentelemetry.api.common.AttributeKey
|
||||
import kotlin.jvm.JvmMultifileClass
|
||||
import kotlin.jvm.JvmName
|
||||
|
||||
//@fleet.kernel.plugins.InternalInPluginModules(where = ["fleet.reporting.opentelemetry"])
|
||||
val THREAD_ID_KEY: AttributeKey<Long> = AttributeKey.longKey("threadId")
|
||||
|
||||
@@ -25,8 +25,6 @@ jvm_library(
|
||||
"//fleet/reporting/shared",
|
||||
"//fleet/multiplatform.shims",
|
||||
"//fleet/util/core",
|
||||
"@lib//:opentelemetry",
|
||||
"@lib//:opentelemetry-semconv",
|
||||
]
|
||||
)
|
||||
### auto-generated section `build fleet.rpc.server` end
|
||||
@@ -34,7 +34,5 @@
|
||||
<orderEntry type="module" module-name="fleet.reporting.shared" />
|
||||
<orderEntry type="module" module-name="fleet.multiplatform.shims" />
|
||||
<orderEntry type="module" module-name="fleet.util.core" />
|
||||
<orderEntry type="library" name="opentelemetry" level="project" />
|
||||
<orderEntry type="library" name="opentelemetry-semconv" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -63,8 +63,6 @@ kotlin {
|
||||
implementation(jps.org.jetbrains.kotlinx.kotlinx.serialization.json.jvm231489733.get().let { "${it.group}:kotlinx-serialization-json:${it.version}" }) {
|
||||
isTransitive = false
|
||||
}
|
||||
implementation(jps.io.opentelemetry.opentelemetry.sdk966255575.get())
|
||||
implementation(jps.io.opentelemetry.semconv.opentelemetry.semconv489456914.get())
|
||||
implementation(project(":fleet.rpc"))
|
||||
implementation(project(":fleet.reporting.api"))
|
||||
implementation(project(":fleet.reporting.shared"))
|
||||
|
||||
Reference in New Issue
Block a user