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: content/en/01-about-pixie/04-roadmap.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ Pixie’s edge compute engine allows us to apply ML/AI on unsampled data. We wil
21
21
22
22
### Support the ecosystem
23
23
24
-
Pixie has a versatile execution engine which can ingest and export data in a variety of formats. We plan to export and ingest data in the OpenTelemetry format which will enable developers to consume Pixie data along with the data produced by other tools (Jaeger, Prometheus). We also plan to leverage our [client APIs](/reference/api) in order to support tighter integrations with other open source projects.
24
+
Pixie has a versatile execution engine which can ingest and export data in a variety of formats. Pixie currently supports [exporting data in the OpenTelemetry format](/tutorials/integrations/otel/) which enables developers to consume Pixie data along with data produced by other tools (Jaeger, Prometheus. We plan to add ingest in the future. We also plan to leverage our [client APIs](/reference/api) in order to support tighter integrations with other open source projects.
Copy file name to clipboardExpand all lines: content/en/01-about-pixie/05-faq.md
+1-5Lines changed: 1 addition & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,11 +128,7 @@ Go, C++ and Rust are currently supported. The [Roadmap](/about-pixie/roadmap) co
128
128
129
129
### How do I export data from the Pixie platform? Import data?
130
130
131
-
Pixie offers two [client libraries](/reference/api/overview/) (Go, Python) to allow developers to easily integrate Pixie observability data into their existing stack.
132
-
133
-
Pixie does not currently offer data ingestion.
134
-
135
-
The [Roadmap](/about-pixie/roadmap) contains plans to support exporting or ingesting data in a variety of additional formats.
131
+
Pixie offers two [client libraries](/reference/api/overview/) (Go, Python) to allow developers to easily integrate Pixie observability data into their existing stack. You can also use Pixie's [Plugin System](/reference/plugins/plugin-system/) to [export data in the OpenTelemetry format](/tutorials/integrations/otel/). Pixie does not currently offer data ingestion. The [Roadmap](/about-pixie/roadmap) contains plans to support exporting or ingesting data in a variety of additional formats.
metaTitle: "Tutorials | Integrations and Alerts | Pixie <> OpenTelemetry"
4
-
metaDescription: "Export Data to OpenTelemetry"
2
+
title: "Export OpenTelemetry Data"
3
+
metaTitle: "Tutorials | Integrations and Alerts | Export OpenTelemetry Data"
4
+
metaDescription: "Export OpenTelemetry Data"
5
5
order: 3
6
6
redirect_from:
7
7
- /tutorials/otel/
8
8
---
9
9
10
+
This tutorial will demonstrate how to export Pixie data in the OpenTelemetry (OTel) format.
10
11
11
-
Pixie comes packaged with an OpenTelemetry exporter. You can write PxL scripts that define the transformation of Pixie DataFrames into OpenTelemetry data. This article walks through a script that exports HTTP data collected by Pixie into an OpenTelemetry endpoint. More detailed PxL documentation for the OpenTelemetry integration is available [here](/reference/pxl/otel-export).
12
+
To do this, we will take the following steps:
12
13
14
+
1. Deploy an OTel collector to our cluster.
15
+
2. Write a PxL script that uses the [OTel methods](/reference/pxl/otel-export/) to transformation Pixie DataFrames into OTel data.
16
+
3. Setup the Pixie [Plugin System](/reference/plugins/plugin-system/) to run the PxL script at regularly scheduled intervals.
13
17
14
-
## Example OpenTelemetry Export PxL Script
18
+
Note that [Pixie's API](/using-pixie/api-quick-start/) can also be used to run the PxL scripts developed in Step 2, however this tutorial will cover the Plugin System only.
15
19
16
-
The following [PxL script](/tutorials/pxl-scripts/write-pxl-scripts/#overview) calculates the rate of HTTP requests made to each pod in your cluster and exports that data as an OpenTelemetry Gauge metric.
20
+
## Deploy the OTel Collector
17
21
22
+
If you don't already have an OTel collector set up, you can follow the directions to deploy our demo collector [here](https://github.com/pixie-io/pixie-demos/tree/main/otel-collector).
18
23
19
-
```python
24
+
Most OTel collectors are configured to forward metrics to _other tools_ such as Prometheus or Jaeger. For the sake of this tutorial, our demo collector simply outputs the metrics it receives to its logs.
25
+
26
+
## Write the PxL script
27
+
28
+
PxL scripts are used to query telemetry data collected by the Pixie Platform. Our PxL script will also export the Pixie data in the OTel format. We'll use the Live UI's `Scratch Pad` to develop our PxL script.
29
+
30
+
1. Open Pixie's [Live UI](/using-pixie/using-live-ui/).
31
+
32
+
2. Select the `Scratch Pad` script from the `script` drop-down menu in the top left.
33
+
34
+
3. Open the script editor using the keyboard shortcut: `ctrl+e` (Windows, Linux) or `cmd+e` (Mac).
35
+
36
+
4. Replace the contents of the `PxL Script` tab with the following. Hover over the code block below to show the copy button in the top-right.
5. Run the script using the `RUN` button in the top right or by using the keyboard shortcut: `ctrl+enter` (Windows, Linux) or `cmd+enter` (Mac).
83
+
84
+
6. Hide the script editor using `ctrl+e` (Windows, Linux) or `cmd+e` (Mac).
85
+
86
+
> Your Live UI should output something similar to the following:
63
87
88
+
<svgtitle='OTel PxL script output in the Live UI'src='plugin/otel-script-output.png'/>
64
89
65
-
## The Data
66
-
The first part of this script (lines 1-19) read in the `http_events` data and count the number of requests made to each pod from the last 10s.
90
+
> This PxL script calculates the rate of HTTP requests made to each pod in your cluster and exports that data as an OTel Gauge metric.
67
91
92
+
7. To validate that the data has been received by the OTel collector, check logs for the the `otel-collector-*` pod. If the export was successful, you should see logs similar to:
93
+
94
+
```bash
95
+
2022-04-15T20:48:20.633Z INFO loggingexporter/logging_exporter.go:54 MetricsExporter {"#metrics": 32}
96
+
```
97
+
98
+
> If this is your first PxL script, you may want to check out the [Writing a PxL Script Tutorial](/tutorials/pxl-scripts/write-pxl-scripts/) to learn more. We'll give a high-level overview of this script below.
99
+
100
+
### The Data
101
+
102
+
The first part of the PxL script (lines 1-19) read in the `http_events` data and count the number of requests made to each pod from the last 10s.
To export the data, you’ll call `px.export` with the DataFrame as the first argument and the export target `px.otel.Data` as the second argument.
94
-
126
+
To export the data, you’ll call `px.export` with the DataFrame as the first argument and the export target `px.otel.Data` as the second argument.
95
127
96
128
```python
97
129
px.export(df, px.otel.Data(...))
98
130
```
99
131
100
-
101
132
The export target (`px.otel.Data`) describes which columns to use for the corresponding OpenTelemetry fields. You specify a column using the same syntax as in a regular query: `df.column_name` or `df[‘column_name’]`. The columns must reference a column available in the `df` argument or the PxL compiler will throw an error
102
133
103
-
104
-
## Specifying a Collector Endpoint and Authentication
134
+
### Specifying a Collector Endpoint and Authentication
105
135
106
136
The PxL OpenTelemetry exporter needs to talk with a collector. You must specify this information via the `endpoint` parameter:
The endpoint url must be an OpenTelemetry gRPC endpoint. If the OpenTelemetry gRPC endpoint is not secured with SSL, you can set `insecure=True`. Don’t specify a protocol prefix. Optionally, you can also specify the headers passed to the endpoint. Some OpenTelemetry collector providers look for authentication tokens or api keys in the connection context. The headers field is where you can add this information.
118
146
119
-
The endpoint url must be an OpenTelemetry grpc endpoint and must be secured with SSL. Don’t specify a protocol prefix. Optionally, you can also specify the headers passed to the endpoint. Some OpenTelemetry collector providers look for authentication tokens or api keys in the connection context. The headers field is where you can add this information.
147
+
Note that if you’re writing a [plugin script](/reference/plugins/plugin-system), this information will be passed in by the plugin context and should not be specified. We'll remove this endpoint parameter when we set up the Plugin in Step 3.
120
148
121
-
Note that if you’re writing a [plugin script](/reference/plugins/plugin-system), this information should be passed in from the plugin context.
122
-
123
-
124
-
## Transforming Data
149
+
### Transforming Data
125
150
126
151
The core idea of the PxL OpenTelemetry export is that you’re converting columnar data from a Pixie DataFrame into the fields of whatever OpenTelemetry data that you wish to capture. You can reference a column by using the attribute syntax `df.column_name`. Under the hood, Pixie will convert the values for each row into a new OpenTelemetry message. The columns must match up with the DataFrame that you are exporting (the first argument to `px.export`), otherwise you will receive a compiler error.
127
152
128
-
129
-
## Specifying a Resource
153
+
### Specifying a Resource
130
154
131
155
The `resource` parameter defines the entity producing the [telemetry data](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/sdk.md). Users define the `resource` argument as a dictionary mapping attribute keys to the STRING columns that populate the attribute values. The PxL configuration expects `service.name` to be set, all other attributes are optional.
132
-
156
+
133
157
When creating new attribute keys, keep in mind OpenTelemetry has a [recommended pattern](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/README.md#document-conventions) that you should follow to maintain broad compatibility with OpenTelemetry collectors.
134
158
135
159
```python
@@ -141,13 +165,10 @@ resource={
141
165
},
142
166
```
143
167
144
-
145
-
146
-
## Specifying Data
168
+
### Specifying Data
147
169
148
170
The data parameter allows you to specify a list of metrics or traces that are generated from the DataFrame. In the example script, we specify a single Gauge metric for the `df.request_per_s` column. We also supply an attribute for the metric, `req_path`. Each Metric and Trace type supports a custom attribute field. Metric/Trace attributes work similarly to Resource attributes, but they are scoped only to the specific method
149
171
150
-
151
172
```python
152
173
data=[
153
174
px.otel.metric.Gauge(
@@ -161,6 +182,94 @@ data=[
161
182
]
162
183
```
163
184
164
-
165
185
We currently support a limited set of OpenTelemetry signal types: `metric.Gauge`, `metric.Summary` and `trace.Span`. We also support a subset of the available fields for each instrument. You can see the full set of features [in our api documentation.](/reference/pxl/otel-export) If you want support for other fields, please [open an issue](https://github.com/pixie-io/pixie).
166
186
187
+
## Setup the Plugin
188
+
189
+
Now that we have a PxL script that exports OTel data, let's set up the [Plugin System](/reference/plugins/plugin-system/) to run this script at regularly scheduled intervals.
190
+
191
+
1. Navigate to the `Plugin` tab on the `Admin` page (`/admin/plugins`).
192
+
193
+
2. Click the toggle to enable the OpenTelemetry plugin.
194
+
195
+
3. Expand the plugin row (with the arrow next to the toggle) and enter the export path.
196
+
197
+
> If you are using the demo collector from [Step 1](/tutorials/integrations/otel/#deploy-the-otel-collector), then you'll use the same export path pictured below: `otel-collector.default.svc.cluster.local:4317`
198
+
199
+
4. Click the toggle to disable "Secure connections with TLS" and press the `SAVE` button. The demo OTel collector does not support TLS.
200
+
201
+
<svgtitle='Plugins are enabled in the Admin UI.'src='plugin/plugins_page.png'/>
202
+
203
+
5. Click the database icon in the left nav bar to open the data export configuration page.
204
+
205
+
<svgtitle='Select the data export icon.'src='plugin/data-export-icon.png'/>
206
+
207
+
6. The OpenTelemetry plugin comes with several pre-configured OTel export PxL scripts (more coming soon!). Click the toggle to disable these scripts for now. For the sake of this tutorial, we want to ensure that the data that the collector receives is actually from our custom script.
208
+
209
+
<svgtitle='Disable the pre-configured OpenTelemetry scripts.'src='plugin/data-export.png'/>
210
+
211
+
7. Select the `+ CREATE SCRIPT` button.
212
+
213
+
8. Enter `HTTP Throughput` in the `Script Name` field.
214
+
215
+
9. Replace the contents of the `PxL` field with the following:
# Change the denominator if you change start_time above.
232
+
df.requests_per_s = df.throughput /10
233
+
234
+
px.export(df, px.otel.Data(
235
+
resource={
236
+
# service.name is required by OpenTelemetry.
237
+
'service.name' : df.service,
238
+
'service.instance.id': df.pod,
239
+
'k8s.pod.name': df.pod,
240
+
},
241
+
data=[
242
+
px.otel.metric.Gauge(
243
+
name='http.throughput',
244
+
description='The number of messages sent per second',
245
+
value=df.requests_per_s,
246
+
attributes={
247
+
'req_path': df.req_path,
248
+
}
249
+
)
250
+
]
251
+
))
252
+
```
253
+
254
+
> This is the script we developed in [Step 2](/tutorials/integrations/otel/#write-the-pxl-script) with a few modifications:
255
+
256
+
> - We changed the DataFrame's `start_time` argument to use `px.plugin.start_time`. This value can be configured using the `Summary Window` field on this page.
257
+
258
+
> - We removed the `Endpoint` parameter. We configured the plugin with this value in Step 3.
259
+
260
+
> - We removed the `px.display()` call on the last line. This was used to display the data in the Live UI when developing our script in the Scratch Pad.
261
+
262
+
10. Select the `OpenTelemetry` option from the `Plugin` field drop-down menu.
263
+
264
+
11. Click the `SAVE` button.
265
+
266
+
12. To validate that the data is being received by the OTel collector, check logs for the the `otel-collector-*` pod. If the plugin configuration was successful, you should see logs every 10 seconds:
267
+
268
+
```bash
269
+
2022-04-15T21:17:27.530Z INFO loggingexporter/logging_exporter.go:54 MetricsExporter {"#metrics": 32}
270
+
2022-04-15T21:17:37.570Z INFO loggingexporter/logging_exporter.go:54 MetricsExporter {"#metrics": 30}
271
+
2022-04-15T21:17:47.609Z INFO loggingexporter/logging_exporter.go:54 MetricsExporter {"#metrics": 29}
272
+
2022-04-15T21:17:57.449Z INFO loggingexporter/logging_exporter.go:54 MetricsExporter {"#metrics": 29}
273
+
```
274
+
275
+
Congrats! You're now exporting Pixie data to an OTel collector.
Copy file name to clipboardExpand all lines: content/en/05-reference/03-plugins/01-plugin-system.md
+17-9Lines changed: 17 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,18 @@
2
2
title: "Pixie Plugin System"
3
3
metaTitle: "Reference | Plugins | Pixie Plugin System "
4
4
metaDescription: "Pixie's Plugin System"
5
-
order: 1
5
+
order: 1
6
6
---
7
7
8
-
Pixie's primary focus is to build a real-time debugging platform, not a full-fledged observability solution. Pixie provides a plugin system to integrate with external tools to enable capabilities like longterm data retention and alerting.
8
+
Pixie's primary focus is to build a real-time debugging platform, not a full-fledged observability solution. Use the plugin system to integrate with external tools to enable capabilities like longterm data retention and alerting.
9
9
10
-
-[*Longterm Data Retention*](#longterm-data-retention): Pixie only retains up to 24 hours of data. Leverage an external datastore for longterm data retention by sending Pixie data in the [OpenTelemetry](https://opentelemetry.io/) format. Future support will be added for querying longterm data from within the Pixie UI, allowing you to use PxL and Pixie's versatile live views.
11
-
-*Alerts* (Coming Soon!): Power alerts using Pixie's rich dataset, all configurable from within Pixie's UI.
10
+
-[Longterm Data Retention](#longterm-data-retention): Pixie retains up to 24 hours of data. Leverage an external datastore for longterm data retention by sending Pixie data in the [OpenTelemetry](https://opentelemetry.io/) format. Future support will be added for querying longterm data from within the Pixie UI.
11
+
12
+
-[Alerts](#alerts) (coming soon): Power alerts using Pixie's rich dataset, all configurable from within the Pixie UI.
12
13
13
14
## Enabling a Plugin
14
15
15
-
Plugins can be configured from within the Admin UI.
16
+
Plugins can be configured from within the Admin UI.
16
17
17
18
<svgtitle='Plugins are accessible through the Admin UI.'src='plugin/plugins_page.png'/>
18
19
@@ -22,15 +23,17 @@ Plugins can be configured from within the Admin UI.
22
23
23
24
## Longterm Data Retention
24
25
25
-
Enable a plugin which offers longterm data retention capabilities to send Pixie data to an external datastore. This plugin allows you to configure PxL scripts to export data at regularly scheduled intervals. This only currently supports exporting data through the [OpenTelemetry](https://opentelemetry.io/) format.
26
+
<Alertvariant="outlined"severity="info">Check out the <ahref="/tutorials/integrations/otel/">tutorial</a> to how to export data in the OTel format.</Alert>
27
+
28
+
Enable a plugin which offers longterm data retention capabilities to send Pixie data to an external datastore. This plugin allows you to configure PxL scripts to export data at regularly scheduled intervals. This only currently supports exporting data through the [OpenTelemetry](https://opentelemetry.io/) format.
26
29
27
30
By default, the plugin provider has configured a set of preset scripts. These will automatically start running and exporting data from all clusters in the org as soon as the plugin is enabled. Users can also choose to export custom data by creating a custom export script.
28
31
29
32
### Configuring Preset Export Scripts
30
33
31
34
<svgtitle='You can view preset scripts for a plugin in the Data Export page.'src='plugin/preset_scripts.png'/>
32
35
33
-
1.[Enable a plugin provider](#enabling-a-plugin) which supports longterm data retention.
36
+
1.[Enable a plugin provider](#enabling-a-plugin) which supports longterm data retention.
34
37
2. Open the Live UI and navigate to the Data Export page in the sidebar (`/configure-data-export`).
35
38
3. All preset scripts are listed under `<Plugin Provider> Scripts`.
36
39
4. Click the toggle to enable/disable the export from the preset script.
@@ -41,7 +44,7 @@ By default, the plugin provider has configured a set of preset scripts. These wi
41
44
42
45
<svgtitle='Create a custom script in the Data Export page by clicking `Create Scripts`.'src='plugin/custom_scripts.png'/>
43
46
44
-
1.[Enable a plugin provider](#enabling-a-plugin) which supports longterm data retention.
47
+
1.[Enable a plugin provider](#enabling-a-plugin) which supports longterm data retention.
45
48
2. Open the Live UI and navigate to the Data Export page in the sidebar (`/configure-data-export`).
46
49
3. Under `Custom Scripts`, click the `Create Scripts` button on the right-hand side.
47
50
4. Enter a script name and description.
@@ -51,7 +54,12 @@ By default, the plugin provider has configured a set of preset scripts. These wi
51
54
8. Select the plugin provider to export this data to.
52
55
9. Click "Create" to save your settings. Data export should start immediately.
53
56
57
+
## Alerts
58
+
59
+
Coming soon!
60
+
54
61
## Contributing a Plugin
55
62
56
-
Interested in contributing a plugin to our Plugin system? Check out our [Pixie Plugin Repository](https://github.com/pixie-io/pixie-plugin) and follow the provided instructions.
63
+
Interested in contributing a Pixie plugin?
57
64
65
+
Check out our [Plugin Repository](https://github.com/pixie-io/pixie-plugin) for more details.
0 commit comments