Skip to content

Conversation

@findingrish
Copy link

@findingrish findingrish commented Apr 21, 2021

hypertrace/hypertrace#224

Request/Response:

{
  logEvents(
        limit: 2
        between: {
           startTime:  "2021-04-21T12:07:14.144Z", 
           endTime: "2021-04-21T13:07:14.144Z"
       }
       filterBy: [
          {
              key: "traceId"
              operator: EQUALS
               value: "000000000000000024c91c2019db1636"
               type: ATTRIBUTE
          }
        ]
  ) {
    results {
      traceId: attribute(key: "traceId")
      spanId: attribute(key: "spanId")
      attributes: attribute(key: "attributes")
      time: attribute(key: "timestamp")
      __typename
    }
    total
    __typename
  }
}
{
  "data": {
    "logEvents": {
      "results": [
        {
          "traceId": "000000000000000024c91c2019db1636",
          "spanId": "54d4affeb3dd3ff7",
          "attributes": {
            "event": "Acquired lock with 0 transactions waiting behind"
          },
          "time": "2021-04-21T13:05:08.201820Z",
          "__typename": "LogEvent"
        },
        {
          "traceId": "000000000000000024c91c2019db1636",
          "spanId": "01baa737826f3cc6",
          "attributes": {
            "event": "GetConn"
          },
          "time": "2021-04-21T13:05:08.198296Z",
          "__typename": "LogEvent"
        }
      ],
      "total": 2,
      "__typename": "LogEventResultSet"
    }
  }
}

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@findingrish
Copy link
Author

Build would pass once the gateway pr is merged and its version is updated.

@findingrish findingrish marked this pull request as ready for review April 22, 2021 09:18
@findingrish findingrish requested a review from a team as a code owner April 22, 2021 09:18
new Coercing<>() {
@Override
public Object serialize(Object fetcherResult) throws CoercingSerializeException {
if (fetcherResult instanceof Instant) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to be handle the other direction, too. Both from the transport string to instant, and from instant to the gateway format. I'm ok deferring that if you want to leave a TODO since the only place where this would come up is passing in values to filters, but we generally filter timestamps via the first class time range.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that is why I skipped. I will add a todo at the moment.

Copy link
Author

@findingrish findingrish Apr 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

, and from instant to the gateway format.

What do you mean by this? instant to gateway format conversion isn't done here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LiteralConstantConverter - the conversion from a java primitive/object into the gateway argument format. This spot does the conversion from the serialized format from http into the java primitive/object.

@github-actions

This comment has been minimized.

@codecov
Copy link

codecov bot commented Apr 22, 2021

Codecov Report

Merging #56 (31930d1) into main (f627973) will decrease coverage by 0.34%.
The diff coverage is 25.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main      #56      +/-   ##
============================================
- Coverage     61.83%   61.48%   -0.35%     
- Complexity      230      233       +3     
============================================
  Files            77       77              
  Lines          1158     1171      +13     
  Branches         31       33       +2     
============================================
+ Hits            716      720       +4     
- Misses          417      423       +6     
- Partials         25       28       +3     
Flag Coverage Δ Complexity Δ
unit 61.48% <25.00%> (-0.35%) 233.00 <3.00> (+3.00) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ Complexity Δ
...hql/common/schema/typefunctions/UnknownScalar.java 64.86% <0.00%> (-3.71%) 5.00 <0.00> (ø)
...e/graphql/utils/gateway/AttributeMapConverter.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...core/graphql/utils/gateway/GatewayUtilsModule.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...raphql/utils/gateway/LiteralConstantConverter.java 100.00% <ø> (ø) 11.00 <0.00> (ø)
...graphql/utils/gateway/UnwrappedValueConverter.java 16.66% <40.00%> (+16.66%) 3.00 <3.00> (+3.00)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f627973...31930d1. Read the comment docs.

@github-actions

This comment has been minimized.

Copy link
Contributor

@aaron-steinfeld aaron-steinfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - could you add a couple strategic tests (maybe the timestamp conversion, request and response builders)?

@github-actions

This comment has been minimized.

@findingrish
Copy link
Author

lgtm - could you add a couple strategic tests (maybe the timestamp conversion, request and response builders)?

Added, let me know if this is fine.

@findingrish findingrish merged commit 1e1c09e into main Apr 23, 2021
@findingrish findingrish deleted the gateway-log-event-integration branch April 23, 2021 15:42
@github-actions
Copy link

Unit Test Results

29 files  +1  29 suites  +1   25s ⏱️ -2s
99 tests +1  99 ✔️ +1  0 💤 ±0  0 ❌ ±0 

Results for commit 1e1c09e. ± Comparison against base commit f627973.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants