-
Notifications
You must be signed in to change notification settings - Fork 30
refactor: instrument using new telemetry APIs #866
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
Conversation
writer.write("\n\n") | ||
writer.write("public const val ServiceId: String = #S", ctx.settings.sdkId) | ||
writer.write("public const val SdkVersion: String = #S", ctx.settings.pkg.version) | ||
writer.write("\n\n") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Why did these move? Should ServiceApiVersion
move as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember now but there was a reason 🤔 . ServiceApiVersion
is AWS specific, the other two are not.
write("val span = tracer.createSpan(") | ||
.indent() | ||
.write("#S,", "\${ServiceId}.\${operation}") | ||
.withBlock("#T{", "},", RuntimeTypes.Core.Utils.attributesOf) { | ||
write("#S to ServiceId", "rpc.service") | ||
write("#S to operation", "rpc.method") | ||
writer.declareSection(OperationSpanAttributes) | ||
} | ||
} | ||
.write("#T.CLIENT,", RuntimeTypes.Observability.TelemetryApi.SpanKind) | ||
.write("parentCtx") | ||
.dedent() | ||
.write(")") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Could use withBlock
.
} | ||
} | ||
.write("#T.CLIENT,", RuntimeTypes.Observability.TelemetryApi.SpanKind) | ||
.write("parentCtx") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Trailing comma
public interface Builder { | ||
/** | ||
* The [TelemetryProvider] to instrument the component with. | ||
*/ | ||
public var telemetryProvider: TelemetryProvider? | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: We intend to provide a default value of TelemetryProvider.None
right? Why leave the var
nullable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's on the builder, this is how most of our config builders work right? TelemetryConfig.telemetryProvider
is non nullable and will get the default.
.call { renderAdditionalMethods(writer) } | ||
.write("") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this new .write("")
call necessary, it wasn't there before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well technically none of them are necessary since it's formatting, can remove though
SonarCloud Quality Gate failed.
|
Issue #
N/A
Description of changes
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.