Title: Hi Hacker News! We’re Vadim and Chris from Highlight.io [1]. We do web app monitoring and are working on using LLMs&#x2F;embeddings to add new functionality to our error monitoring product.<p>Given that there’s a lot of founders&#x2F;engineers using LLMs in their products, we figured we’d share how we built the new functionality, their impact on our workflows, and how you can try it out.<p>Our goal was to build two features: (1) tagging errors (e.g. deeming an error as “authentication error” or a “database error”); and (2) grouping similar errors together (e.g. two errors that have a different stacktrace and body, but are semantically not very different).<p>Each of these rely heavily on comparing text across our application. After some experimentation with the OpenAI embeddings API [3], we went ahead  and hosted a private model instance of thenlper&#x2F;gte-large (an open-source MIT licensed model), which is a 1024-dimension model running on an Intel Ice Lake 2 vCPU machine on Hugging face [4].<p>Our general approach for classifying&#x2F;comparing text is as follows. As each set of tokens (i.e a string) comes in, our backend makes a request to an inference endpoint and receives a 1024-dimension float vector as a response (see the code here [5]). We then store that vector using pgvector [6]. To compare any two sets for similarity, we simply look at the Euclidian distance between their respective embeddings using the ivfflat index implemented by pgvector (example code here [7]).<p>To tag errors, we assign an error its most relevant tag from a predetermined set decided by us. For example, if we tag an error as an &quot;authentication error&quot; or a &quot;database error&quot;, we can allow developers to have a starting point before inspecting an issue.(see the logic here [8]).<p>Anecdotally, this approach seems to work very well. For example, here are two authentication errors that got tagged as “Authentication Error”:<p><pre><code>    * Firebase: A network AuthError has occurred
    * Error retrieving user from firebase api for email verification: cannot find user from uid.
</code></pre>
We also use these error embeddings to group similar errors. To decide whether an error joins a group or starts a new one, we decide on a distance threshold (using the euclidean distance) ahead of time. An interesting thing about this approach, compared to using a text-based heuristic, is that two errors with different stack traces can still be grouped together. Here’s an example:<p><pre><code>    * github.com&#x2F;highlight-run&#x2F;highlight&#x2F;backend&#x2F;worker.(*Worker).ReportStripeUsage
    * github.com&#x2F;highlight-run&#x2F;highlight&#x2F;backend&#x2F;private-graph&#x2F;graph.(*Resolver).GetSlackChannelsFromSlack.func1
</code></pre>
Both reported as `integration api error` as they involve the Stripe and Slack integrations respectively. The neat thing is that the LLM can use the full context of an error and match based on the most relevant details about the error.<p>We have rolled out a first version of the error grouping logic to our cloud product [9], and there’s a demo of all the functionality at [2]. Long-term, if the HN community has other ideas of what we could build with LLM tooling in observability, we’re all ears. Let us know what you think!<p>Links<p>[1] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=36774611">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=36774611</a><p>[2] <a href="https:&#x2F;&#x2F;app.highlight.io&#x2F;error-tags">https:&#x2F;&#x2F;app.highlight.io&#x2F;error-tags</a><p>[3] <a href="https:&#x2F;&#x2F;platform.openai.com&#x2F;docs&#x2F;guides&#x2F;embeddings" rel="nofollow noreferrer">https:&#x2F;&#x2F;platform.openai.com&#x2F;docs&#x2F;guides&#x2F;embeddings</a><p>[4] <a href="https:&#x2F;&#x2F;huggingface.co&#x2F;thenlper&#x2F;gte-large" rel="nofollow noreferrer">https:&#x2F;&#x2F;huggingface.co&#x2F;thenlper&#x2F;gte-large</a><p>[5] <a href="https:&#x2F;&#x2F;github.com&#x2F;highlight&#x2F;highlight&#x2F;blob&#x2F;main&#x2F;backend&#x2F;embeddings&#x2F;embeddings.go#L139-L189">https:&#x2F;&#x2F;github.com&#x2F;highlight&#x2F;highlight&#x2F;blob&#x2F;main&#x2F;backend&#x2F;emb...</a><p>[6] <a href="https:&#x2F;&#x2F;github.com&#x2F;highlight&#x2F;highlight&#x2F;blob&#x2F;main&#x2F;backend&#x2F;model&#x2F;model.go#L957C1-L963">https:&#x2F;&#x2F;github.com&#x2F;highlight&#x2F;highlight&#x2F;blob&#x2F;main&#x2F;backend&#x2F;mod...</a><p>[7] <a href="https:&#x2F;&#x2F;github.com&#x2F;highlight&#x2F;highlight&#x2F;blob&#x2F;main&#x2F;backend&#x2F;public-graph&#x2F;graph&#x2F;resolver.go#L479-L487">https:&#x2F;&#x2F;github.com&#x2F;highlight&#x2F;highlight&#x2F;blob&#x2F;main&#x2F;backend&#x2F;pub...</a><p>[8] <a href="https:&#x2F;&#x2F;github.com&#x2F;highlight&#x2F;highlight&#x2F;blob&#x2F;main&#x2F;backend&#x2F;private-graph&#x2F;graph&#x2F;resolver.go#L3768-L3774">https:&#x2F;&#x2F;github.com&#x2F;highlight&#x2F;highlight&#x2F;blob&#x2F;main&#x2F;backend&#x2F;pri...</a><p>[9] <a href="https:&#x2F;&#x2F;app.highlight.io">https:&#x2F;&#x2F;app.highlight.io</a>
Upvote: