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

Requestor API routes #86

Closed
wants to merge 17 commits into from
Closed

Requestor API routes #86

wants to merge 17 commits into from

Conversation

stephlow
Copy link
Member

No description provided.


export type RequestorError = z.infer<typeof RequestorErrorSchema>;
export const RequestWithResponseSchema = z.object({
request: z.any(),
Copy link
Member Author

@stephlow stephlow Jul 24, 2024

Choose a reason for hiding this comment

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

Seems like json-schema-to-zod has some issues with schemas referencing other schemas, sometimes it works... and in this case it doesn't. Looking into this in another PR :)

@stephlow stephlow marked this pull request as ready for review July 24, 2024 12:07
@stephlow stephlow requested a review from a team as a code owner July 24, 2024 12:07
stephlow and others added 7 commits July 24, 2024 15:50
* db schema changes and simplifying /v0/app-routes

* change path param extractor so it :keeps :matching :params

* add openapi parser

* add initial open api adding over clipboard and display

* deps

* formatting

* fix deprecated property

* useless else?

* formatting

* extract out the mutation hook into queries for parsing and handle cyclical object in stringify

* formatting

* fix lint issues

* formatting again

* create new route tab defaults and keybinds

* fix up the logic for default tab view

* send openapi spec if available

* handle openapi spec on the cli

* typescript upd

* Remove unused SVG

* Suppress forward ref error

* Fix custom routes button

* Format

* Let my people delete their openapi routes

---------

Co-authored-by: Brett Beutell <[email protected]>
* Initial tracing support

* Very early work still

* Day 2: waitUntil with tracing

* Switch to single instrument function

* Cleanup

* Add back context

* add updated otlp otlp dependency

* refactor

* wip

* Fix linting issues

* Nested spans now works again

* Remove unused dependencies

* Add extra request information

* With measure

* Wait till waitUntil tasks complete

Before calling provider.forceFlush()

* Remove some console.logs

* Use proper export

* Patch all loglevels

* Patch fetch

* Remove unused code

* Cleanup and minor code shuffle

* Remove combined context file

And use the files directly from the `@opentelemetry/context-async-hooks`
repo

* Tiny changes to the example

* Tiny cleanup

However i noticed that the async-hooks code doens't lint correctly

* Fix import

* Fix linting issue

* Format code

* Make monitoring logs/fetch optional

* Do configurations more in styl of the other lib

* Add attributes to main route span

* Bump nr of loop cycles

* Avoid double patching

* Introduce an isWrapped function

* Remove commented out code

* Further cleanup

* Make measure more flexible

* measure: allow for specifying spanKind

As well as attributes for a span

* Add .fpxconfig to gitingore

* measure: extract out the handling of promise

* Add support for onEnd, onStart and onError

* measure: fixed support for onStart, onEnd, onError

* Await flusing the provider

* Fix linting issue

* Pleasea the typescript linting

* rename package/directory

* Update markdown files

* Update workspaces in package.json

* Update package-lock.json

* Fix proxy for hono app

(when accessing other properties of the app

* Rename arguments

* Remove traces routes

* Remove console.log

* Use swc to build in dist folder

* Add individual attributes for header fields

* Fix formatting

* Feedback on PR

* Fix formatting

* Rename hotel to `sample`

* npmignore sample related files

So they don't get published to npm

* Upgrade some dependencies

* Remove debug log statement
* Switch from http to grpc

When trying to send traces to otelcol using http it kept returning 400 bad requests

* Add script to start a simple otel collector

* Commit transactions through the store

This allows us to do the error mapping in 1 place (even though it currently only maps to InternalError). This will also make it easier to switch to a generic TX implementation, if we're ever going to support multiple backends

* Work in progress implementation for the gRPC service

* Generate OTEL files during build

* Generate otel files up front and add tooling to generate it again

* Cleanup generated comments

* Intermediate

* Intermediate2

* Intermediate

* more:

* Replace generated code with public crate

* Working

* Support SpanKind

* Add support for start and end time

* Fix tests

* Add support for attributes

* Fix tests

* Add state

* Implement all trace fields

* Allow fetching of all spans for a single trace

* Resolve clippies

* Include serde for the otel types

* Refactor IntoResponse to ApiError

* Remove .gitmodules file

* Add schemars to OTEL models

* Naive implementation of http/json collector endpoint

Note this implementation comes with some major concurrency flaws

* Add decode as json or proto to otel http collector

* Naive lock to prevent any concurrency issues

* Move models module to api module

Resolve clippies

* Rejiggle some imports

* Rewrite conversion to more idiomatic Rust

Change storage of spans to include the API model

* Add instrumentation to Grpc's export fn

* Move grpc into the root module

Add service to only define the ingest logic once

* Update to opentelemetry

Cleanup dependencies (ie. remove unused features/crates)

* Implement readwrite/readonly transaction

This implementation still depends on a global lock, so it doesn't allow for concurrent reads. Trying to implement this lead to other issues. This is something that we should solve later.

* Remove TransactionBehavior::ReadOnly

Using this in start_readwrite_transaction was a accidental commit from a test to see if it works.

Remove both usages since it doesn't work for local sqlite connection and only seems to work for hosted libsql instances

If we have dedicated readonly connections, then we should be able to set the 'query_only' pragma to true, but since we only have 1 connection this won't work

* Sort features

This is a result of a reverted experiment, but I still wanted to include this change

* Add comments

* Add documentation and get rid of unwrap/expect

* Create a new span for each websocket connection

This allows us to add information to this as well, such as the ws_id. This also fixes the span propagation to the write loop

Update more docs

* Move some structs around, add some docs

* Fix tests and prevent compiler warnings

* Fix index

* Add documentation to data/util

* Simplify gRPC handler

* Run cargo update

* Use correct content type for the response (json already does this)

Update comment, related to spec

* Rewrite RUST_LOG parsing

* Allow grpc listen address to be changed

* Set NOT NULL rather than NULL
@stephlow stephlow marked this pull request as draft July 25, 2024 13:20
@stephlow stephlow closed this Jul 25, 2024
@stephlow stephlow mentioned this pull request Jul 25, 2024
@stephlow
Copy link
Member Author

This has been moved to #94 as somehow the git history got messed up and the PR diff is completely borked

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.

5 participants