Graphite plugin
Overview
The Graphite plugin connects QALIPSIS to Graphite using the pickle or plaintext protocol.
- Technology addressed
-
Graphite: https://graphiteapp.org/
- Dependency
-
io.qalipsis:plugin-graphite - Namespace in scenario
-
graphite() - Client library
Supported steps
Poll step
The poll step within the Graphite plugin collects metrics from a Graphite server and broadcasts them to other components.
- Ancestor
-
Scenario or Step
- Functionality
-
The ‘poll’ step is typically used to collect and distribute metrics for monitoring and visualization purposes.
- Example
graphite().poll {
name = "my-poll-step"
connect {
server("http://localhost:8080")
}
query(
GraphiteQuery("device.battery-state.*")
.from(
GraphiteMetricsTime(
2,
GraphiteMetricsTimeSignUnit.MINUS,
GraphiteMetricsTimeUnit.DAYS
)
)
.noNullPoints(true)
)
broadcast(123, Duration.ofSeconds(20))
pollDelay(Duration.ofSeconds(1))
}
- Reference documentation
-
Refer to the Graphite documentation for parameter and configuration information.
Save step
The save step within the Graphite plugin persists records into a Graphite database using the save query.
- Ancestor
-
Scenario or Step
- Functionality
-
The
savestep’s input and step context are used to generate documents to save into Graphite. - Example
.graphite()
.save {
connect {
server("localhost", 2003)
}
records { StepContext, input ->
listOf(
GraphiteRecord(
metricPath = "device.battery-state.${input.deviceId.lowercase()}",
value = input.batteryLevel,
timestamp = input.timestamp
)
)
}
monitoring {
events = false
meters = true
}
}
- Reference documentation
-
Refer to the Graphite documentation for further parameter and configuration information.
Configuration
DSL parameters
Available parameters are described in the table below.
| Parameter | Description |
|---|---|
|
Configures the connection to the Graphite server. Example (Save)
Example (Poll)
|
|
Sets the base URL of the Graphite HTTP server used to execute queries. Example (Save)
Example (Poll)
|
|
Factory that produces a collection of Example
|
|
Defines the data format of the saved records. Example (arrayOf tags)
Example (mapOf tags)
|
|
Metric name or path used by Graphite. Example
|
|
Numeric value to record. Example
|
|
Captures the exact moment the value recorded. Example
|
|
Optional labels attached to the record. Examples
|
|
Configures QALIPSIS monitoring (meters/events) for the step. |
|
Specifies a query to poll data from the Graphite server. Example
|
|
Adds a new target to the request. Example
|
|
Adds a new target defined on a series by tag to the request. Example
|
|
Sets the start time for the query. Accepts multiple types; Instant overload requires a date after epoch. Examples
|
|
Sets the end time for the query. Examples
|
|
When true, null points are excluded from the returned series. Example
|
|
The window of time to retrieve data from Graphite. Example
|
|
Units for the Graphic Metrics Time Example
|
|
Configures how polled results are delivered to scenario minions. |
|
Frequency/delay between two poll executions. Example
|
Shared defaults for Graphite steps
You can define defaults once in the scenario section or just after, and let all following Graphite steps inherit them.
scenario {
graphite().defaults { (1)
pollConnection {
server("http://localhost:8090/render")
}
saveConnection {
server("localhost", 2003)
protocol(GraphiteProtocol.PICKLE)
}
monitoring {
events = true
meters = true
}
}
}
| 1 | Defaults are applied to subsequent Graphite steps in the same scenario. Individual steps can still override values. |
Analytics
QALIPSIS can publish the meters and events collected during a campaign to Graphite through dedicated publishers.
Configure the publishers in the factory configuration, separate from the scenario DSL. Refer to Provide configuration for information about specifying the configuration to QALIPSIS.
Meters
The meters publisher sends the meter snapshots collected during a campaign to Graphite using the configured transport protocol.
meters:
export:
graphite:
enabled: true
host: localhost
port: 2004
protocol: PICKLE
batch-size: 100
prefix: qalipsis.
publishers: 1
The parameters used to configure the publication of meters to Graphite are described in the table below.
| Parameter | Description |
|---|---|
|
Activates the publication of meters to Graphite. Must be set to |
|
Host of the Graphite instance receiving the meters. |
|
Port of the Graphite instance receiving the meters. |
|
Transport protocol used to send meters to Graphite. Acceptable values are |
|
Maximum number of meter snapshots batched together before being sent to Graphite. |
|
Prefix prepended to every metric name when publishing to Graphite. |
|
Number of concurrent publishers that can send meter batches to Graphite. |
Events
The events publisher buffers the events emitted during a campaign and sends them to Graphite using the configured transport protocol.
events:
export:
graphite:
enabled: true
min-level: TRACE
host: localhost
port: 2004
protocol: PICKLE
batch-size: 100
linger-period: 10s
publishers: 2
prefix: qalipsis.
The parameters used to configure the publication of events to Graphite are described in the table below.
| Parameter | Description |
|---|---|
|
Activates the publication of events to Graphite. Must be set to |
|
Minimum event level published. Acceptable values are |
|
Host of the Graphite instance receiving the events. |
|
Port of the Graphite instance receiving the events. |
|
Transport protocol used to send events to Graphite. Acceptable values are |
|
Maximum number of events batched together before being sent to Graphite. |
|
Maximum time the events are buffered before forcing a flush to Graphite, even when the batch size is not reached. |
|
Number of concurrent publishers that can send event batches to Graphite. |
|
Prefix prepended to every event name when publishing to Graphite. |
- Reference Documentation
-
Refer to Monitoring test campaigns for a further explanation of the meter and event parameter values.