question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem

Due to Prisma being quite of a black box, I suggest adding a metrics functionality to the client, allowing users to get a snapshot of the current state of the Query Engine.

Suggested solution

We’d have a method prisma.metrics() that’d return an object with information about the underlying engine, for example:

  • Current maximum connections
  • Current connections in use
  • Requests processed so far
  • Number of errors
  • Histogram data of response times

Alternatives

People might say structured logs are an alternative for metrics, but it’s more of an addition. With logs, users can detect and inspect events in the system, with metrics, they can observe the general status of the system. Also stats like histograms are easier to do with metrics than from structured logs. And structured logs are useful for investigating failures.

Logs are also expensive to store and transfer, which means storage over a few days is costing a lot of money. Metrics can be stored for some months with the same money.

Additional context

Prisma should provide an object of the current status. Users can then convert this to a Prometheus endpoint, or additionally send the data to timescale databases such as InfluxDB to be graphed with Grafana.

Metrics are one of the key points of monitoring a running system, and we should provide as much data as possible from Prisma for our users to graph.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:16
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
pimeyscommented, Dec 17, 2022

Yay, thank you for the team for the hard work to make this happen. I’ll try it ASAP.

1reaction
pimeyscommented, Jan 15, 2021

And, not to discard your suggestion, telemetry is extremely important to tackle as well as metrics and structured logs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Metrics Definition - Investopedia
Metrics are measures of quantitative assessment commonly used for assessing, comparing, and tracking performance or production.
Read more >
What are Business Metrics? | Klipfolio
A business metric is a quantifiable measure used to track and assess the status or performance of a specific business function. Metrics are...
Read more >
What are Metrics and Why are they Important ?
Metrics are numbers that tell you important information about a process under question. They tell you accurate measurements about how the process is ......
Read more >
Metric Definition & Meaning - Merriam-Webster
1 of 3. noun. met·​ric ˈme-trik. 1. metrics plural : a part of prosody that deals with metrical (see metrical sense 1) structure....
Read more >
What Are Business Metrics? 35 Metrics Businesses Need to ...
Business metrics help companies track things such as revenue growth, average fixed and variable costs, break-even points, cost of selling goods, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found