-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
あで
committed
Sep 27, 2023
1 parent
fc9ec96
commit 962dab6
Showing
15 changed files
with
1,525 additions
and
298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import time | ||
from autometrics import autometrics, init | ||
|
||
# Autometrics supports exporting metrics to Prometheus via the OpenTelemetry. | ||
# This example uses the Prometheus Python client, available settings are same as the | ||
# Prometheus Python client. By default, the Prometheus exporter will expose metrics | ||
# on port 9464. If you don't have a Prometheus server running, you can run Tilt or | ||
# Docker Compose from the root of this repo to start one up. | ||
|
||
init( | ||
tracker="opentelemetry", | ||
exporter={ | ||
"type": "otel-prometheus", | ||
"" | ||
}, | ||
service_name="my-service", | ||
) | ||
|
||
|
||
@autometrics | ||
def my_function(): | ||
pass | ||
|
||
|
||
while True: | ||
my_function() | ||
time.sleep(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import time | ||
from autometrics import autometrics, init | ||
|
||
# Autometrics supports exporting metrics to OTLP collectors via gRPC and HTTP transports. | ||
# This example uses the gRPC transport, available settings are similar to the OpenTelemetry | ||
# Python SDK. By default, the OTLP exporter will send metrics to localhost:4317. | ||
# If you don't have an OTLP collector running, you can run Tilt or Docker Compose | ||
# to start one up. See the README for more details. | ||
|
||
init( | ||
exporter={ | ||
"type": "otlp-proto-grpc", | ||
"push_interval": 1000, | ||
}, | ||
service_name="my-service", | ||
) | ||
|
||
|
||
@autometrics | ||
def my_function(): | ||
pass | ||
|
||
|
||
while True: | ||
my_function() | ||
time.sleep(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import time | ||
from autometrics import autometrics, init | ||
|
||
# Autometrics supports exporting metrics to Prometheus via the Prometheus Python client. | ||
# This example uses the Prometheus Python client, available settings are same as the | ||
# Prometheus Python client. By default, the Prometheus exporter will expose metrics | ||
# on port 9464. If you don't have a Prometheus server running, you can run Tilt or | ||
# Docker Compose from the root of this repo to start one up. | ||
|
||
init( | ||
tracker="prometheus", | ||
exporter={ | ||
"type": "prometheus-client", | ||
"port": 9464, | ||
}, | ||
service_name="my-service", | ||
) | ||
|
||
|
||
@autometrics | ||
def my_function(): | ||
pass | ||
|
||
|
||
while True: | ||
my_function() | ||
time.sleep(1) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.