File tree 3 files changed +24
-1
lines changed
3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 9
9
- [ ] Create test cases
10
10
- [ ] Update changelog
11
11
<!-- Use these for release PRs:
12
- - [ ] Update package version in `pyprojevt .toml`
12
+ - [ ] Update package version in `pyproject .toml`
13
13
- [ ] Update spec version in `constants.py`
14
14
- [ ] Move changes to a new section in `CHANGELOG.md` -->
Original file line number Diff line number Diff line change 1
1
import time
2
2
from autometrics import autometrics , init
3
+ from opentelemetry .sdk .metrics import Counter
4
+ from opentelemetry .sdk .metrics .export import (
5
+ AggregationTemporality ,
6
+ )
3
7
4
8
# Autometrics supports exporting metrics to OTLP collectors via gRPC and HTTP transports.
5
9
# This example uses the gRPC transport, available settings are similar to the OpenTelemetry
10
14
init (
11
15
exporter = {
12
16
"type" : "otlp-proto-grpc" ,
17
+ "endpoint" : "http://localhost:4317" , # You don't need to set this if you are using the default endpoint
18
+ "insecure" : True , # Enabled for http transport
13
19
"push_interval" : 1000 ,
20
+ # Here are some other available settings:
21
+ # "timeout": 10,
22
+ # "headers": {"x-something": "value"},
23
+ # "aggregation_temporality": {
24
+ # Counter: AggregationTemporality.CUMULATIVE,
25
+ # },
14
26
},
15
27
service_name = "otlp-exporter" ,
16
28
)
Original file line number Diff line number Diff line change 1
1
import time
2
2
from autometrics import autometrics , init
3
+ from opentelemetry .sdk .metrics import Counter
4
+ from opentelemetry .sdk .metrics .export import (
5
+ AggregationTemporality ,
6
+ )
3
7
4
8
# Autometrics supports exporting metrics to OTLP collectors via gRPC and HTTP transports.
5
9
# This example uses the HTTP transport, available settings are similar to the OpenTelemetry
10
14
init (
11
15
exporter = {
12
16
"type" : "otlp-proto-http" ,
17
+ "endpoint" : "http://localhost:4318/" , # You don't need to set this if you are using the default endpoint
13
18
"push_interval" : 1000 ,
19
+ # Here are some other available settings:
20
+ # "timeout": 10,
21
+ # "headers": {"x-something": "value"},
22
+ # "aggregation_temporality": {
23
+ # Counter: AggregationTemporality.CUMULATIVE,
24
+ # },
14
25
},
15
26
service_name = "otlp-exporter" ,
16
27
)
You can’t perform that action at this time.
0 commit comments