You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-monitor/app/api-filtering-sampling.md
+48Lines changed: 48 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -376,6 +376,54 @@ For a summary of the non-custom properties available on the telemetryItem, see [
376
376
377
377
You can add as many initializers as you like, and they are called in the order they are added.
378
378
379
+
### OpenCensus Python telemetry processors
380
+
381
+
Telemetry processors in OpenCensus Python are simply callback functions called to process telemetry before they are exported. Your callback function must accept an [envelope](https://github.com/census-instrumentation/opencensus-python/blob/master/contrib/opencensus-ext-azure/opencensus/ext/azure/common/protocol.py#L86) data type as its parameter. Your callback function can return `False` if you do not want a envelopes to be exported. You can see the schema for Azure Monitor data types in the envelopes [here](https://github.com/census-instrumentation/opencensus-python/blob/master/contrib/opencensus-ext-azure/opencensus/ext/azure/common/protocol.py).
382
+
383
+
```python
384
+
# Example for log exporter
385
+
import logging
386
+
387
+
from opencensus.ext.azure.log_exporter import AzureLogHandler
388
+
389
+
logger = logging.getLogger(__name__)
390
+
391
+
# Callback function to append '_hello' to each log message telemetry
You can add as many processors as you like, and they are called in the order they are added. If one processor should throw an exception, it does not impact the following processors.
0 commit comments