-
Notifications
You must be signed in to change notification settings - Fork 274
Add OpenTelemetry base classes #4982
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
Changes from 7 commits
9a3743d
1ae437e
0769a77
5d087e3
b1ef95f
0a4e9ca
c34c51c
ddf6db9
7d90796
f5e4c31
f3d4c32
eeb5b78
201590c
68ac68f
37d92e3
8389744
332ecb2
1f4cb7d
551b153
c457e1f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,171 @@ | ||
| // Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| @file:Suppress("UnusedPrivateClass") | ||
|
|
||
| package software.aws.toolkits.jetbrains.services.telemetry.otel | ||
|
|
||
| import com.intellij.openapi.Disposable | ||
| import com.intellij.openapi.components.Service | ||
| import com.intellij.openapi.components.service | ||
| import com.intellij.openapi.diagnostic.thisLogger | ||
| import com.intellij.openapi.util.SystemInfoRt | ||
| import com.intellij.platform.util.http.ContentType | ||
| import com.intellij.platform.util.http.httpPost | ||
| import com.intellij.serviceContainer.NonInjectable | ||
| import io.opentelemetry.api.common.AttributeKey | ||
| import io.opentelemetry.api.common.Attributes | ||
| import io.opentelemetry.api.trace.propagation.W3CTraceContextPropagator | ||
| import io.opentelemetry.context.Context | ||
| import io.opentelemetry.context.propagation.ContextPropagators | ||
| import io.opentelemetry.exporter.internal.otlp.traces.TraceRequestMarshaler | ||
| import io.opentelemetry.sdk.OpenTelemetrySdk | ||
| import io.opentelemetry.sdk.resources.Resource | ||
| import io.opentelemetry.sdk.trace.ReadWriteSpan | ||
| import io.opentelemetry.sdk.trace.ReadableSpan | ||
| import io.opentelemetry.sdk.trace.SdkTracerProvider | ||
| import io.opentelemetry.sdk.trace.SpanProcessor | ||
| import kotlinx.coroutines.CancellationException | ||
| import kotlinx.coroutines.CoroutineScope | ||
| import kotlinx.coroutines.launch | ||
| import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider | ||
| import software.amazon.awssdk.http.ContentStreamProvider | ||
| import software.amazon.awssdk.http.HttpExecuteRequest | ||
| import software.amazon.awssdk.http.SdkHttpMethod | ||
| import software.amazon.awssdk.http.SdkHttpRequest | ||
| import software.amazon.awssdk.http.apache.ApacheHttpClient | ||
| import software.amazon.awssdk.http.auth.aws.signer.AwsV4HttpSigner | ||
| import java.io.ByteArrayOutputStream | ||
| import java.net.ConnectException | ||
|
|
||
| private class BasicOtlpSpanProcessor( | ||
| private val coroutineScope: CoroutineScope, | ||
| private val traceUrl: String = "http://127.0.0.1:4318/v1/traces", | ||
| ) : SpanProcessor { | ||
| override fun onStart(parentContext: Context, span: ReadWriteSpan) {} | ||
| override fun isStartRequired() = false | ||
| override fun isEndRequired() = true | ||
|
Check warning on line 46 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OTelService.kt
|
||
|
|
||
| override fun onEnd(span: ReadableSpan) { | ||
| val data = span.toSpanData() | ||
| coroutineScope.launch { | ||
| try { | ||
| val item = TraceRequestMarshaler.create(listOf(data)) | ||
|
Check warning on line 52 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OTelService.kt
|
||
|
|
||
| httpPost(traceUrl, contentLength = item.binarySerializedSize.toLong(), contentType = ContentType.XProtobuf) { | ||
|
Check warning on line 54 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OTelService.kt
|
||
Check warningCode scanning / QDJVMC Unstable API Usage Warning
'httpPost(java.lang.String, long, com.intellij.platform.util.http.ContentType, kotlin.jvm.functions.Function2,? extends java.lang.Object>, kotlin.coroutines.Continuation)' is marked unstable with @ApiStatus.Internal
|
||
| item.writeBinaryTo(this) | ||
| } | ||
| } catch (e: CancellationException) { | ||
| throw e | ||
| } catch (e: ConnectException) { | ||
| thisLogger().warn("Cannot export (url=$traceUrl): ${e.message}") | ||
Check noticeCode scanning / QDJVMC Non-distinguishable logging calls Note
Similar log messages
|
||
| } catch (e: Throwable) { | ||
| thisLogger().error("Cannot export (url=$traceUrl)", e) | ||
|
Check warning on line 62 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OTelService.kt
|
||
| } | ||
| } | ||
| } | ||
|
Check warning on line 65 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OTelService.kt
|
||
| } | ||
|
|
||
| private class SigV4OtlpSpanProcessor( | ||
Check warningCode scanning / QDJVMC Unused symbol Warning
Class "SigV4OtlpSpanProcessor" is never used
|
||
| private val coroutineScope: CoroutineScope, | ||
| private val traceUrl: String, | ||
| private val creds: AwsCredentialsProvider, | ||
|
Check warning on line 71 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OTelService.kt
|
||
| ) : SpanProcessor { | ||
| override fun onStart(parentContext: Context, span: ReadWriteSpan) {} | ||
| override fun isStartRequired() = false | ||
| override fun isEndRequired() = true | ||
|
Check warning on line 75 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OTelService.kt
|
||
|
|
||
| private val client = ApacheHttpClient.create() | ||
|
Check warning on line 77 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OTelService.kt
|
||
|
|
||
| override fun onEnd(span: ReadableSpan) { | ||
| coroutineScope.launch { | ||
| val data = span.toSpanData() | ||
| try { | ||
| val item = TraceRequestMarshaler.create(listOf(data)) | ||
|
Check warning on line 83 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OTelService.kt
|
||
| // calculate the sigv4 header | ||
| val signer = AwsV4HttpSigner.create() | ||
| val httpRequest = | ||
| SdkHttpRequest.builder() | ||
| .uri(traceUrl) | ||
| .method(SdkHttpMethod.POST) | ||
| .putHeader("Content-Type", "application/x-protobuf") | ||
| .build() | ||
|
Check warning on line 91 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OTelService.kt
|
||
|
|
||
| val baos = ByteArrayOutputStream() | ||
| item.writeBinaryTo(baos) | ||
| val payload = ContentStreamProvider.fromByteArray(baos.toByteArray()) | ||
| val signedRequest = signer.sign { | ||
| it.identity(creds.resolveIdentity().get()) | ||
| it.request(httpRequest) | ||
| it.payload(payload) | ||
| it.putProperty(AwsV4HttpSigner.SERVICE_SIGNING_NAME, "osis") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this property name stand for
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. open search ingestion service |
||
| it.putProperty(AwsV4HttpSigner.REGION_NAME, "us-west-2") | ||
| } | ||
|
Check warning on line 102 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OTelService.kt
|
||
|
|
||
| // Create and HTTP client and send the request. ApacheHttpClient requires the 'apache-client' module. | ||
| client.prepareRequest( | ||
| HttpExecuteRequest.builder() | ||
| .request(signedRequest.request()) | ||
| .contentStreamProvider(signedRequest.payload().orElse(null)) | ||
| .build() | ||
| ).call() | ||
| } catch (e: CancellationException) { | ||
| throw e | ||
| } catch (e: ConnectException) { | ||
| thisLogger().warn("Cannot export (url=$traceUrl): ${e.message}") | ||
Check noticeCode scanning / QDJVMC Non-distinguishable logging calls Note
Similar log messages
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: should this also be log.error? |
||
| } catch (e: Throwable) { | ||
| thisLogger().error("Cannot export (url=$traceUrl)", e) | ||
|
Check warning on line 116 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OTelService.kt
|
||
| } | ||
| } | ||
| } | ||
|
Check warning on line 119 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OTelService.kt
|
||
| } | ||
|
|
||
| private object StdoutSpanProcessor : SpanProcessor { | ||
| override fun onStart(parentContext: Context, span: ReadWriteSpan) {} | ||
| override fun isStartRequired() = false | ||
| override fun isEndRequired() = true | ||
|
Check warning on line 125 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OTelService.kt
|
||
|
|
||
| override fun onEnd(span: ReadableSpan) { | ||
| println(span.toSpanData()) | ||
| } | ||
|
Check warning on line 129 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OTelService.kt
|
||
| } | ||
|
|
||
| @Service | ||
| class OTelService @NonInjectable internal constructor(spanProcessors: List<SpanProcessor>) : Disposable { | ||
| @Suppress("unused") | ||
| constructor() : this(listOf(StdoutSpanProcessor)) | ||
|
Check warning on line 135 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OTelService.kt
|
||
|
|
||
| private val sdkDelegate = lazy { | ||
| OpenTelemetrySdk.builder() | ||
| .setTracerProvider( | ||
| SdkTracerProvider.builder() | ||
| .apply { | ||
| spanProcessors.forEach { | ||
| addSpanProcessor(it) | ||
| } | ||
| } | ||
| .setResource( | ||
| Resource.create( | ||
| Attributes.builder() | ||
| .put(AttributeKey.stringKey("os.type"), SystemInfoRt.OS_NAME) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where would we use this recorded information other than telemetry?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these are common fields understood by OTLP processors |
||
| .put(AttributeKey.stringKey("os.version"), SystemInfoRt.OS_VERSION) | ||
| .put(AttributeKey.stringKey("host.arch"), System.getProperty("os.arch")) | ||
| .build() | ||
| ) | ||
| ) | ||
| .build() | ||
| ) | ||
| .setPropagators(ContextPropagators.create(W3CTraceContextPropagator.getInstance())) | ||
| .build() | ||
| } | ||
| internal val sdk: OpenTelemetrySdk by sdkDelegate | ||
|
|
||
| override fun dispose() { | ||
| if (sdkDelegate.isInitialized()) { | ||
| sdk.close() | ||
|
Check warning on line 164 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OTelService.kt
|
||
| } | ||
| } | ||
|
Check warning on line 166 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OTelService.kt
|
||
|
|
||
| companion object { | ||
| fun getSdk() = service<OTelService>().sdk | ||
|
Check warning on line 169 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OTelService.kt
|
||
Check warningCode scanning / QDJVMC Unused symbol Warning
Function "getSdk" is never used
|
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,191 @@ | ||
| // Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| package software.aws.toolkits.jetbrains.services.telemetry.otel | ||
|
|
||
| import io.opentelemetry.api.common.AttributeKey | ||
| import io.opentelemetry.api.common.Attributes | ||
| import io.opentelemetry.api.trace.Span | ||
| import io.opentelemetry.api.trace.SpanBuilder | ||
| import io.opentelemetry.api.trace.SpanContext | ||
| import io.opentelemetry.api.trace.SpanKind | ||
| import io.opentelemetry.context.Context | ||
| import io.opentelemetry.context.ContextKey | ||
| import io.opentelemetry.context.Scope | ||
| import kotlinx.coroutines.CoroutineScope | ||
| import software.amazon.awssdk.services.toolkittelemetry.model.AWSProduct | ||
| import software.aws.toolkits.core.utils.getLogger | ||
| import software.aws.toolkits.core.utils.warn | ||
| import software.aws.toolkits.jetbrains.services.telemetry.PluginResolver | ||
| import java.time.Instant | ||
| import java.util.concurrent.TimeUnit | ||
| import kotlin.coroutines.CoroutineContext | ||
| import kotlin.coroutines.EmptyCoroutineContext | ||
| import com.intellij.platform.diagnostic.telemetry.helpers.use as ijUse | ||
| import com.intellij.platform.diagnostic.telemetry.helpers.useWithScope as ijUseWithScope | ||
|
|
||
| val AWS_PRODUCT_CONTEXT_KEY = ContextKey.named<AWSProduct>("pluginDescriptor") | ||
|
Check notice on line 27 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OtelBase.kt
|
||
|
||
| internal val PLUGIN_ATTRIBUTE_KEY = AttributeKey.stringKey("plugin") | ||
|
|
||
| class DefaultSpanBuilder(delegate: SpanBuilder) : AbstractSpanBuilder<DefaultSpanBuilder, AbstractBaseSpan>(delegate) { | ||
|
||
| override fun doStartSpan() = BaseSpan(parent, delegate.startSpan()) | ||
| } | ||
|
|
||
| abstract class AbstractSpanBuilder<Builder : AbstractSpanBuilder<Builder, Span>, Span : AbstractBaseSpan>(protected val delegate: SpanBuilder) : SpanBuilder { | ||
| /** | ||
| * Same as [com.intellij.platform.diagnostic.telemetry.helpers.use] except downcasts to specific subclass of [BaseSpan] | ||
|
||
| * | ||
| * @inheritdoc | ||
| */ | ||
| inline fun<T> use(operation: (Span) -> T): T = | ||
| startSpan().ijUse { span -> | ||
| operation(span as Span) | ||
| } | ||
|
Check warning on line 43 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OtelBase.kt
|
||
|
|
||
| /** | ||
| * Same as [com.intellij.platform.diagnostic.telemetry.helpers.useWithScope] except downcasts to specific subclass of [BaseSpan] | ||
|
||
| * | ||
| * @inheritdoc | ||
| */ | ||
| suspend inline fun<T> useWithScope( | ||
|
||
| context: CoroutineContext = EmptyCoroutineContext, | ||
|
Check warning on line 51 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OtelBase.kt
|
||
| crossinline operation: suspend CoroutineScope.(Span) -> T, | ||
| ): T = | ||
| ijUseWithScope(context) { span -> | ||
|
Check warning on line 54 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OtelBase.kt
|
||
| operation(span as Span) | ||
| } | ||
|
Check warning on line 56 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OtelBase.kt
|
||
|
|
||
| protected var parent: Context? = null | ||
| override fun setParent(context: Context): Builder { | ||
| parent = context | ||
| delegate.setParent(context) | ||
| return this as Builder | ||
| } | ||
|
|
||
| override fun setNoParent(): Builder { | ||
| parent = null | ||
| delegate.setNoParent() | ||
| return this as Builder | ||
|
Check warning on line 68 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OtelBase.kt
|
||
| } | ||
|
|
||
| override fun addLink(spanContext: SpanContext): Builder { | ||
| delegate.addLink(spanContext) | ||
| return this as Builder | ||
|
Check warning on line 73 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OtelBase.kt
|
||
| } | ||
|
|
||
| override fun addLink( | ||
| spanContext: SpanContext, | ||
| attributes: Attributes, | ||
| ): Builder { | ||
| delegate.addLink(spanContext, attributes) | ||
| return this as Builder | ||
|
Check warning on line 81 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OtelBase.kt
|
||
| } | ||
|
|
||
| override fun setAttribute(key: String, value: String): Builder { | ||
| delegate.setAttribute(key, value) | ||
| return this as Builder | ||
|
Check warning on line 86 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OtelBase.kt
|
||
| } | ||
|
|
||
| override fun setAttribute(key: String, value: Long): Builder { | ||
| delegate.setAttribute(key, value) | ||
| return this as Builder | ||
|
Check warning on line 91 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OtelBase.kt
|
||
| } | ||
|
|
||
| override fun setAttribute(key: String, value: Double): Builder { | ||
| delegate.setAttribute(key, value) | ||
| return this as Builder | ||
|
Check warning on line 96 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OtelBase.kt
|
||
| } | ||
|
|
||
| override fun setAttribute(key: String, value: Boolean): Builder { | ||
| delegate.setAttribute(key, value) | ||
| return this as Builder | ||
|
Check warning on line 101 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OtelBase.kt
|
||
| } | ||
|
|
||
| override fun <V : Any?> setAttribute( | ||
| key: AttributeKey<V?>, | ||
| value: V & Any, | ||
| ): Builder { | ||
| delegate.setAttribute(key, value) | ||
| return this as Builder | ||
| } | ||
|
|
||
| override fun setAllAttributes(attributes: Attributes): Builder { | ||
| delegate.setAllAttributes(attributes) | ||
| return this as Builder | ||
|
Check warning on line 114 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OtelBase.kt
|
||
| } | ||
|
|
||
| override fun setSpanKind(spanKind: SpanKind): Builder { | ||
| delegate.setSpanKind(spanKind) | ||
| return this as Builder | ||
|
Check warning on line 119 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OtelBase.kt
|
||
| } | ||
|
|
||
| override fun setStartTimestamp(startTimestamp: Long, unit: TimeUnit): Builder { | ||
| delegate.setStartTimestamp(startTimestamp, unit) | ||
| return this as Builder | ||
|
Check warning on line 124 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OtelBase.kt
|
||
| } | ||
|
|
||
| override fun setStartTimestamp(startTimestamp: Instant): Builder { | ||
| delegate.setStartTimestamp(startTimestamp) | ||
| return this as Builder | ||
|
Check warning on line 129 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OtelBase.kt
|
||
| } | ||
|
|
||
| protected abstract fun doStartSpan(): Span | ||
|
|
||
| override fun startSpan(): Span { | ||
| var parent = parent | ||
| if (parent == null) { | ||
| parent = Context.current() | ||
| } | ||
| requireNotNull(parent) | ||
|
|
||
| val contextValue = parent.get(AWS_PRODUCT_CONTEXT_KEY) | ||
| if (contextValue == null) { | ||
| // FIX_WHEN_MIN_IS_243: Kotlin compiler can't figure out difference between class/type parameter until 2.x | ||
| val s = io.opentelemetry.api.trace.Span.fromContextOrNull(parent) | ||
| parent = if (s is AbstractBaseSpan && s.context != null) { | ||
| s.context.with(io.opentelemetry.api.trace.Span.fromContext(parent)) | ||
| } else { | ||
| parent.with(AWS_PRODUCT_CONTEXT_KEY, resolvePluginName()) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should resolvePluginName be under a try catch?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. returns null if fails |
||
| } | ||
| setParent(parent) | ||
| } | ||
| requireNotNull(parent) | ||
Check noticeCode scanning / QDJVMC Redundant 'requireNotNull' or 'checkNotNull' call Note
Redundant 'requireNotNull' call
|
||
|
|
||
| parent.get(AWS_PRODUCT_CONTEXT_KEY)?.toString()?.let { | ||
| setAttribute(PLUGIN_ATTRIBUTE_KEY, it) | ||
| } ?: run { | ||
| LOG.warn { "Reached setAttribute with null AWS_PRODUCT_CONTEXT_KEY, but should not be possible" } | ||
| } | ||
|
Check warning on line 158 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OtelBase.kt
|
||
|
|
||
| return doStartSpan() | ||
| } | ||
|
|
||
| private companion object { | ||
| val LOG = getLogger<AbstractSpanBuilder<*, *>>() | ||
| fun resolvePluginName() = PluginResolver.Companion.fromStackTrace(Thread.currentThread().stackTrace).product | ||
|
||
| } | ||
| } | ||
|
|
||
| abstract class AbstractBaseSpan(internal val context: Context?, private val delegate: Span) : Span by delegate { | ||
| /** | ||
| * Same as [com.intellij.platform.diagnostic.telemetry.helpers.use] except downcasts to specific subclass of [BaseSpan] | ||
|
||
| * | ||
| * @inheritdoc | ||
| */ | ||
| inline fun<T> use(operation: (Span) -> T): T = | ||
| ijUse { span -> | ||
| operation(span as Span) | ||
|
||
| } | ||
|
Check warning on line 178 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OtelBase.kt
|
||
|
|
||
| fun metadata(key: String, value: String) = setAttribute(key, value) | ||
|
Check notice on line 180 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OtelBase.kt
|
||
|
||
|
|
||
| override fun makeCurrent(): Scope = | ||
| context?.with(this)?.makeCurrent() ?: super.makeCurrent() | ||
| } | ||
|
|
||
| /** | ||
| * Placeholder; will be generated | ||
| */ | ||
| class BaseSpan(context: Context?, delegate: Span) : AbstractBaseSpan(context, delegate) { | ||
| fun reason(reason: String) = metadata("reason", reason) | ||
|
Check notice on line 190 in plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/telemetry/otel/OtelBase.kt
|
||
|
||
| } | ||
Check warning
Code scanning / QDJVMC
Unused symbol Warning