Skip to content

Commit b6dae09

Browse files
authored
Merge pull request #27 from lyred193/lurious/loongsuite-instrument
feat: add loongsuite-instrument
2 parents 434e17d + dec566f commit b6dae09

File tree

3 files changed

+46
-13
lines changed

3 files changed

+46
-13
lines changed

instrumentation-genai/opentelemetry-instrumentation-agentscope/README.md

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# OpenTelemerty Agentscope Instrumentation
32

43
Agentscope Python Agent provides observability for Agentscope applications. This document provides examples of usage and results in the Agentscope instrumentation. For details on usage and installation of LoongSuite and Jaeger, please refer to [LoongSuite Documentation](https://github.com/alibaba/loongsuite-python-agent/blob/main/README.md).
@@ -61,17 +60,25 @@ for _ in range(3):
6160
msg = monster(msg)
6261
```
6362

64-
### Collect Data
63+
### Collect Data
64+
65+
There are two ways to run the `demo.py` script with instrumentation:
6566

66-
Run the `demo.py` script using OpenTelemetry
67+
#### Option 1: Using OpenTelemetry
6768

6869
```shell
6970
opentelemetry-instrument \
70-
7171
--traces_exporter console \
72-
7372
--service_name demo \
73+
python demo.py
74+
```
75+
76+
#### Option 2: Using Loongsuite
7477

78+
```shell
79+
loongsuite-instrument \
80+
--traces_exporter console \
81+
--service_name demo \
7582
python demo.py
7683
```
7784

@@ -175,21 +182,31 @@ This configuration specifies that LoongCollector will accept OTLP-formatt
175182
nohup ./loongcollector > stdout.log 2> stderr.log &
176183
```
177184

178-
## Run the Agentscope Example
185+
## Run the Agentscope Example
186+
187+
There are two ways to run the agentscope example:
188+
189+
### Option 1: Using OpenTelemetry
179190

180191
```shell
181192
opentelemetry-instrument \
182-
183193
--exporter_otlp_protocol grpc \
184-
185194
--traces_exporter otlp \
186-
187195
--exporter_otlp_insecure true \
188-
189196
--exporter_otlp_endpoint 127.0.0.1:6666 \
190-
191197
--service_name demo \
198+
python demo.py
199+
```
200+
201+
### Option 2: Using Loongsuite
192202

203+
```shell
204+
loongsuite-instrument \
205+
--exporter_otlp_protocol grpc \
206+
--traces_exporter otlp \
207+
--exporter_otlp_insecure true \
208+
--exporter_otlp_endpoint 127.0.0.1:6666 \
209+
--service_name demo \
193210
python demo.py
194211
```
195212

instrumentation-genai/opentelemetry-instrumentation-agno/README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pip install ./instrumentation-genai/opentelemetry-instrumentation-agno
1313

1414
### Build the Example
1515

16-
Follow the official [Agno Documentation](https://docs.agno.com/introduction) to create a sample file named `demo.py`
16+
Follow the official [Agno Documentation](https://docs.agno.com/introduction) to create a sample file named `demo.py`
1717
```python
1818
import os
1919
os.environ["DEEPSEEK_API_KEY"] = "YOUR-API-KEY"
@@ -40,7 +40,9 @@ agent.print_response(
4040

4141
### Collect Data
4242

43-
Run the `demo.py` script using OpenTelemetry
43+
There are two ways to run the `demo.py` script with instrumentation:
44+
45+
### Option 1: Using OpenTelemetry
4446

4547
```shell
4648
export OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true
@@ -51,7 +53,20 @@ opentelemetry-instrument \
5153
--exporter_otlp_insecure true \
5254
--exporter_otlp_endpoint YOUR-END-POINT \
5355
--service_name demo \
56+
python demo.py
57+
```
58+
59+
### Option 2: Using Loongsuite
60+
61+
```shell
62+
export OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=true
5463

64+
loongsuite-instrument \
65+
--exporter_otlp_protocol grpc \
66+
--traces_exporter otlp \
67+
--exporter_otlp_insecure true \
68+
--exporter_otlp_endpoint YOUR-END-POINT \
69+
--service_name demo \
5570
python demo.py
5671
```
5772

opentelemetry-instrumentation/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ dependencies = [
3535
[project.scripts]
3636
opentelemetry-bootstrap = "opentelemetry.instrumentation.bootstrap:run"
3737
opentelemetry-instrument = "opentelemetry.instrumentation.auto_instrumentation:run"
38+
loongsuite-instrument = "opentelemetry.instrumentation.auto_instrumentation:run"
3839

3940
[project.entry-points.opentelemetry_environment_variables]
4041
instrumentation = "opentelemetry.instrumentation.environment_variables"

0 commit comments

Comments
 (0)