-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: add telemetry on resolve latency #158
base: main
Are you sure you want to change the base?
Conversation
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
|
||
final class ConfidenceIntegrationTest { |
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.
We were missing good integration tests for resolving using the Confidence SDK standalone. This class was copied from the Provider tests and just massaged to fit the SDK APIs.
@@ -30,7 +30,8 @@ private static ConfidenceValue from(com.google.protobuf.Value value, FlagSchema | |||
if (intVal != value.getNumberValue()) { | |||
throw new ParseError( | |||
String.format( | |||
"%s %s should be an int, but it is a double/long", mismatchPrefix, value)); | |||
"%s %s should be an int, but it is a double/long", | |||
mismatchPrefix, value.getNumberValue())); |
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.
Using value.getNumberValue()
here since value
actually contained a line break which annoyed me when writing tests :)
|
||
public class TelemetryClientInterceptor implements ClientInterceptor { | ||
public static final Metadata.Key<String> HEADER_KEY = | ||
Metadata.Key.of("X-CONFIDENCE-TELEMETRY", Metadata.ASCII_STRING_MARSHALLER); |
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.
Add the header in binary instead and the header with -bin
suffix.
The idea with this PR is to add a header with information about how long each resolve took.
It's defining a proto message and encodes the telemetry data in this message as a Base64 string putting it to the
X-CONFIDENCE-TELEMETRY
.