Skip to content

Commit 4cd6824

Browse files
authored
Merge pull request #109341 from lzchen/patch-1
Update telemetry processors for rolename
2 parents afe5408 + 3ef8f3d commit 4cd6824

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

articles/azure-monitor/app/api-filtering-sampling.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,14 @@ You can add as many initializers as you like, and they are called in the order t
376376

377377
Telemetry processors in OpenCensus Python are simply callback functions called to process telemetry before they are exported. The 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. To filter out telemetry from being exported,make sure the callback function returns `False`. 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).
378378

379+
> [!NOTE]
380+
> You can modify the `cloud_RoleName` by changing the `ai.cloud.role` attribute in the `tags` field.
381+
382+
```python
383+
def callback_function(envelope):
384+
envelope.tags['ai.cloud.role'] = 'new_role_name.py'
385+
```
386+
379387
```python
380388
# Example for log exporter
381389
import logging

0 commit comments

Comments
 (0)