Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ import requests

from azure_monitor import AzureMonitorSpanExporter
from opentelemetry import trace
from opentelemetry.ext import http_requests
from opentelemetry.ext.requests import RequestsInstrumentor
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchExportSpanProcessor

Expand All @@ -80,7 +80,7 @@ exporter = AzureMonitorSpanExporter(
span_processor = BatchExportSpanProcessor(exporter)
tracer_provider.add_span_processor(span_processor)

http_requests.enable(tracer_provider)
RequestsInstrumentor().instrument()
response = requests.get(url="https://azure.microsoft.com/")
```

Expand Down Expand Up @@ -128,8 +128,6 @@ This example shows how to track a counter metric and send it as telemetry every
* Alternatively, you can specify your `connection string` in an environment variable ``APPLICATIONINSIGHTS_CONNECTION_STRING``.

```python
import time

from azure_monitor import AzureMonitorMetricsExporter
from opentelemetry import metrics
from opentelemetry.sdk.metrics import Counter, MeterProvider
Expand All @@ -154,5 +152,5 @@ requests_counter = meter.create_metric(
testing_labels = {"environment": "testing"}

requests_counter.add(25, testing_labels)
time.sleep(100)
input("...")
```