Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
93abf6b
Add blurb to readme about identifying commits
brettimus May 10, 2023
49f6d90
Remove "coming soon" from readme item on adding links to live Prom ch…
brettimus May 10, 2023
41d7649
Add WIP section to the readme on using build info (version/commit)
brettimus May 10, 2023
cd38170
Add constants
brettimus May 10, 2023
3d5cc9c
Initialize Prometheus Gauge for build_info
brettimus May 10, 2023
3cee169
Add updown counter for build info to otel tracker
brettimus May 10, 2023
936ed06
Implement set_build_info for OTEL and Prom, and call when we set the …
brettimus May 10, 2023
44ac3c5
Update README
brettimus May 10, 2023
2d21708
Move set_build_info call into create_tracker
May 10, 2023
0d7db6e
Update prometheus queries
May 10, 2023
02ad205
Update prometheus URL tests
May 10, 2023
9a3b55a
Add test for build_info gauge for prometheus tracker (skipped test fo…
May 10, 2023
cd74486
Checkpoint (saving work for later reference)
May 10, 2023
f20e973
Update otel tracker and tracker tests after finding otel prometheus bug
May 10, 2023
c362620
Update env vars we mention in README (still needs more thought)
May 10, 2023
034406a
Ensure set_build_info is only called once
May 10, 2023
b1eef93
Fix "call once" logic of set_build_info
brettimus May 10, 2023
a071249
Remove commented out test
brettimus May 10, 2023
5bcc0ba
Update changelog
brettimus May 10, 2023
894c224
Remove unnecessary commented-out print statements
brettimus May 10, 2023
b58510f
Add set_build_info to the TrackMetrics Protocol
brettimus May 10, 2023
7163175
Fix build_info query based off of autometrics-dev/autometrics-shared#8
brettimus May 10, 2023
c44a621
Rename create_tracker to init_tracker
May 11, 2023
c916061
Use types instead of ifs
May 11, 2023
b754103
Update pyright
May 11, 2023
4cb6cd4
Update README to mention OpenTelemetry tracker does not work with bui…
May 11, 2023
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add WIP section to the readme on using build info (version/commit)
  • Loading branch information
brettimus committed May 10, 2023
commit 41d764922ca54a8582342f0bfc29827268f3a01e
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ See [Why Autometrics?](https://github.com/autometrics-dev#why-autometrics) for m
most useful metrics
- 💡 Writes Prometheus queries so you can understand the data generated without
knowing PromQL
- 🔗 Create links to live Prometheus charts directly into each functions docstrings
- 🔗 Create links to live Prometheus charts directly into each function's docstring
- [🔍 Identify commits](#identifying-commits-that-introduced-problems) that introduced errors or increased latency
- [🚨 Define alerts](#alerts--slos) using SLO best practices directly in your source code
- [📊 Grafana dashboards](#dashboards) work out of the box to visualize the performance of instrumented functions & SLOs
Expand Down Expand Up @@ -115,6 +115,22 @@ Configure the crate that autometrics will use to produce metrics by using one of
- `opentelemetry` - (enabled by default, can also be explicitly set using the AUTOMETRICS_TRACKER="OPEN_TELEMETERY" env var) uses
- `prometheus` -(using the AUTOMETRICS_TRACKER env var set to "PROMETHEUS")

## Identifying commits that introduced problems

Autometrics makes it easy to identify if a specific version or commit introduced errors or increased latencies.

It uses a separate metric (`build_info`) to track the version and, optionally, git commit of your service. It then writes queries that group metrics by the `version` and `commit` labels so you can spot correlations between those and potential issues.

The `version` is collected from the `...TODO...` environment variable. You can override this by setting the runtime environment variable `AUTOMETRICS_VERSION`.

This follows the method outlined in [Exposing the software version to Prometheus](https://www.robustperception.io/exposing-the-software-version-to-prometheus/).

To set the `commit`, you can either set the run-time environment variable `AUTOMETRICS_COMMIT`, or have it set automatically using `...TODO...`

```py
# TODO
```

## Development of the package

This package uses [poetry](https://python-poetry.org) as a package manager, with all dependencies separated into three groups:
Expand Down