Skip to content
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

Add initial spans for opentelemetry #1664

Open
KyleAMathews opened this issue Sep 10, 2024 · 7 comments
Open

Add initial spans for opentelemetry #1664

KyleAMathews opened this issue Sep 10, 2024 · 7 comments
Assignees

Comments

@KyleAMathews
Copy link
Contributor

We have the initial setup of opentelemetry done but let's now add the following basic spans & attributes (not exhaustive, whoever does this feel free to add more that seem right):

  • shape http request
    • attributes:
      • url
      • query parameters
      • and other http info e.g. requester, status code that we return, body size, etc. etc.
  • sql query when creating snapshot
    • attributes:
      • shape_id
      • the full query & parts of it broken up e.g. the table, select clause, where clause, etc.
@KyleAMathews
Copy link
Contributor Author

A few notes from testing just now:

We'll want is_cached, is_live, and offset attributes added to shape handling spans.

For replication log spans, we need spans created for the code that updates the shape & sends it to any subscribers. That way we can see the tree of a replication log coming to Electric & then all subsequent work to update shapes & subscribers.

@KyleAMathews
Copy link
Contributor Author

I also think we should just have one shape for all shape requests — a simpler name would be nice too — e.g. ShapeGet. We could then have ShapeDelete (or shape_get and shape_delete).

@KyleAMathews
Copy link
Contributor Author

We need an attribute to distinguish between requests that go into long polling or just immediately respond. is_live isn't sufficient as if a user is behind the tip of the log they get an immediate response. Perhaps a is_long_polling attribute.

@KyleAMathews
Copy link
Contributor Author

KyleAMathews commented Sep 16, 2024

We need attributes about the shape — table, shape_definition which includes the table & where clause and any other shape definition.

Also the size of the response body (aka the size of the shape)

@KyleAMathews
Copy link
Contributor Author

Common queries will include:

  • number of unique shapes
  • number of unique shapes grouped by table
  • time to fetch shape uncached vs. cached
  • relationship of shape size to response time (cached and uncached)

@thruflo
Copy link
Contributor

thruflo commented Sep 16, 2024

is_immediate_response?

@KyleAMathews
Copy link
Contributor Author

is_immediate_response?

yeah that works too — true for normal responses and false for long polling

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

No branches or pull requests

3 participants