Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

Commit e32462c

Browse files
authored
Release/v0.11.2 (#1195)
1 parent 1ff11ef commit e32462c

File tree

34 files changed

+613
-85
lines changed

34 files changed

+613
-85
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ on:
1010

1111
jobs:
1212
build:
13-
# 18.04 needed for python3.4
14-
runs-on: ubuntu-18.04
13+
runs-on: ubuntu-20.04
1514
env:
1615
# We use these variables to convert between tox and GHA version literals
1716
py27: 2.7

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## Unreleased
44

5+
# 0.11.2
6+
Released 2023-03-10
7+
8+
- Updated `azure`, `fastapi`,`flask` modules
9+
510
# 0.11.1
611
Released 2023-01-18
712

README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ Trace Exporter
241241
.. _Datadog: https://github.com/census-instrumentation/opencensus-python/tree/master/contrib/opencensus-ext-datadog
242242
.. _Django: https://github.com/census-instrumentation/opencensus-python/tree/master/contrib/opencensus-ext-django
243243
.. _Flask: https://github.com/census-instrumentation/opencensus-python/tree/master/contrib/opencensus-ext-flask
244+
.. _FastAPI: https://github.com/census-instrumentation/opencensus-python/tree/master/contrib/opencensus-ext-fastapi
244245
.. _gevent: https://github.com/census-instrumentation/opencensus-python/tree/master/contrib/opencensus-ext-gevent
245246
.. _Google Cloud Client Libraries: https://github.com/census-instrumentation/opencensus-python/tree/master/contrib/opencensus-ext-google-cloud-clientlibs
246247
.. _gRPC: https://github.com/census-instrumentation/opencensus-python/tree/master/contrib/opencensus-ext-grpc

contrib/opencensus-ext-azure/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
## Unreleased
44

5+
## 1.1.9
6+
7+
Released 2023-03-10
8+
9+
- Fix export of exception information in traces
10+
([#1187](https://github.com/census-instrumentation/opencensus-python/pull/1187))
11+
- Modify metrics exporter to include setting export interval to 60s
12+
([#1193](https://github.com/census-instrumentation/opencensus-python/pull/1193))
13+
514
## 1.1.8
615

716
Released 2023-01-18

contrib/opencensus-ext-azure/README.rst

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,11 @@ The **Azure Monitor Metrics Exporter** allows you to export metrics to `Azure Mo
166166
167167
def main():
168168
# Enable metrics
169-
# Set the interval in seconds in which you want to send metrics
170-
exporter = metrics_exporter.new_metrics_exporter(connection_string='InstrumentationKey=<your-instrumentation-key-here>')
169+
# Set the interval in seconds to 60s, which is the time interval application insights
170+
# aggregates your metrics
171+
exporter = metrics_exporter.new_metrics_exporter(
172+
connection_string='InstrumentationKey=<your-instrumentation-key-here>'
173+
)
171174
view_manager.register_exporter(exporter)
172175
173176
view_manager.register_view(CARROTS_VIEW)
@@ -176,7 +179,6 @@ The **Azure Monitor Metrics Exporter** allows you to export metrics to `Azure Mo
176179
177180
mmap.measure_int_put(CARROTS_MEASURE, 1000)
178181
mmap.record(tmap)
179-
# Default export interval is every 15.0s
180182
181183
print("Done recording metrics")
182184
@@ -196,10 +198,13 @@ The exporter also includes a set of performance counters that are exported to Az
196198
from opencensus.ext.azure import metrics_exporter
197199
198200
def main():
199-
# All you need is the next line. You can disable performance counters by
201+
# Performance counters are sent by default. You can disable performance counters by
200202
# passing in enable_standard_metrics=False into the constructor of
201203
# new_metrics_exporter()
202-
_exporter = metrics_exporter.new_metrics_exporter(connection_string='InstrumentationKey=<your-instrumentation-key-here>')
204+
_exporter = metrics_exporter.new_metrics_exporter(
205+
connection_string='InstrumentationKey=<your-instrumentation-key-here>',
206+
export_interval=60,
207+
)
203208
204209
for i in range(100):
205210
print(psutil.virtual_memory())
@@ -256,8 +261,12 @@ Modifying Metrics
256261
257262
def main():
258263
# Enable metrics
259-
# Set the interval in seconds in which you want to send metrics
260-
exporter = metrics_exporter.new_metrics_exporter(connection_string='InstrumentationKey=<your-instrumentation-key-here>')
264+
# Set the interval in seconds to 60s, which is the time interval application insights
265+
# aggregates your metrics
266+
exporter = metrics_exporter.new_metrics_exporter(
267+
connection_string='InstrumentationKey=<your-instrumentation-key-here>',
268+
export_interval=60,
269+
)
261270
exporter.add_telemetry_processor(callback_function)
262271
view_manager.register_exporter(exporter)
263272
@@ -267,7 +276,6 @@ Modifying Metrics
267276
268277
mmap.measure_int_put(CARROTS_MEASURE, 1000)
269278
mmap.record(tmap)
270-
# Default export interval is every 15.0s
271279
272280
print("Done recording metrics")
273281

contrib/opencensus-ext-azure/examples/metrics/simple.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import os
16+
1517
from opencensus.ext.azure import metrics_exporter
1618
from opencensus.stats import aggregation as aggregation_module
1719
from opencensus.stats import measure as measure_module
@@ -34,12 +36,12 @@
3436

3537

3638
def main():
37-
# Enable metrics
38-
# Set the interval in seconds in which you want to send metrics
39-
# TODO: you need to specify the instrumentation key in a connection string
40-
# and place it in the APPLICATIONINSIGHTS_CONNECTION_STRING
41-
# environment variable.
42-
exporter = metrics_exporter.new_metrics_exporter()
39+
# Enable metrics. Set the interval in seconds to 60s, which is the time
40+
# interval application insights aggregates your metrics
41+
exporter = metrics_exporter.new_metrics_exporter(
42+
connection_string=os.environ["APPLICATIONINSIGHTS_CONNECTION_STRING"],
43+
export_interval=60,
44+
)
4345
view_manager.register_exporter(exporter)
4446

4547
view_manager.register_view(CARROTS_VIEW)

contrib/opencensus-ext-azure/examples/metrics/standard.py

Lines changed: 0 additions & 40 deletions
This file was deleted.

contrib/opencensus-ext-azure/examples/metrics/sum.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import os
1516
import time
1617

1718
from opencensus.ext.azure import metrics_exporter
@@ -36,12 +37,12 @@
3637

3738

3839
def main():
39-
# Enable metrics
40-
# Set the interval in seconds in which you want to send metrics
41-
# TODO: you need to specify the instrumentation key in a connection string
42-
# and place it in the APPLICATIONINSIGHTS_CONNECTION_STRING
43-
# environment variable.
44-
exporter = metrics_exporter.new_metrics_exporter()
40+
# Enable metrics. Set the interval in seconds to 60s, which is the time
41+
# interval application insights aggregates your metrics
42+
exporter = metrics_exporter.new_metrics_exporter(
43+
connection_string=os.environ["APPLICATIONINSIGHTS_CONNECTION_STRING"],
44+
export_interval=60,
45+
)
4546
view_manager.register_exporter(exporter)
4647

4748
view_manager.register_view(NUM_REQUESTS_VIEW)

contrib/opencensus-ext-azure/opencensus/ext/azure/common/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
__version__ = '1.1.8'
15+
__version__ = '1.1.9'

contrib/opencensus-ext-azure/opencensus/ext/azure/trace_exporter/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ def span_data_to_envelope(self, sd):
9696
)
9797
if sd.span_kind == SpanKind.SERVER:
9898
if ERROR_MESSAGE in sd.attributes:
99-
envelope.name = 'Microsoft.ApplicationInsights.Exception'
99+
exc_env = Envelope(**envelope)
100+
exc_env.name = 'Microsoft.ApplicationInsights.Exception'
100101
data = ExceptionData(
101102
exceptions=[{
102103
'id': 1,
@@ -107,8 +108,8 @@ def span_data_to_envelope(self, sd):
107108
'parsedStack': sd.attributes.get(STACKTRACE, None)
108109
}],
109110
)
110-
envelope.data = Data(baseData=data, baseType='ExceptionData')
111-
yield envelope
111+
exc_env.data = Data(baseData=data, baseType='ExceptionData')
112+
yield exc_env
112113

113114
envelope.name = 'Microsoft.ApplicationInsights.Request'
114115
data = Request(

0 commit comments

Comments
 (0)