PxL
PxL Language Overview
Pixie Language (PxL) is a domain-specific language for working with machine data, and uses a Python dialect. It is heavily influenced by the popular data processing library Pandas, and is almost a subset of Pandas. PxL is used by the Pixie Platform, allowing developers to create high performance data processing pipelines to monitor, secure and operate their applications and infrastructure.
Like Python, PxL is implicitly and strongly typed, supports high-level data types, and functions. Unlike Python, PxL is a dataflow language allows the Pixie platform to heavily optimize it's execution performance, while maintaining expressiveness for data processing. PxL programs are typically short-lived and have no implicit side effects. As a result, PxL has no support for classes, exceptions, other such features of Python
PxL can be executed by the Pixie platform by using either the web based UI, API or CLI.
Data Types
PxL has a rich type system consisting of both concrete and semantic types. Semantic types are used for the following purposes:
- The query planner uses types to determine which PEM agents to pull data from.
- The UI uses types to determine how to visualize the data. For example, data of the
ST_BYTES
semantic type will be displayed with the appropriate label (KB
, MB
, etc).
Concrete Types
The Pixie execution engine supports many concrete data types:
Type | Description |
---|
INT64 | 64-bit integer |
UINT128 | Unsigned 128-bit integer |
FLOAT64 | Double precision floating point |
TIME64NS | Time represented as 64-bit integer in nanoseconds since UNIX epoch |
STRING | UTF-8 encoded string value |
BOOLEAN | Bool |
See the complete list of concrete data types.
Semantic Types
The Pixie execution engine supports many semantic data types, including those related to the following:
- Kubernetes (e.g. pod name, node name, namespace name, pod status)
- Infrastructure (e.g. IP address, port name, upid)
- Metrics (e.g. bytes, duration in nanoseconds, throughput per nanosecond)
See the complete list of semantic data types.
Value concepts
PxL is a declarative language: programs specify what is to be done and evaluation is performed by the PxL engine based on calling a function with side-effects (for example px.display
). All value types with PxL are immutable, and every assignment creates an implicit copy (don't worry these are automatically optimized by our engine).
The basic unit of operation for PxL is a Dataframe. A Dataframe is basically a table of data and associated metadata operations. You can perform operations on a Dataframe to derive new Dataframes. As a matter of fact, PxL basically specifies a sequence of dataflows necessary to transform a set of Dataframes into the final result.
PxL Details
- DataFrame Docs
- Operator Overview: The DataFrame methods that correspond to operators.
- Engine Execution Functions: Functions that are executed inside of the Pixie data engine.
- Compile Time Functions: Helper functions that are evaluated and used at compile-time.
- Tracepoint Docs
- Tracepoint Fields: The fields to use in the probe function
- Tracepoint Management: Decorators to write around the tracepoint functions.
- Tracepoint Decorators: The decorators used as part to wrap probe functions.
- OpenTelemetry Export Docs